Tuesday, January 26, 2010

[icneylfr] Modern pi formulae

Number of iterations needed for calculation up to 100 digits of pi.

digitsmethoditerations
0.6Gauss-Legendre0
3.0Gauss-Legendre1
6.6355/113
7.1Ramanujan0
8.1Gauss-Legendre2
13.2Chudnovsky0
15.2Ramanujan1
18.7Gauss-Legendre3
23.2Ramanujan2
27.5Chudnovsky1
31.3Ramanujan3
39.3Ramanujan4
40.3Gauss-Legendre4
41.8Chudnovsky2
47.3Ramanujan5
55.3Ramanujan6
56.0Chudnovsky3
63.3Ramanujan7
70.2Chudnovsky4
71.4Ramanujan8
79.4Ramanujan9
83.6Gauss-Legendre5
84.4Chudnovsky5
87.4Ramanujan10
95.4Ramanujan11
98.7Chudnovsky6
103.4Ramanujan12
112.9Chudnovsky7
170.6Gauss-Legendre6

\p250

Digits:
pidiff(x)=-log(abs(4*atan(1)-x))/log(10)

Ramanujan:
f(n)=(4*n)!/(n!)^4*(26390*n+1103)/(396^(4*n))
for(i=0, 12, print(precision(pidiff(99^2/sqrt(8)/sum(n=0, i, f(n))), 10), " ramanujan", i))

Chudnovsky:
c(n)=(-1)^n*(6*n)!/(n!^3)/(3*n)!*(13591409+545140134*n)/(640320^(3*n))
for(i=0, 7, print(precision(pidiff((640320^(3/2))/12/(sum(n=0, i, c(n)))), 10), " chudnovsky", i))

Gauss-Legendre:
k(v)=[(v[1]+v[2])/2, sqrt(v[1]*v[2]), v[3]-v[4]*(v[1]/2-v[2]/2)^2, 2*v[4]]
v=[1, sqrt(0.5), 0.25, 1]
gl(v)=(v[1]+v[2])^2/(4*v[3])
for(i=0, 6, print(precision(pidiff(gl(v)), 10), " gausslegendre", i);v=k(v))

Borwein's quartic:
origv=[sqrt(2)-1,6-4*sqrt(2),8]
f(v)=(1-sqrt(sqrt(1-v[1]^4)))/(1+sqrt(sqrt(1-v[1]^4)))
g(v)=v[2]*(1+v[1])^4-v[3]*v[1]*(1+v[1]+v[1]^2)
v=[f(origv),origv[2],8]
v=[f(v),g(v),4*v[3]]
precision(pidiff(1/v[2]),10)

One iteration of Borwein's formula is exactly two iterations of Gauss-Legendre: Borwein(N) = GL(2*N)

No comments :