A new formula to compute the n'th binary digit of pi

Fabrice Bellard

January 20, 1997

We describe here a mean to find formulas similar to those in [1]. We show in particular that

$\displaystyle \pi$ $\textstyle =$ $\displaystyle \frac{1}{2^6} \sum_{n=0}^{\infty}{ \frac{{(-1)}^n}{2^{10n}}
( -\frac{2^5}{4n+1} - \frac{1}{4n+3} + \frac{2^8}{10n+1} - }$  
    $\displaystyle { \frac{2^6}{10n+3} -
\frac{2^2}{10n+5} - \frac{2^2}{10n+7} + \frac{1}{10n+9} ) } \quad \mbox{ . }$ (1)

This formula is very interesting because, with the algorithm described in [1], it enables us to compute the $n$th binary digit of $\pi$ 43% faster than the previous known formula [1]:

$\displaystyle \pi =
\sum_{n=0}^{\infty}{ \frac{1}{{16}^n}
( \frac{4}{8n+1} - \frac{2}{8n+4} - \frac{1}{8n+5} - \frac{1}{8n+6} ) }$     (2)

The method to get formulas such as (1) is in fact very simple. We use that

\begin{displaymath}
-ln(1-x)=\sum_{n=1}^{\infty}{\frac{x^n}{n}} \quad \mbox{ for } \vert x\vert<1
\end{displaymath}

and

\begin{displaymath}
atan(y)=Im[-ln(1-i.y)]
\end{displaymath}

for $y$ real.

In particular

$\displaystyle atan(\frac{1}{a-1})$ $\textstyle =$ $\displaystyle Im[ -ln(1-\frac{(1+i)}{a}) ]$ (3)
  $\textstyle =$ $\displaystyle \sum_{n=0}^{\infty}{
\frac{(-1)^n 2^{2n}}{a^{4n+3}} ( \frac{a^2}{4n+1} + \frac{2a}{4n+2} +
\frac{2}{4n+3} )}$  

and
$\displaystyle atan(\frac{1}{a+1})$ $\textstyle =$ $\displaystyle Im[ -ln(1-\frac{(i-1)}{a}) ]$ (4)
  $\textstyle =$ $\displaystyle \sum_{n=0}^{\infty}{
\frac{(-1)^n 2^{2n}}{a^{4n+3}} ( \frac{a^2}{4n+1} - \frac{2a}{4n+2} +
\frac{2}{4n+3} )} \quad \mbox{.}$  

With $a \leftarrow 2$ in (3) we get

$\displaystyle \pi =
\sum_{n=0}^{\infty}{ \frac{{(-1)}^n}{{4}^n}
( \frac{2}{4n+1} + \frac{2}{4n+2} + \frac{1}{4n+3} ) }$     (5)

which is mentionned in [1].

Some classical arctangent relations give interesting results:

$\displaystyle \frac{\pi}{4}$ $\textstyle =$ $\displaystyle 2atan(\frac{1}{2}) - atan(\frac{1}{7})$ (6)
$\displaystyle \frac{\pi}{4}$ $\textstyle =$ $\displaystyle 2atan(\frac{1}{3}) + atan(\frac{1}{7})$ (7)
$\displaystyle \frac{\pi}{4}$ $\textstyle =$ $\displaystyle 2atan(\frac{1}{2}) - atan(\frac{1}{9})
- atan(\frac{1}{32})$ (8)
$\displaystyle \frac{\pi}{4}$ $\textstyle =$ $\displaystyle atan(\frac{1}{2}) + atan(\frac{1}{3}) \quad \mbox{.}$ (9)

In particular, we obtain from (6) and (3)

$\displaystyle \pi =
4 \sum_{n=0}^{\infty}{ \frac{{(-1)}^n}{(2n+1) {4}^n}} -
\fr...
...24}^n}
( \frac{32}{4n+1} + \frac{8}{4n+2} + \frac{1}{4n+3} } ) \quad \mbox{ , }$      

which gives (1) by reordering the terms.

The existence of a formula faster than (1) to calculate the $n$th binary digit of $\pi$ remains an open question.

Bibliography

1
David H. Bailey, Peter B. Borwein and Simon Plouffe, On the Rapid Computation of Various Polylogarithmic Constants, to appear in April 1997 in Mathematics of Computation.



Thu Feb 15 23:31:20 CET 2007
Fabrice Bellard (https://bellard.org)