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}
Cubic 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.
Quartic 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 π.
Quintic 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 }
Nonic 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.
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.
Jonathan Borwein and Peter Borwein (1993)
Start out by setting
A
=
63365028312971999585426220
{\displaystyle \,A=63365028312971999585426220}
+
28337702140800842046825600
5
{\displaystyle +28337702140800842046825600{\sqrt {5}}}
+
384
5
(
10891728551171178200467436212395209160385656017
{\displaystyle +384{\sqrt {5}}(10891728551171178200467436212395209160385656017}
+
4870929086578810225077338534541688721351255040
5
)
1
/
2
{\displaystyle +4870929086578810225077338534541688721351255040{\sqrt {5}})^{1/2}}
B
=
7849910453496627210289749000
{\displaystyle \,B=7849910453496627210289749000}
+
3510586678260932028965606400
5
{\displaystyle +3510586678260932028965606400{\sqrt {5}}}
+
2515968
3110
(
6260208323789001636993322654444020882161
{\displaystyle +2515968{\sqrt {3110}}(6260208323789001636993322654444020882161}
+
2799650273060444296577206890718825190235
5
)
1
/
2
{\displaystyle +2799650273060444296577206890718825190235{\sqrt {5}})^{1/2}}
C
=
−
214772995063512240
{\displaystyle \,C=-214772995063512240}
−
96049403338648032
5
{\displaystyle -96049403338648032{\sqrt {5}}}
−
1296
5
(
10985234579463550323713318473
{\displaystyle -1296{\sqrt {5}}(10985234579463550323713318473}
+
4912746253692362754607395912
5
)
1
/
2
{\displaystyle +4912746253692362754607395912{\sqrt {5}})^{1/2}}
Then
−
C
3
π
=
∑
n
=
0
∞
(
6
n
)
!
(
3
n
)
!
(
n
!
)
3
A
+
n
B
C
3
n
{\displaystyle {\frac {\sqrt {-C^{3}}}{\pi }}=\sum _{n=0}^{\infty }{{\frac {(6n)!}{(3n)!(n!)^{3}}}{\frac {A+nB}{C^{3n}}}}}
Each additional term of the series yields approximately 50 digits.