Method for calculating the value of pi
Borwein's algorithm was devised by Jonathan and Peter Borwein to calculate the value of
. This and other algorithms can be found in the book Pi and the AGM – A Study in Analytic Number Theory and Computational Complexity.[1]
Ramanujan–Sato series
These two are examples of a Ramanujan–Sato series. The related Chudnovsky algorithm uses a discriminant with class number 1.
Class number 2 (1989)
Start by setting[2]
![{\displaystyle {\begin{aligned}A&=212175710912{\sqrt {61}}+1657145277365\\B&=13773980892672{\sqrt {61}}+107578229802750\\C&=\left(5280\left(236674+30303{\sqrt {61}}\right)\right)^{3}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c40aed09a4ff4f0447b507ab7a8e349ee0e58bc9)
Then
![{\displaystyle {\frac {1}{\pi }}=12\sum _{n=0}^{\infty }{\frac {(-1)^{n}(6n)!\,(A+nB)}{(n!)^{3}(3n)!\,C^{n+{\frac {1}{2}}}}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fde3c1bb4ed791d2f58ce76e172bcc76419d40a1)
Each additional term of the partial sum yields approximately 25 digits.
Class number 4 (1993)
Start by setting[3]
![{\displaystyle {\begin{aligned}A={}&63365028312971999585426220\\&{}+28337702140800842046825600{\sqrt {5}}\\&{}+384{\sqrt {5}}{\big (}10891728551171178200467436212395209160385656017\\&{}+\left.4870929086578810225077338534541688721351255040{\sqrt {5}}\right)^{\frac {1}{2}}\\B={}&7849910453496627210289749000\\&{}+3510586678260932028965606400{\sqrt {5}}\\&{}+2515968{\sqrt {3110}}{\big (}6260208323789001636993322654444020882161\\&{}+\left.2799650273060444296577206890718825190235{\sqrt {5}}\right)^{\frac {1}{2}}\\C={}&-214772995063512240\\&{}-96049403338648032{\sqrt {5}}\\&{}-1296{\sqrt {5}}{\big (}10985234579463550323713318473\\&{}+\left.4912746253692362754607395912{\sqrt {5}}\right)^{\frac {1}{2}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ecee66428109d3a06e2b8ba1d0b5c38e9c933fba)
Then
![{\displaystyle {\frac {\sqrt {-C^{3}}}{\pi }}=\sum _{n=0}^{\infty }{{\frac {(6n)!}{(3n)!(n!)^{3}}}{\frac {A+nB}{C^{3n}}}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/911b6e6937a2cfde12aa8d2162d3fb277a9e590b)
Each additional term of the series yields approximately 50 digits.
Iterative algorithms
Quadratic convergence (1984)
Start by setting[4]
![{\displaystyle {\begin{aligned}a_{0}&={\sqrt {2}}\\b_{0}&=0\\p_{0}&=2+{\sqrt {2}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b25362c46167890c8d7d14cedb717acdd34d274f)
Then iterate
![{\displaystyle {\begin{aligned}a_{n+1}&={\frac {{\sqrt {a_{n}}}+{\frac {1}{\sqrt {a_{n}}}}}{2}}\\b_{n+1}&={\frac {(1+b_{n}){\sqrt {a_{n}}}}{a_{n}+b_{n}}}\\p_{n+1}&={\frac {(1+a_{n+1})\,p_{n}b_{n+1}}{1+b_{n+1}}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/51b4f65a9b40cee1e9a95f23be32296b762a6cd4)
Then pk converges quadratically to π; that is, each iteration approximately doubles the number of correct digits. The algorithm is not self-correcting; each iteration must be performed with the desired number of correct digits for π's final result.
Cubic convergence (1991)
Start by setting
![{\displaystyle {\begin{aligned}a_{0}&={\frac {1}{3}}\\s_{0}&={\frac {{\sqrt {3}}-1}{2}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8de13415f1733099f0d3c264a469f6604208158a)
Then iterate
![{\displaystyle {\begin{aligned}r_{k+1}&={\frac {3}{1+2\left(1-s_{k}^{3}\right)^{\frac {1}{3}}}}\\s_{k+1}&={\frac {r_{k+1}-1}{2}}\\a_{k+1}&=r_{k+1}^{2}a_{k}-3^{k}\left(r_{k+1}^{2}-1\right)\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/09ab29bf56e6f198a7ea20872e3cdd405a945b99)
Then ak converges cubically to 1/π; that is, each iteration approximately triples the number of correct digits.
Quartic convergence (1985)
Start by setting[5]
![{\displaystyle {\begin{aligned}a_{0}&=2\left({\sqrt {2}}-1\right)^{2}\\y_{0}&={\sqrt {2}}-1\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f12823223f84b30c82204f1a8a3f429879f5f20d)
Then iterate
![{\displaystyle {\begin{aligned}y_{k+1}&={\frac {1-\left(1-y_{k}^{4}\right)^{\frac {1}{4}}}{1+\left(1-y_{k}^{4}\right)^{\frac {1}{4}}}}\\a_{k+1}&=a_{k}\left(1+y_{k+1}\right)^{4}-2^{2k+3}y_{k+1}\left(1+y_{k+1}+y_{k+1}^{2}\right)\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/64994ddadcf7ab8feb8bc7e8a5c56f555c86beb4)
Then ak converges quartically against 1/π; 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 for π's final result.
One iteration of this algorithm is equivalent to two iterations of the Gauss–Legendre algorithm. A proof of these algorithms can be found here:[6]
Quintic convergence
Start by setting
![{\displaystyle {\begin{aligned}a_{0}&={\frac {1}{2}}\\s_{0}&=5\left({\sqrt {5}}-2\right)={\frac {5}{\phi ^{3}}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a35914a0a638119b22f725575fe808914e0e43b3)
where
is the golden ratio. Then iterate
![{\displaystyle {\begin{aligned}x_{n+1}&={\frac {5}{s_{n}}}-1\\y_{n+1}&=\left(x_{n+1}-1\right)^{2}+7\\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)^{\frac {1}{5}}\\a_{n+1}&=s_{n}^{2}a_{n}-5^{n}\left({\frac {s_{n}^{2}-5}{2}}+{\sqrt {s_{n}\left(s_{n}^{2}-2s_{n}+5\right)}}\right)\\s_{n+1}&={\frac {25}{\left(z_{n+1}+{\frac {x_{n+1}}{z_{n+1}}}+1\right)^{2}s_{n}}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d24083e88828ce9a0ac9d1d18a27e6b42f76c61c)
Then ak converges quintically to 1/π (that is, each iteration approximately quintuples the number of correct digits), and the following condition holds:
![{\displaystyle 0<a_{n}-{\frac {1}{\pi }}<16\cdot 5^{n}\cdot e^{-5^{n}}\pi \,\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/bb443c865b92d197db62a06ef432211b81445ce8)
Nonic convergence
Start by setting
![{\displaystyle {\begin{aligned}a_{0}&={\frac {1}{3}}\\r_{0}&={\frac {{\sqrt {3}}-1}{2}}\\s_{0}&=\left(1-r_{0}^{3}\right)^{\frac {1}{3}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/79f40d3d38f39024f274bde9ffb49e87f0dcbe45)
Then iterate
![{\displaystyle {\begin{aligned}t_{n+1}&=1+2r_{n}\\u_{n+1}&=\left(9r_{n}\left(1+r_{n}+r_{n}^{2}\right)\right)^{\frac {1}{3}}\\v_{n+1}&=t_{n+1}^{2}+t_{n+1}u_{n+1}+u_{n+1}^{2}\\w_{n+1}&={\frac {27\left(1+s_{n}+s_{n}^{2}\right)}{v_{n+1}}}\\a_{n+1}&=w_{n+1}a_{n}+3^{2n-1}\left(1-w_{n+1}\right)\\s_{n+1}&={\frac {\left(1-r_{n}\right)^{3}}{\left(t_{n+1}+2u_{n+1}\right)v_{n+1}}}\\r_{n+1}&=\left(1-s_{n+1}^{3}\right)^{\frac {1}{3}}\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3ed4c7b7f5cb8d6d5ba1116ad1c5833fd89918bf)
Then ak converges nonically to 1/π; that is, each iteration approximately multiplies the number of correct digits by nine.[7]
See also
Mathematics portal
References
- ^ Jonathan M. Borwein, Peter B. Borwein, Pi and the AGM – A Study in Analytic Number Theory and Computational Complexity, Wiley, New York, 1987. Many of their results are available in: Jorg Arndt, Christoph Haenel, Pi Unleashed, Springer, Berlin, 2001, ISBN 3-540-66572-2
- ^ Bailey, David H (2023-04-01). "Peter Borwein: A Visionary Mathematician". Notices of the American Mathematical Society. 70 (04): 610–613. doi:10.1090/noti2675. ISSN 0002-9920.
- ^ Borwein, J.M.; Borwein, P.B. (1993). "Class number three Ramanujan type series for 1/π". Journal of Computational and Applied Mathematics. 46 (1–2): 281–290. doi:10.1016/0377-0427(93)90302-R.
- ^ Arndt, Jörg; Haenel, Christoph (1998). π Unleashed. Springer-Verlag. p. 236. ISBN 3-540-66572-2.
- ^ Mak, Ronald (2003). The Java Programmers Guide to Numerical Computation. Pearson Educational. p. 353. ISBN 0-13-046041-9.
- ^ Milla, Lorenz (2019), Easy Proof of Three Recursive π-Algorithms, arXiv:1907.04110
- ^ Henrik Vestermark (4 November 2016). "Practical implementation of π Algorithms" (PDF). Retrieved 29 November 2020.
External links
- Pi Formulas from Wolfram MathWorld