Bellard's formula

{{Short description|Mathematical formula}}

Bellard's formula is used to calculate the nth digit of π in base 16.

Bellard's formula was discovered by Fabrice Bellard in 1997. It is about 43% faster than the Bailey–Borwein–Plouffe formula (discovered in 1995).{{cite web|title=PiHex Credits|url=http://wayback.cecm.sfu.ca/projects/pihex/credits.html|website=Centre for Experimental and Constructive Mathematics|publisher=Simon Fraser University|accessdate=30 March 2018|archiveurl=https://web.archive.org/web/20170610094408/http://wayback.cecm.sfu.ca/projects/pihex/credits.html|archivedate=2017-06-10|url-status=live|date=March 21, 1999}}{{cite journal | last=Barsky | first=Daniel | last2=Muñoz | first2=Vicente | last3=Pérez-Marco | first3=Ricardo | title=On the genesis of BBP formulas | journal=Acta Arithmetica | volume=198 | issue=4 | date=2021 | issn=0065-1036 | doi=10.4064/aa200619-28-9 | pages=401–426 | arxiv = 1906.09629}} It has been used in PiHex, the now-completed distributed computing project.

One important application is verifying computations of all digits of pi performed by other means. Rather than having to compute all of the digits twice by two separate algorithms to ensure that a computation is correct, the final digits of a very long all-digits computation can be verified by the much faster Bellard's formula.{{cite web |title=Hexadecimal Digits are Correct! |date=31 October 2016 |url=http://pi2e.ch/blog/2016/10/31/hexadecimal-digits-are-correct/ |first=Peter |last=Trueb |access-date=2016-12-28 |archiveurl=https://web.archive.org/web/20161116164638/http://pi2e.ch/blog/2016/10/31/hexadecimal-digits-are-correct/ |archivedate=2016-11-16 |url-status=live}}

Formula:

:

\begin{align}

\pi = \frac1{2^6} \sum_{n=0}^\infty \frac{(-1)^n}{2^{10n}} \, \left(-\frac{2^5}{4n+1} \right. & {} - \frac1{4n+3} + \frac{2^8}{10n+1} - \frac{2^6}{10n+3} \left. {} - \frac{2^2}{10n+5} - \frac{2^2}{10n+7} + \frac1{10n+9} \right)

\end{align}

Notes