From Wikipedia, the free encyclopedia
Jonathan and Peter Borwein devised various algorithms to calculate the value of π . The most prominent and oft-used one is explained under Borwein's algorithm and Bailey-Borwein-Plouffe formula .
Other algorithms found by them include the following:
Quadratic convergence, 1987 :
Start out by setting
x
0
=
2
{\displaystyle x_{0}={\sqrt {2}}}
y
0
=
2
4
{\displaystyle y_{0}={\sqrt[{4}]{2}}}
p
0
=
2
+
2
{\displaystyle p_{0}=2+{\sqrt {2}}}
Then iterate
x
k
=
1
2
(
x
k
−
1
1
/
2
+
x
k
−
1
−
1
/
2
)
{\displaystyle x_{k}={\frac {1}{2}}(x_{k-1}^{1/2}+x_{k-1}^{-1/2})}
y
k
=
y
k
−
1
x
k
−
1
1
/
2
+
x
k
−
1
−
1
/
2
y
k
−
1
+
1
{\displaystyle y_{k}={\frac {y_{k-1}x_{k-1}^{1/2}+x_{k-1}^{-1/2}}{y_{k-1}+1}}}
p
k
=
p
k
−
1
x
k
+
1
y
k
+
1
{\displaystyle p_{k}=p_{k-1}{\frac {x_{k}+1}{y_{k}+1}}}
Then pk converges monotonically to π; with
p
k
−
π
=
10
−
2
k
+
1
{\displaystyle p_{k}-\pi =10^{-2^{k+1}}}
for
k
>=
2
{\displaystyle k>=2}
Cubical convergence, 1991 :
Start out by setting
a
0
=
1
3
{\displaystyle a_{0}={\frac {1}{3}}}
s
0
=
3
−
1
2
{\displaystyle s_{0}={\frac {{\sqrt {3}}-1}{2}}}
Then iterate
r
k
+
1
=
3
1
+
2
(
1
−
s
k
3
)
1
/
3
{\displaystyle r_{k+1}={\frac {3}{1+2(1-s_{k}^{3})^{1/3}}}}
s
k
+
1
=
r
k
+
1
−
1
2
{\displaystyle s_{k+1}={\frac {r_{k+1}-1}{2}}}
a
k
+
1
=
r
k
+
1
2
a
k
−
3
k
(
r
k
+
1
2
−
1
)
{\displaystyle a_{k+1}=r_{k+1}^{2}a_{k}-3^{k}(r_{k+1}^{2}-1)}
Then ak converges cubically against 1/π; that is, each iteration approximately triples the number of correct digits.
Quartical convergence, 1984 :
Start out by setting
a
0
=
2
{\displaystyle a_{0}={\sqrt {2}}}
b
0
=
0
{\displaystyle b_{0}=0\,\!}
p
0
=
2
+
2
{\displaystyle p_{0}=2+{\sqrt {2}}}
Then iterate
a
n
+
1
=
a
n
+
1
/
a
n
2
{\displaystyle a_{n+1}={\frac {{\sqrt {a_{n}}}+1/{\sqrt {a_{n}}}}{2}}}
b
n
+
1
=
a
n
(
1
+
b
n
)
a
n
+
b
n
{\displaystyle b_{n+1}={\frac {{\sqrt {a_{n}}}(1+b_{n})}{a_{n}+b_{n}}}}
p
n
+
1
=
p
n
b
n
+
1
(
1
+
a
n
+
1
)
1
+
b
n
+
1
{\displaystyle p_{n+1}={\frac {p_{n}b_{n+1}(1+a_{n+1})}{1+b_{n+1}}}}
Then pk converges quartically against π; that is, each iteration approximately quadruples the number of correct digits. The algorithm is not self-correcting; each iteration must be performed with the desired number of correct digits of π.
Quintical convergence:
Start out by setting
a
0
=
1
2
{\displaystyle a_{0}={\frac {1}{2}}}
s
0
=
5
(
5
−
2
)
{\displaystyle s_{0}=5({\sqrt {5}}-2)}
Then iterate
x
n
+
1
=
5
s
n
−
1
{\displaystyle x_{n+1}={\frac {5}{s_{n}}}-1}
y
n
+
1
=
(
x
n
+
1
−
1
)
2
+
7
{\displaystyle y_{n+1}=(x_{n+1}-1)^{2}+7\,\!}
z
n
+
1
=
(
1
2
x
n
+
1
(
y
n
+
1
+
y
n
+
1
2
−
4
x
n
+
1
3
)
)
1
/
5
{\displaystyle z_{n+1}=\left({\frac {1}{2}}x_{n+1}\left(y_{n+1}+{\sqrt {y_{n+1}^{2}-4x_{n+1}^{3}}}\right)\right)^{1/5}}
a
n
+
1
=
s
n
2
a
n
−
5
n
(
s
n
2
−
5
2
+
s
n
(
s
n
2
−
2
s
n
+
5
)
)
{\displaystyle a_{n+1}=s_{n}^{2}a_{n}-5^{n}\left({\frac {s_{n}^{2}-5}{2}}+{\sqrt {s_{n}(s_{n}^{2}-2s_{n}+5)}}\right)}
s
n
+
1
=
25
(
z
n
+
1
+
x
n
+
1
/
z
n
+
1
+
1
)
2
s
n
{\displaystyle s_{n+1}={\frac {25}{(z_{n+1}+x_{n+1}/z_{n+1}+1)^{2}s_{n}}}}
Then ak converges quintically against 1/π (that is, each iteration approximately quintuples the number of correct digits), and the following condition holds:
0
<
a
n
−
1
π
<
16
⋅
5
n
⋅
e
−
5
n
π
{\displaystyle 0<a_{n}-{\frac {1}{\pi }}<16\cdot 5^{n}\cdot e^{-5^{n}}\pi }
Nonical convergence:
Start out by setting
a
0
=
1
3
{\displaystyle a_{0}={\frac {1}{3}}}
r
0
=
3
−
1
2
{\displaystyle r_{0}={\frac {{\sqrt {3}}-1}{2}}}
s
0
=
(
1
−
r
0
3
)
1
/
3
{\displaystyle s_{0}=(1-r_{0}^{3})^{1/3}}
Then iterate
t
n
+
1
=
1
+
2
r
n
{\displaystyle t_{n+1}=1+2r_{n}\,\!}
u
n
+
1
=
(
9
r
n
(
1
+
r
n
+
r
n
2
)
)
1
/
3
{\displaystyle u_{n+1}=(9r_{n}(1+r_{n}+r_{n}^{2}))^{1/3}}
v
n
+
1
=
t
n
+
1
2
+
t
n
+
1
u
n
+
1
+
u
n
+
1
2
{\displaystyle v_{n+1}=t_{n+1}^{2}+t_{n+1}u_{n+1}+u_{n+1}^{2}}
w
n
+
1
=
27
(
1
+
s
n
+
s
n
2
)
v
n
+
1
{\displaystyle w_{n+1}={\frac {27(1+s_{n}+s_{n}^{2})}{v_{n+1}}}}
a
n
+
1
=
w
n
+
1
a
n
+
3
2
n
−
1
(
1
−
w
n
+
1
)
{\displaystyle a_{n+1}=w_{n+1}a_{n}+3^{2n-1}(1-w_{n+1})\,\!}
s
n
+
1
=
(
1
−
r
n
)
3
(
t
n
+
1
+
2
u
n
+
1
)
v
n
+
1
{\displaystyle s_{n+1}={\frac {(1-r_{n})^{3}}{(t_{n+1}+2u_{n+1})v_{n+1}}}}
r
n
+
1
=
(
1
−
s
n
+
1
3
)
1
/
3
{\displaystyle r_{n+1}=(1-s_{n+1}^{3})^{1/3}}
Then ak converges nonically against 1/π; that is, each iteration approximately multiplies the number of correct digits by nine.
Another formula for π, 1989 :
Start out by setting
A
=
212175710912
61
+
1657145277365
{\displaystyle A=212175710912{\sqrt {61}}+1657145277365}
B
=
13773980892672
61
+
107578229802750
{\displaystyle B=13773980892672{\sqrt {61}}+107578229802750}
C
=
(
5280
(
236674
+
30303
61
)
)
3
{\displaystyle C=(5280(236674+30303{\sqrt {61}}))^{3}}
Then
1
/
π
=
12
∑
n
=
0
∞
(
−
1
)
n
(
6
n
)
!
(
A
+
n
B
)
(
n
!
)
3
(
3
n
)
!
C
n
+
1
/
2
{\displaystyle 1/\pi =12\sum _{n=0}^{\infty }{\frac {(-1)^{n}(6n)!(A+nB)}{(n!)^{3}(3n)!C^{n+1/2}}}}
Each additional term of the series yields approximately 31 digits.