# Pi (AGM method) Calculator

## Calculates circular constant Pi using the Arithmetic-geometric mean method (AGM).

 $\pi={\large\frac{2\hspace{1}{\rm AGM}^2\left(1,{\large\frac{1}{\sqrt{2}}}\right)}{1-{\large\sum_{\small k=0}^{\small \infty}}2^kc_k^2}}\\\vspace{20}\\$ method 2nd convergence (Salamin–Brent) 4th convergence (Borwein) 9th convergence 6digit10digit14digit18digit22digit26digit30digit34digit38digit42digit46digit50digit
 The calculation ends when two consecutive results are the same.The accuracy of π improves by increasing the number of digits for calculation.In 1976, Salamin and Brent discovered the new algorithm for calculating Pi based on the Gauss’s AGM formula (1809). The algorithm is quadratically convergent and each step of the algorithm doubles the number of correct digits. $\normal Gauss-Legendre\ method\ 1809\\\hspace{80}\pi={\large\frac{2\hspace{1}{\rm AGM}^2\left(1,{\large\frac{1}{\sqrt{2}}}\right)}{1-{\large\sum_{\small k=0}^{\small \infty}}2^kc_k^2}}\\\vspace{20}\\The\ Square\ {\rm AGM}\\\hspace{80} by\ \ Salamin\ &\ Brent,\ 1976\\(1)\ a_0=1,\hspace{20}b_0={\large\frac{1}{\sqrt{2}}},\hspace{20}t_0={\large\frac{1}{4}}\\(2)\ a_{n+1}={\large\frac{1}{2}}(a_n+b_n),\hspace{20}b_{n+1}=\sqrt{a_nb_n},\\\hspace{50}t_{n+1}=t_n-2^n(a_n-a_{n+1})^2\\(3)\ \pi=\lim_{n\to\infty}{\large\frac{(a_n+b_n)^2}{4t_n}}\\\vspace{20}\normal The\ Quartic\ {\rm AGM}\ by\ J.M.\ Borwein\\\hspace{120} &\ P.B.\ Borwein,\ 1985\\(1)\ y_0=\sqrt{2}-1,\hspace{20}a_0=6-4\sqrt{2}\\(2)\ y_{n}={\large\frac{1-\sqrt[4]{1-y_{n-1}^4}}{1+\sqrt[4]{1-y_{n-1}^4}}},\\\hspace{10}a_{n}=(1+y_{n})^4a_{n-1}-2^{2n+1}y_{n}(1+y_{n}+y_{n}^2)\\(3)\ \pi={\large\lim_{\small n \to\infty}\frac{1}{a_n}}\\$

Pi (AGM method)
 [1-2] /2 Disp-Num5103050100200
[1]  2017/09/13 07:17   Male / 50 years old level / An engineer / Very /
Purpose of use
I was curious about is there some algorithm, beyond those I have already knew, for example the 9th order one, but it was not explained, unfortunately ...
Comment/Request
Nicely explained, the 9th order algorithm just mentioned ....
from Keisan
[2]  2015/04/23 08:28   Male / 60 years old level or over / An engineer / A little /
Purpose of use
cross check some FORTRAN and c programs
attempt to improve a partial differential equation solution

Sending completion

To improve this 'Pi (AGM method) Calculator', please fill in questionnaire.
Male or Female ?
Age

Occupation

Useful?

Purpose of use?