keisan生活や実務に役立つ高精度計算サイト

円周率計算(算術幾何平均)

円周率π を算術幾何平均(AGM公式)で計算します。

     \pi={\large\frac{2\hspace{1px}{\rm AGM}^2\left(1,{\large\frac{1}{\sqrt{2}}}\right)}{1-{\large\displaystyle \sum_{\small k=0}^{\small \infty}}2^kc_k^2}}\\\\
計算公式
前回と今回の値が等しくなると終了します。演算桁数を大きくするとπの精度も向上します。

1976年にサラミンとブレントは、ガウス公式(1809)を使うと円周率が極めて高速に二次収束することを発見しました。
この収束は、ループ回数が増す毎に精度桁数が5桁、10桁、20桁と倍々に増えていきます。

\(\normalsize Gauss-Legendre\ method\ 1809\\ \hspace{80px}\pi={\large\frac{2\hspace{1px}{\rm AGM}^2\left(1,{\large\frac{1}{\sqrt{2}}}\right)}{1-{\large\displaystyle \sum_{\small k=0}^{\small \infty}}2^kc_k^2}}\\\\ The\ Square\ {\rm AGM}\\ \hspace{80px} by\ \ Salamin\ \&\ Brent,\ 1976\\ (1)\ a_0=1,\hspace{20px}b_0={\large\frac{1}{\sqrt{2}}},\hspace{20px}t_0={\large\frac{1}{4}}\\ (2)\ a_{n+1}={\large\frac{1}{2}}(a_n+b_n),\hspace{20px}b_{n+1}=\sqrt{a_nb_n},\\ \hspace{50px}t_{n+1}=t_n-2^n(a_n-a_{n+1})^2\\ (3)\ \pi=\displaystyle \lim_{n\to\infty}{\large\frac{(a_n+b_n)^2}{4t_n}}\\ \normalsize The\ Quartic\ {\rm AGM}\ by\ J.M.\ Borwein\\ \hspace{120px} \&\ P.B.\ Borwein,\ 1985\\ (1)\ y_0=\sqrt{2}-1,\hspace{20px}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{10px}a_{n}=(1+y_{n})^4a_{n-1}-2^{2n+1}y_{n}(1+y_{n}+y_{n}^2)\\ (3)\ \pi={\large\displaystyle \lim_{\small n \to\infty}\frac{1}{a_n}}\\ \)

この計算についてお客様の声はまだありません。