Wondering about Domingo's Rational Mean book
Kirby Urner
urner at alumni.princeton.edu
Tue May 30 22:44:05 CEST 2000
Have folks on sci.math already discussed
http://www.etheron.net/usuarios/dgomez/Roots.htm
to anyone's recollection? I'd be interested in
comments and/or pointers to previous postings.
I don't have the necessary background to evaluate the
significance of this work, but the algorithms made
interesting programming exercises. Using them, I
was able to get:
3rd root of 2 is about:
65379522
---------
51891761
3rd root of 10 is about:
91969780593702397138462508494860
---------------------------------
42688590663356403236303435376201
You can push these things further. E.g.
10^(1/3) ~= 2196555918195778106276024585870817879185576760
----------------------------------------------
1019550942230358826790302872023722041913882251
I also liked his concise presentation of Halley's method, which
gives me the floating point nth rooth of an integer. Here's
a recursive version:
def halley(P,n,d=10,x=1):
# Source: http://www.etheron.net/usuarios/dgomez/Roots.htm
# P -- find nth root of this number
# n -- whole number root
# d -- level of depth for recursion (default 10)
# x -- initial value of x (default 1)
if d>1:
newx = ((n+1.0)*P*x + (n-1)*(x**(n+1)))/((n-1)*P + (n+1)*x**n)
return halley(P,n,d-1,newx)
else:
return x
Usage:
>>> halley(10,3) # 3rd root of 10 to depth 10
2.1544346900318838
>>> halley(2,3) # 3rd root of 10 to depth 10
1.2599210498948732
>>> halley(12931021,7) # 7th root of 12931021 to depth 10
10.336898680701067
>>> halley(12931021,7,40) # same to depth 40 (more accurate)
10.374031092075427
Sorry if this is old hat on sci.math -- thought it was pretty
cool myself.
Kirby
Cc: people at fluidiom.com (from whence I first learned of
Domingo's work):
=============
>From: "Robert Coulter" <rcoulter at mvrpc.org>
>To: <people at fluidiom.com>
>Subject: fluidiom: math stuff
>Date: Tue, 9 May 2000 16:55:14 -0400
>
>Anybody out there follow what this guy (Domingo Gomez Morin) is up to...?
>Kirby? Allen?
>Would this be useful in fluidiom ... *IS* this "New and Improved"?
>He doesn't seem bashful even as he bashes cartesian thought...
>so he oughta fit in OK around here.
>
>http://www.etheron.net/usuarios/dgomez/default.htm
>
>Core9
More information about the Python-list
mailing list