15 Jul
2009
15 Jul
'09
10:02 a.m.
On 7/15/09, Joerg Arndt <arndt@jjj.de> wrote:
AGM16(a,b)= \\ return AGM(a,b) { local(P,M,R); a = sqrt(a); b = sqrt(b); while ( abs(a-b) > eps, \\ eps == 10^(-precision) P=(a+b)/2; M=(a-b)/2; R=(P^4-M^4)^(1/4); a=(P+R)/2; b=(P*R*(P^2+R^2)/2)^(1/4); ); return( a^2 ); }
The rate of convergence is _very_ impressive:
Looking at the code though, I can't help wondering whether it might possibly be massaged into a pair of fourth-order iterations laid end-to-end [no-one would be in the least surprised, as Dorothy Parker might acerbically have observed.] WFL