Number of iterations needed for calculation up to 100 digits of pi.
digits | method | iterations |
---|---|---|
0.6 | Gauss-Legendre | 0 |
3.0 | Gauss-Legendre | 1 |
6.6 | 355/113 | |
7.1 | Ramanujan | 0 |
8.1 | Gauss-Legendre | 2 |
13.2 | Chudnovsky | 0 |
15.2 | Ramanujan | 1 |
18.7 | Gauss-Legendre | 3 |
23.2 | Ramanujan | 2 |
27.5 | Chudnovsky | 1 |
31.3 | Ramanujan | 3 |
39.3 | Ramanujan | 4 |
40.3 | Gauss-Legendre | 4 |
41.8 | Chudnovsky | 2 |
47.3 | Ramanujan | 5 |
55.3 | Ramanujan | 6 |
56.0 | Chudnovsky | 3 |
63.3 | Ramanujan | 7 |
70.2 | Chudnovsky | 4 |
71.4 | Ramanujan | 8 |
79.4 | Ramanujan | 9 |
83.6 | Gauss-Legendre | 5 |
84.4 | Chudnovsky | 5 |
87.4 | Ramanujan | 10 |
95.4 | Ramanujan | 11 |
98.7 | Chudnovsky | 6 |
103.4 | Ramanujan | 12 |
112.9 | Chudnovsky | 7 |
170.6 | Gauss-Legendre | 6 |
\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 :
Post a Comment