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 
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:


3rd root of 10 is about:


You can push these things further.  E.g. 

10^(1/3) ~=  2196555918195778106276024585870817879185576760

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)
        return x


 >>> halley(10,3)            # 3rd root of 10 to depth 10
 >>> halley(2,3)             # 3rd root of 10 to depth 10
 >>> halley(12931021,7)      # 7th root of 12931021 to depth 10
 >>> halley(12931021,7,40)   # same to depth 40 (more accurate)

Sorry if this is old hat on sci.math -- thought it was pretty 
cool myself.


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.

More information about the Python-list mailing list