1 Approximation methods

1.1 The formula by Ramanujan

  • The approximation formula \[\begin{align*} \frac{1}{\pi}=\frac{2\sqrt{2}}{9801}\sum_{n=0}^\infty\frac{(4n)!(1103+26390n)}{(n!)^4396^{4k}} \end{align*}\]

1.2 The formula by David & Gregory Chudnovsky

  • The approximation formula

\[\begin{align*} \frac{1}{\pi}=12\sum_{n=0}^\infty\frac{(-1)^n(6n)!}{(3n)!(n!)^3} \frac{13591409+545140134n}{640320^{3n+3/2}} \end{align*}\]

  • Formula for easy computation

\[\begin{align*} \pi=\frac{426880\sqrt{10005}}{\sum_{n=0}^\infty\frac{(6n)!(13591409+545140134n)}{(3n)!(n!)^3(-640320)^{3n}}} \end{align*}\]

2 R pacakge

  • There is an R package to approximate \(\pi\) with very high precision
    • It takes only 0.04 seconds to approximate pi with 1,000,000,000 digits.
    • A web-based calculator can be find on PIapprox
  • This package is developed according to GMP and above formulas