Approximations of π

{{Short description|Varying methods used to calculate pi}}

{{hatnote|This page is about the history of approximations of {{pi}}; see also chronology of computation of {{pi}} for a tabular summary. See also the history of {{pi}} for other aspects of the evolution of our knowledge about mathematical properties of {{pi}}.}}

{{Use dmy dates|date=March 2023}}

{{DISPLAYTITLE:Approximations of {{pi}}}}

File:PiComputationHistory.svg

{{Pi box}}

Approximations for the mathematical constant pi ({{pi}}) in the history of mathematics reached an accuracy within 0.04% of the true value before the beginning of the Common Era. In Chinese mathematics, this was improved to approximations correct to what corresponds to about seven decimal digits by the 5th century.

Further progress was not made until the 14th century, when Madhava of Sangamagrama developed approximations correct to eleven and then thirteen digits. Jamshīd al-Kāshī achieved sixteen digits next. Early modern mathematicians reached an accuracy of 35 digits by the beginning of the 17th century (Ludolph van Ceulen), and 126 digits by the 19th century (Jurij Vega).

The record of manual approximation of {{pi}} is held by William Shanks, who calculated 527 decimals correctly in 1853. Since the middle of the 20th century, the approximation of {{pi}} has been the task of electronic digital computers (for a comprehensive account, see Chronology of computation of {{pi}}). On June 28, 2024, the current record was established by the StorageReview Lab team with Alexander Yee's y-cruncher with 202 trillion (2.02×{{Val|e=14}}) digits.{{Cite web |first=Jordan |last=Ranous |date=2024-06-28 |title=StorageReview Lab Breaks Pi Calculation World Record with Over 202 Trillion Digits |url=https://www.storagereview.com/news/storagereview-lab-breaks-pi-calculation-world-record-with-over-202-trillion-digits |website=www.storagereview.com |access-date=2024-07-02}}

Early history

The best known approximations to {{pi}} dating to before the Common Era were accurate to two decimal places; this was improved upon in Chinese mathematics in particular by the mid-first millennium, to an accuracy of seven decimal places. After this, no further progress was made until the late medieval period.

Some Egyptologists{{cite book

|author-last= Petrie |author-first= W.M.F. |title= Wisdom of the Egyptians |year=1940}}

have claimed that the ancient Egyptians used an approximation of {{pi}} as {{frac|22|7}} = 3.142857 (about 0.04% too high) from as early as the Old Kingdom (c. 2700–2200 BC).{{cite book

|author-first= Miroslav |author-last= Verner |author-link=Miroslav Verner

|title= The Pyramids: The Mystery, Culture, and Science of Egypt's Great Monuments

|year= 2001 |orig-year= 1997 |publisher= Grove Press |isbn= 978-0-8021-3935-1

|quote= Based on the Great Pyramid of Giza, supposedly built so that the circle whose radius is equal to the height of the pyramid has a circumference equal to the perimeter of the base (it is 1760 cubits around and 280 cubits in height).}}

This claim has been met with skepticism.{{cite book

|author-last= Rossi

|title= Corinna Architecture and Mathematics in Ancient Egypt

|year= 2007 |publisher= Cambridge University Press |isbn= 978-0-521-69053-9

}}{{cite book |author-first= J. A. R. |author-last= Legon |title= On Pyramid Dimensions and Proportions |series= Discussions in Egyptology |volume= 20 |pages= 25–34 |year= 1991 |url= http://www.legon.demon.co.uk/pyrprop/propde.htm |access-date= 7 June 2011 |archive-date= 18 July 2011 |archive-url= https://web.archive.org/web/20110718144356/http://www.legon.demon.co.uk/pyrprop/propde.htm |url-status= dead }}

Babylonian mathematics usually approximated {{pi}} to 3, sufficient for the architectural projects of the time (notably also reflected in the description of Solomon's Temple in the Hebrew Bible).See #Imputed biblical value. {{harvnb|Beckmann|1971}} "There has been concern over the apparent biblical statement of {{pi}} ≈ 3 from the early times of rabbinical Judaism, addressed by Rabbi Nehemiah in the 2nd century."{{page needed|date=April 2015}} The Babylonians were aware that this was an approximation, and one Old Babylonian mathematical tablet excavated near Susa in 1936 (dated to between the 19th and 17th centuries BCE) gives a better approximation of {{pi}} as {{frac|25|8}} = 3.125, about 0.528% below the exact value.{{cite book

|author-first= David Gilman |author-last= Romano |author-link= David Gilman Romano

|title= Athletics and Mathematics in Archaic Corinth: The Origins of the Greek Stadion

|page= 78

|year= 1993 |publisher= American Philosophical Society |isbn=978-0871692061

|url= https://books.google.com/books?id=q0gyy5JOZzIC&pg=PA78

|quote= A group of mathematical clay tablets from the Old Babylonian Period, excavated at Susa in 1936, and published by E.M. Bruins in 1950, provide the information that the Babylonian approximation of {{pi}} was 3 1/8 or 3.125. }}{{cite web

|author-first= E. M. |author-last= Bruins

|title= Quelques textes mathématiques de la Mission de Suse

|year= 1950 |url= http://www.dwc.knaw.nl/DL/publications/PU00018846.pdf }}{{cite book

|author-first= E. M. |author-last= Bruins

|author2-first= M. |author2-last= Rutten

|title= Textes mathématiques de Suse

|series= Mémoires de la Mission archéologique en Iran |volume= XXXIV

|year= 1961

}}See also {{harvnb|Beckmann|1971|pages=12, 21–22}} "in 1936, a tablet was excavated some 200 miles from Babylon. ... The mentioned tablet, whose translation was partially published only in 1950, ... states that the ratio of the perimeter of a regular hexagon to the circumference of the circumscribed circle equals a number which in modern notation is given by 57/60+36/(60)2 [i.e. {{pi}} = 3/0.96 = 25/8]".

At about the same time, the Egyptian Rhind Mathematical Papyrus (dated to the Second Intermediate Period, c. 1600 BCE, although stated to be a copy of an older, Middle Kingdom text) implies an approximation of {{pi}} as {{frac|256|81}} ≈ 3.16 (accurate to 0.6 percent) by calculating the area of a circle via approximation with the octagon.{{cite book

|editor-last= Katz |editor-first=Victor J.

|author-last= Imhausen |author-first= Annette |author-link= Annette Imhausen

|title= The Mathematics of Egypt, Mesopotamia, China, India, and Islam: A Sourcebook

|publisher= Princeton University Press |year= 2007 |isbn= 978-0-691-11485-9}}

Astronomical calculations in the Shatapatha Brahmana (c. 6th century BCE) use a fractional approximation of {{math|{{frac|339|108}} ≈ 3.139}}.Chaitanya, Krishna. [https://books.google.com/books?id=hDc8AAAAMAAJ&q=pi A profile of Indian culture.] Indian Book Company (1975). p. 133.

The Mahabharata (500 BCE – 300 CE) offers an approximation of 3, in the ratios offered in Bhishma Parva verses: 6.12.40–45.{{Cite journal|last=Jadhav|first=Dipak|date=2018-01-01|title=On The Value Implied in the Data Referred To in the Mahābhārata for π|url=https://www.academia.edu/37922665|journal=Vidyottama Sanatana: International Journal of Hindu Science and Religious Studies|volume=2|issue=1|pages=18|doi=10.25078/ijhsrs.v2i1.511|s2cid=146074061|issn=2550-0651|doi-access=free}}

{{Blockquote

|text= ...

The Moon is handed down by memory to be eleven thousand yojanas in diameter. Its peripheral circle happens to be thirty three thousand yojanas when calculated.

...

The Sun is eight thousand yojanas and another two thousand

yojanas in diameter. From that its peripheral circle comes to be equal to thirty thousand yojanas.

...

|title="verses: 6.12.40–45

|source=Bhishma Parva of the Mahabharata"

}}

In the 3rd century BCE, Archimedes proved the sharp inequalities {{frac|223|71}} < {{pi}} < {{frac|22|7}}, by means of regular 96-gons (accuracies of 2·10−4 and 4·10−4, respectively).{{cite arXiv

|last1= Damini | first1= D.B.

|last2= Abhishek | first2= Dhar

|date= 2020

|title= How Archimedes showed that π is approximately equal to 22/7

|eprint=2008.07995 |pages= 8

| class= math.HO

}}

In the 2nd century CE, Ptolemy used the value {{frac|377|120}}, the first known approximation accurate to three decimal places (accuracy 2·10−5).{{cite web |last1=Lazarus Mudehwe |title=The story of pi |url=http://uzweb.uz.ac.zw:80/science/maths/zimaths/pi.htm |website=Zimaths |date=Feb 1997|archive-url=https://web.archive.org/web/20130108130231/http://uzweb.uz.ac.zw:80/science/maths/zimaths/pi.htm |archive-date=8 January 2013 }} It is equal to 3+8/60+30/60^2, which is accurate to two sexagesimal digits.

The Chinese mathematician Liu Hui in 263 CE computed {{pi}} to between {{val|3.141024}} and {{val|3.142708}} by inscribing a 96-gon and 192-gon; the average of these two values is {{val|3.141866}} (accuracy 9·10−5).

He also suggested that 3.14 was a good enough approximation for practical purposes. He has also frequently been credited with a later and more accurate result, π ≈ {{frac|3927|1250}} = 3.1416 (accuracy 2·10−6), although some scholars instead believe that this is due to the later (5th-century) Chinese mathematician Zu Chongzhi.{{citation

| last1 = Lam | first1 = Lay Yong

| last2 = Ang | first2 = Tian Se

| doi = 10.1016/0315-0860(86)90055-8

| issue = 4

| journal = Historia Mathematica

| mr = 875525

| pages = 325–340

| title = Circle measurements in ancient China

| volume = 13

| year = 1986

| doi-access = free

}}. Reprinted in {{cite book

|title=Pi: A Source Book

|editor1-first=J. L.|editor1-last=Berggren

|editor2-first=Jonathan M.|editor2-last=Borwein

|editor3-first=Peter|editor3-last=Borwein

|publisher=Springer

|year= 2004 |isbn= 978-0387205717 |pages= 20–35

|url=https://books.google.com/books?id=QlbzjN_5pDoC&pg=PA20}}. See in particular pp. 333–334 (pp. 28–29 of the reprint).

Zu Chongzhi is known to have computed {{pi}} to be between 3.1415926 and 3.1415927, which was correct to seven decimal places. He also gave two other approximations of {{pi}}: π ≈ {{frac|22|7}} and π ≈ {{frac|355|113}}, which are not as accurate as his decimal result. The latter fraction is the best possible rational approximation of {{pi}} using fewer than five decimal digits in the numerator and denominator. Zu Chongzhi's results surpass the accuracy reached in Hellenistic mathematics, and would remain without improvement for close to a millennium.

In Gupta-era India (6th century), mathematician Aryabhata, in his astronomical treatise Āryabhaṭīya stated:

{{Blockquote

|text=Add 4 to 100, multiply by 8 and add to 62,000. This is 'approximately' the circumference of a circle whose diameter is 20,000.

|source=Āryabhaṭīya

}}

Approximating {{pi}} to four decimal places: π ≈ {{frac|62832|20000}} = 3.1416,[http://www.livemint.com/Sundayapp/8wRiLexg1N2IOXjeK2BKcL/How-Aryabhata-got-the-earths-circumference-right-millenia-a.html How Aryabhata got the earth's circumference right] {{webarchive|url=https://web.archive.org/web/20170115063654/http://www.livemint.com/Sundayapp/8wRiLexg1N2IOXjeK2BKcL/How-Aryabhata-got-the-earths-circumference-right-millenia-a.html |date=15 January 2017 }}Āryabhaṭīya ({{IAST|gaṇitapāda 10}}):

:{{IAST|chaturadhikam śatamaṣṭaguṇam dvāśaṣṭistathā sahasrāṇām ayutadvayaviṣkambhasyāsanno vr̥ttapariṇahaḥ}}.

:"Add four to one hundred, multiply by eight and then add sixty-two thousand. The result is approximately the circumference of a circle of diameter twenty thousand. By this rule the relation of the circumference to diameter is given."

In other words, (4 + 100) × 8 + 62000 is the circumference of a circle with diameter 20000. This provides a value of π ≈ {{frac|62832|20000}} = 3.1416,

{{cite book

|title= Geometry: Seeing, Doing, Understanding |edition=Third

|last= Jacobs |first= Harold R.

|year= 2003 |publisher= W.H. Freeman and Company

|location= New York|page= 70}}{{cite web|url=http://www-history.mcs.st-and.ac.uk/Biographies/Aryabhata_I.html|title=Aryabhata the Elder|publisher=University of St Andrews, School of Mathematics and Statistics|access-date=20 July 2011}} Aryabhata stated that his result "approximately" ({{IAST|āsanna}} "approaching") gave the circumference of a circle. His 15th-century commentator Nilakantha Somayaji (Kerala school of astronomy and mathematics) has argued that the word means not only that this is an approximation, but that the value is incommensurable (irrational).{{cite book

| author = S. Balachandra Rao

| title = Indian Mathematics and Astronomy: Some Landmarks

| publisher = Jnana Deep Publications

| year = 1998

| place = Bangalore

| isbn = 978-81-7371-205-0

}}

Middle Ages

Further progress was not made for nearly a millennium, until the 14th century, when Indian mathematician and astronomer Madhava of Sangamagrama, founder of the Kerala school of astronomy and mathematics, found the Maclaurin series for arctangent, and then two infinite series for {{pi}}.{{Cite book|title=Special Functions|author1=George E. Andrews |author2=Richard Askey |first=Ranjan Roy|publisher=Cambridge University Press|year=1999|isbn=978-0-521-78988-2|page=58}}{{cite web |last1=J J O'Connor and E F Robertson |title=Madhava of Sangamagramma |url=https://mathshistory.st-andrews.ac.uk/Biographies/Madhava/ |website=MacTutor |publisher=University of St. Andrews |date=Nov 2000}}{{Cite journal|first=R. C.|last=Gupta|title=On the remainder term in the Madhava–Leibniz's series|journal=Ganita Bharati|volume=14|issue=1–4|year=1992|pages=68–71}} One of them is now known as the Madhava–Leibniz series, based on \pi=4\arctan(1):

:\pi=4\left(1-\frac 13+\frac 15-\frac 17 +\cdots\right)

The other was based on \pi=6\arctan(1/\sqrt 3):

: \pi = \sqrt{12}\sum^\infty_{k=0} \frac{(-3)^{-k}}{2k+1} = \sqrt{12}\sum^\infty_{k=0} \frac{(-\frac{1}{3})^k}{2k+1} = \sqrt{12}\left(1-{1\over 3\cdot3}+{1\over5\cdot 3^2}-{1\over7\cdot 3^3}+\cdots\right)

{{comparison_pi_infinite_series.svg|300px|two Madhava series (the one with {{radic|12}} in dark blue) and}}

He used the first 21 terms to compute an approximation of {{pi}} correct to 11 decimal places as {{val|3.14159265359}}.

He also improved the formula based on arctan(1) by including a correction:

:\pi/4\approx 1-\frac 13+\frac 15-\frac 17+ \cdots -\frac{(-1)^n}{2n-1}\pm\frac{n^2 + 1}{4n^3 + 5n}

It is not known how he came up with this correction. Using this he found an approximation of {{pi}} to 13 decimal places of accuracy when {{mvar|n}} = 75.

Indian mathematician Bhaskara II used regular polygons with up to 384 sides to obtain a close approximation of π, calculating it as 3.141666.{{Cite web |date=2025-01-01 |title=Bhāskara II {{!}} 12th Century Indian Mathematician & Astronomer {{!}} Britannica |url=https://www.britannica.com/biography/Bhaskara-II |access-date=2025-02-28 |website=www.britannica.com |language=en}}

Jamshīd al-Kāshī (Kāshānī), a Persian astronomer and mathematician, correctly computed the fractional part of 2{{pi}} to 9 sexagesimal digits in 1424,{{cite book |author1=Boris A. Rosenfeld |name-list-style=amp|author2=Adolf P. Youschkevitch |chapter=Ghiyath al-din Jamshid Masud al-Kashi (or al-Kashani) |title=Dictionary of Scientific Biography |volume=7 |date=1981 |page=256}} and translated this into 16 decimal digits{{cite web |last1=J J O'Connor and E F Robertson |title=Ghiyath al-Din Jamshid Mas'ud al-Kashi|url=https://mathshistory.st-andrews.ac.uk/Biographies/Al-Kashi/|website=MacTutor |publisher=University of St. Andrews |date=Jul 1999}} after the decimal point:

: 2\pi \approx 6.2831853071795864,

which gives 16 correct digits for π after the decimal point:

: \pi \approx 3.1415926535897932

He achieved this level of accuracy by calculating the perimeter of a regular polygon with 3 × 228 sides.{{cite journal| first1=Mohammad K. | last1=Azarian | title=al-Risāla al-muhītīyya: A Summary | journal=Missouri Journal of Mathematical Sciences | volume=22 | issue=2 | year=2010 | pages=64–85 | doi=10.35834/mjms/1312233136 | url=http://projecteuclid.org/euclid.mjms/1312233136| doi-access=free }}

16th to 19th centuries

In the second half of the 16th century, the French mathematician François Viète discovered an infinite product that converged on {{pi}} known as Viète's formula.

The German-Dutch mathematician Ludolph van Ceulen (circa 1600) computed the first 35 decimal places of {{pi}} with a 262-gon. He was so proud of this accomplishment that he had them inscribed on his tombstone.{{cite web |url=https://www.ams.org/publicoutreach/math-history/hap-6-pi.pdf |last=Capra |first=B. |title=Digits of Pi |access-date=13 January 2018 }}

In Cyclometricus (1621), Willebrord Snellius demonstrated that the perimeter of the inscribed polygon converges on the circumference twice as fast as does the perimeter of the corresponding circumscribed polygon. This was proved by Christiaan Huygens in 1654. Snellius was able to obtain seven digits of {{pi}} from a 96-sided polygon.{{cite journal |first1=Gopal |last1=Chakrabarti |first2=Richard |last2=Hudson |title=An Improvement of Archimedes Method of Approximating π |journal=International Journal of Pure and Applied Mathematics |volume=7 |issue=2 |year=2003 |pages=207–212 |url=https://ijpam.eu/contents/2003-7-2/4/4.pdf }}

In 1656, John Wallis published the Wallis product:

\frac{\pi}{2} = \prod_{n=1}^{\infty} \frac{ 4n^2 }{ 4n^2 - 1 } = \prod_{n=1}^{\infty} \left(\frac{2n}{2n-1} \cdot \frac{2n}{2n+1}\right) = \Big(\frac{2}{1} \cdot \frac{2}{3}\Big) \cdot \Big(\frac{4}{3} \cdot \frac{4}{5}\Big) \cdot \Big(\frac{6}{5} \cdot \frac{6}{7}\Big) \cdot \Big(\frac{8}{7} \cdot \frac{8}{9}\Big) \cdot \; \cdots

In 1706, John Machin used Gregory's series (the Taylor series for arctangent) and the identity \tfrac14\pi = 4\arccot 5 - \arccot 239 to calculate 100 digits of {{pi}} (see {{slink| #Machin-like formula}} below).{{cite book |last=Jones |first=William |author-link=William Jones (mathematician) |year=1706 |title=Synopsis Palmariorum Matheseos |place=London |publisher=J. Wale |url=https://archive.org/details/SynopsisPalmariorumMatheseosOrANewIntroductionToTheMathematics/page/n283/ |pages=[https://archive.org/details/SynopsisPalmariorumMatheseosOrANewIntroductionToTheMathematics/page/n261/ 243], [https://archive.org/details/SynopsisPalmariorumMatheseosOrANewIntroductionToTheMathematics/page/n283/ 263] |quote=There are various other ways of finding the Lengths, or Areas of particular Curve Lines or Planes, which may very much facilitate the Practice; as for instance, in the Circle, the Diameter is to Circumference as 1 to

\overline{\tfrac{16}5 - \tfrac4{239}}

- \tfrac13\overline{\tfrac{16}{5^3} - \tfrac4{239^3}}

+ \tfrac15\overline{\tfrac{16}{5^5} - \tfrac4{239^5}}

-,\, \&c. =
{{math|1=3.14159, &c. = π}}. This Series (among others for the same purpose, and drawn from the same Principle) I receiv'd from the Excellent Analyst, and my much Esteem'd Friend Mr. John Machin; and by means thereof, Van Ceulen{{'}}s Number, or that in Art. 64.38. may be Examin'd with all desireable Ease and Dispatch.

}}

Reprinted in {{cite book |last=Smith |first=David Eugene |year=1929 |title=A Source Book in Mathematics |publisher=McGraw–Hill |chapter=William Jones: The First Use of {{mvar|π}} for the Circle Ratio |chapter-url=https://archive.org/details/sourcebookinmath1929smit/page/346/ |pages=346–347 }}

{{cite journal |last=Tweddle |first=Ian |year=1991 |title=John Machin and Robert Simson on Inverse-tangent Series for {{mvar|π}} |journal= Archive for History of Exact Sciences |volume=42 |number=1 |pages=1–14 |doi= 10.1007/BF00384331 |jstor=41133896 |s2cid=121087222 }} In 1719, Thomas de Lagny used a similar identity to calculate 127 digits (of which 112 were correct). In 1789, the Slovene mathematician Jurij Vega improved John Machin's formula to calculate the first 140 digits, of which the first 126 were correct.{{cite journal |last=Vega |first=Géorge |year=1795 |orig-year=1789 |title=Detérmination de la demi-circonférence d'un cercle dont le diameter est {{math|{{=}} 1}}, exprimée en {{math|140}} figures decimals |journal=Nova Acta Academiae Scientiarum Petropolitanae |volume=11 |department=Supplement |pages=41–44 |url=https://archive.org/details/novaactaacademia09impe/page/n52/mode/2up}}

{{cite book |first=Edward |last=Sandifer |year=2006 |chapter=Why 140 Digits of Pi Matter |title=Jurij baron Vega in njegov čas: Zbornik ob 250-letnici rojstva |chapter-url=http://people.wcsu.edu/sandifere/History/Preprints/Talks/Jurij%20Vega/Vega%20math%20script.pdf |trans-title=Baron Jurij Vega and His Times: Celebrating 250 Years |publisher=DMFA |location=Ljubljana |isbn=978-961-6137-98-0 |lccn=2008467244 |oclc=448882242 |archive-url=https://web.archive.org/web/20060828194849/http://people.wcsu.edu/sandifere/History/Preprints/Talks/Jurij%20Vega/Vega%20math%20script.pdf |archive-date=2006-08-28 |quote=We should note that Vega's value contains an error in the 127th digit. Vega gives a 4 where there should be an {{bracket|6}}, and all digits after that are incorrect.}}

In 1841, William Rutherford calculated 208 digits, of which the first 152 were correct.

The magnitude of such precision (152 decimal places) can be put into context by the fact that the circumference of the largest known object, the observable universe, can be calculated from its diameter (93{{nbsp}}billion light-years) to a precision of less than one Planck length (at {{val|1.6162|e=-35|u=meters}}, the shortest unit of length expected to be directly measurable) using {{pi}} expressed to just 62 decimal places.{{cite web |title=What kind of accuracy could one get with Pi to 40 decimal places? |work=Stack Exchange |date=11 May 2015 |url=https://physics.stackexchange.com/q/183310 }}

The English amateur mathematician William Shanks calculated {{pi}} to 530 decimal places in January 1853, of which the first 527 were correct (the last few likely being incorrect due to round-off errors).{{cite magazine |last=Hayes |first=Brian |url=https://www.americanscientist.org/article/pencil-paper-and-pi |title=Pencil, Paper, and Pi |volume=102 |issue=5 |page=342 |magazine=American Scientist |date=September 2014 |doi=10.1511/2014.110.342}}{{Cite journal |last=Ferguson |first=D. F. |date=16 March 1946 |title=Value of π |journal=Nature |language=en |volume=157 |issue=3985 |pages=342 |doi=10.1038/157342c0 |bibcode=1946Natur.157..342F |s2cid=4085398 |issn=1476-4687|doi-access=free }} He subsequently expanded his calculation to 607 decimal places in April 1853,{{cite book |last=Shanks |first=William |url=https://archive.org/details/contributionsto00shangoog |title=Contributions to Mathematics: Comprising Chiefly the Rectification of the Circle to 607 Places of Decimals |page=viii |publisher=Macmillan Publishers |year=1853 |via=the Internet Archive}} but an error introduced right at the 530th decimal place rendered the rest of his calculation erroneous; due to the nature of Machin's formula, the error propagated back to the 528th decimal place, leaving only the first 527 digits correct once again. Twenty years later, Shanks expanded his calculation to 707 decimal places in April 1873.{{cite journal |last=Shanks |first=William |url=https://royalsocietypublishing.org/doi/pdf/10.1098/rspl.1872.0066 |title=V. On the extension of the numerical value of π |journal=Proceedings of the Royal Society of London |pages=318–319 |publisher=Royal Society Publishing |year=1873 |volume=21 |issue=139–147 |doi=10.1098/rspl.1872.0066|s2cid=120851313 }} Due to this being an expansion of his previous calculation, most of the new digits were incorrect as well. Shanks was said to have calculated new digits all morning and would then spend all afternoon checking his morning's work. This was the longest expansion of {{pi}} until the advent of the electronic digital computer three-quarters of a century later.{{cite web |url=https://mathshistory.st-andrews.ac.uk/Biographies/Shanks/ |title=William Shanks (1812–1882) – Biography |work=University of St Andrews |date=July 2007 |access-date=22 January 2022}}

20th and 21st centuries

{{main|Chronology of computation of π#The age of electronic computers (from 1949 onwards)}}

In 1910, the Indian mathematician Srinivasa Ramanujan found several rapidly converging infinite series of {{pi}}, including

: \frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum^\infty_{k=0} \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}

which computes a further eight decimal places of {{pi}} with each term in the series. His series are now the basis for the fastest algorithms currently used to calculate {{pi}}. Evaluating the first term alone yields a value correct to seven decimal places:

:\pi\approx\frac{9801}{2206\sqrt2}\approx 3.14159273

See Ramanujan–Sato series.

From the mid-20th century onwards, all improvements in calculation of {{pi}} have been done with the help of calculators or computers.

In 1944−45, D. F. Ferguson, with the aid of a mechanical desk calculator, found that William Shanks had made a mistake in the 528th decimal place, and that all succeeding digits were incorrect.Ferguson 1946a, {{doi|10.2307/3608485}}

In the early years of the computer, an expansion of {{pi}} to {{val|100000}} decimal places{{Rp|78}} was computed by Maryland mathematician Daniel Shanks (no relation to the aforementioned William Shanks) and his team at the United States Naval Research Laboratory in Washington, D.C. In 1961, Shanks and his team used two different power series for calculating the digits of {{pi}}. For one, it was known that any error would produce a value slightly high, and for the other, it was known that any error would produce a value slightly low. And hence, as long as the two series produced the same digits, there was a very high confidence that they were correct. The first 100,265 digits of {{pi}} were published in 1962.{{Cite journal|first1=D.|last1=Shanks|author1-link=Daniel Shanks|first2=J. W. Jr.|last2=Wrench|author2-link=John Wrench|title=Calculation of {{pi}} to 100,000 decimals|journal=Mathematics of Computation|volume=16|year=1962|pages=76–99|doi=10.2307/2003813|jstor=2003813|issue=77}}{{Rp|80–99}} The authors outlined what would be needed to calculate {{pi}} to 1 million decimal places and concluded that the task was beyond that day's technology, but would be possible in five to seven years.{{Rp|78}}

In 1989, the Chudnovsky brothers computed {{pi}} to over 1 billion decimal places on the supercomputer IBM 3090 using the following variation of Ramanujan's infinite series of {{pi}}:

: \frac{1}{\pi} = 12 \sum^\infty_{k=0} \frac{(-1)^k (6k)! (13591409 + 545140134k)}{(3k)!(k!)^3 640320^{3k + 3/2}}.

Records since then have all been accomplished using the Chudnovsky algorithm.

In 1999, Yasumasa Kanada and his team at the University of Tokyo computed {{pi}} to over 200 billion decimal places on the supercomputer HITACHI SR8000/MPP (128 nodes) using another variation of Ramanujan's infinite series of {{pi}}.

In November 2002, Yasumasa Kanada and a team of 9 others used the Hitachi SR8000, a 64-node supercomputer with 1 terabyte of main memory, to calculate {{pi}} to roughly 1.24 trillion digits in around 600 hours (25{{nbsp}}days).{{cite web|url=http://www.super-computing.org/pi_current.html|title=Announcement at the Kanada lab web site.|website=Super-computing.org|access-date=11 December 2017|archive-url=https://web.archive.org/web/20110312035524/http://www.super-computing.org/pi_current.html|archive-date=12 March 2011|url-status=dead}}

= Recent records =

  1. In August 2009, a Japanese supercomputer called the T2K Open Supercomputer more than doubled the previous record by calculating {{pi}} to roughly 2.6 trillion digits in approximately 73 hours and 36 minutes.
  2. In December 2009, Fabrice Bellard used a home computer to compute 2.7 trillion decimal digits of {{pi}}. Calculations were performed in base 2 (binary), then the result was converted to base 10 (decimal). The calculation, conversion, and verification steps took a total of 131 days.{{cite web|url=http://bellard.org/pi/pi2700e9/|title=Pi Computation Record}}
  3. In August 2010, Shigeru Kondo used Alexander Yee's y-cruncher to calculate 5 trillion digits of {{pi}}. This was the world record for any type of calculation, but significantly it was performed on a home computer built by Kondo.[http://www.mccormick.northwestern.edu/news/articles/article_743.html McCormick Grad Sets New Pi Record] {{webarchive |url=https://web.archive.org/web/20110928084418/http://www.mccormick.northwestern.edu/news/articles/article_743.html |date=28 September 2011 }} The calculation was done between 4 May and 3 August, with the primary and secondary verifications taking 64 and 66 hours respectively.{{cite web|url=http://www.numberworld.org/misc_runs/pi-5t/announce_en.html|title=Pi – 5 Trillion Digits}}
  4. In October 2011, Shigeru Kondo broke his own record by computing ten trillion (1013) and fifty digits using the same method but with better hardware.{{cite web|author=Glenn |url=https://www.newscientist.com/blogs/shortsharpscience/2011/10/pi-10-trillion.html |title=Short Sharp Science: Epic pi quest sets 10 trillion digit record |work=New Scientist |date=2011-10-19 |access-date=2016-04-18}}{{cite web |url=http://www.numberworld.org/misc_runs/pi-10t/details.html |title=Round 2... 10 Trillion Digits of Pi |first1=Alexander J. |last1=Yee |first2=Shigeru |last2=Kondo |date=22 October 2011}}
  5. In December 2013, Kondo broke his own record for a second time when he computed 12.1 trillion digits of {{pi}}.{{cite web |url=http://www.numberworld.org/misc_runs/pi-12t/ |title=12.1 Trillion Digits of Pi |first1=Alexander J. |last1=Yee |first2=Shigeru |last2=Kondo |date=28 December 2013}}
  6. In October 2014, Sandon Van Ness, going by the pseudonym "houkouonchi" used y-cruncher to calculate 13.3 trillion digits of {{pi}}.{{cite web|url=http://www.numberworld.org/y-cruncher/|title=y-cruncher: A Multi-Threaded Pi Program |first=Alexander J. |last=Yee |year=2018 |website=numberworld.org |access-date=14 March 2018}}
  7. In November 2016, Peter Trueb and his sponsors computed on y-cruncher and fully verified 22.4 trillion digits of {{pi}} (22,459,157,718,361 ({{pi}}{{mvar|e}} × 1012)).{{Cite arXiv |title=Digit Statistics of the First 22.4 Trillion Decimal Digits of Pi |eprint=1612.00489 |class=math.NT |date=30 November 2016 |first=Peter |last=Treub}} The computation took (with three interruptions) 105 days to complete, the limitation of further expansion being primarily storage space.
  8. {{anchor|21st century – current claimed world record|Current world record|World record|Current record|Current claimed world record}} In March 2019, Emma Haruka Iwao, an employee at Google, computed 31.4 (approximately 10{{pi}}) trillion digits of pi using y-cruncher and Google Cloud machines. This took 121 days to complete.{{Cite web|url=http://www.numberworld.org/blogs/2019_3_14_pi_record/|title=Google Cloud Topples the Pi Record|website=numberworld.org|access-date=14 March 2019}}
  9. In January 2020, Timothy Mullican announced the computation of 50 trillion digits over 303 days.{{cite web|url=http://numberworld.org/y-cruncher/news/2020.html#2020_1_29|title=The Pi Record Returns to the Personal Computer|access-date=30 January 2020}}{{cite web|url=https://blog.timothymullican.com/calculating-pi-my-attempt-breaking-pi-record|title=Calculating Pi: My attempt at breaking the Pi World Record|date=26 June 2019|access-date=30 January 2020}}
  10. On 14 August 2021, a team (DAViS) at the University of Applied Sciences of the Grisons announced completion of the computation of {{pi}} to 62.8 (approximately 20{{pi}}) trillion digits.{{cite web|url=https://www.fhgr.ch/news/newsdetail/die-fh-graubuenden-kennt-pi-am-genauesten-weltrekord|title=Die FH Graubünden kennt Pi am genauesten – Weltrekord!|access-date=31 August 2021}}{{cite web|url=https://www.theguardian.com/science/2021/aug/16/swiss-researchers-calculate-pi-to-new-record-of-628tn-figures|title=Swiss researchers calculate pi to new record of 62.8tn figures|website=The Guardian|date=16 August 2021|access-date=31 August 2021}}
  11. On 8 June 2022, Emma Haruka Iwao announced on the Google Cloud Blog the computation of 100 trillion (1014) digits of {{pi}} over 158 days using Alexander Yee's y-cruncher.{{cite web|url=https://cloud.google.com/blog/products/compute/calculating-100-trillion-digits-of-pi-on-google-cloud|title=Even more pi in the sky: Calculating 100 trillion digits of pi on Google Cloud|website=Google Cloud Platform|date=8 June 2022|access-date=10 June 2022}}
  12. On 14 March 2024, Jordan Ranous, Kevin O’Brien and Brian Beeler computed {{pi}} to 105 trillion digits, also using y-cruncher.{{Cite web |first=Alexander J. |last=Yee |date=2024-03-14 |title=Limping to a new Pi Record of 105 Trillion Digits |url=http://www.numberworld.org/y-cruncher/news/2024.html#2024_3_13 |website=NumberWorld.org |access-date=2024-03-16}}
  13. On 28 June 2024, the StorageReview Team computed {{pi}} to 202 trillion digits, also using y-cruncher.{{Cite web |first=Jordan |last=Ranous |date=2024-06-28 |title=StorageReview Lab Breaks Pi Calculation World Record with Over 202 Trillion Digits |url=https://www.storagereview.com/news/storagereview-lab-breaks-pi-calculation-world-record-with-over-202-trillion-digits |website=www.storagereview.com |access-date=2024-07-02}}

Practical approximations

Depending on the purpose of a calculation, {{pi}} can be approximated by using fractions for ease of calculation. The most notable such approximations are {{frac|22|7}} (relative error of about 4·10−4) and {{frac|355|113}} (relative error of about 8·10−8).{{cite magazine |last1=Allain |first1=Rhett |title=What is the Best Fractional Representation of Pi |url=https://www.wired.com/2011/03/what-is-the-best-fractional-representation-of-pi/ |magazine=Wired |access-date=16 March 2020 |date=18 March 2011}}{{cite web |last1=John D. |first1=Cook |title=Best Rational Approximations for Pi |url=https://www.johndcook.com/blog/2018/05/22/best-approximations-for-pi/ |website=John D. Cook Consulting |date=22 May 2018 |access-date=16 March 2020}}{{cite web |title=Continued Fraction Approximations to Pi |url=https://faculty.math.illinois.edu/~hildebr/453.spring11/pi-cf.pdf |website=Illinois Department of Mathematics |publisher=University of Illinois Board of Trustees |access-date=16 March 2020 |archive-date=23 January 2021 |archive-url=https://web.archive.org/web/20210123141737/https://faculty.math.illinois.edu/~hildebr/453.spring11/pi-cf.pdf |url-status=dead }}

In Chinese mathematics, the fractions 22/7 and 355/113 are known as Yuelü ({{zhi|c=约率|p=yuēlǜ|l=approximate ratio}}) and Milü ({{zhi|c=密率|p=mìlǜ|l=close ratio}}).

Non-mathematical "definitions" of {{pi}}

Of some notability are legal or historical texts purportedly "defining {{pi}}" to have some rational value, such as the "Indiana Pi Bill" of 1897, which stated "the ratio of the diameter and circumference is as five-fourths to four" (which would imply "{{math|1=π = 3.2}}") and a passage in the Hebrew Bible that implies that {{math|1=π = 3}}.

=Indiana bill=

{{Main|Indiana Pi Bill}}

The so-called "Indiana Pi Bill" from 1897 has often been characterized as an attempt to "legislate the value of Pi". Rather, the bill dealt with a purported solution to the problem of geometrically "squaring the circle".{{cite journal |title=Indiana's Squared Circle |first=Arthur E. |last=Hallerberg |journal=Mathematics Magazine |volume=50 |issue=3 |year=1977 |pages=136–140 |doi=10.1080/0025570X.1977.11976632 }}

The bill was nearly passed by the Indiana General Assembly in the U.S., and has been claimed to imply a number of different values for {{pi}}, although the closest it comes to explicitly asserting one is the wording "the ratio of the diameter and circumference is as five-fourths to four", which would make {{math|1=π = {{frac|16|5}} = 3.2}}, a discrepancy of nearly 2 percent. A mathematics professor who happened to be present the day the bill was brought up for consideration in the Senate, after it had passed in the House, helped to stop the passage of the bill on its second reading, after which the assembly thoroughly ridiculed it before postponing it indefinitely.

=Imputed biblical value=

{{see also|Molten Sea#Approximation of π}}

It is sometimes claimed{{By whom|date=February 2023}} that the Hebrew Bible implies that "{{pi}} equals three", based on a passage in {{bibleverse|1 Kings|7:23|NKJV|}} and {{bibleverse|2 Chronicles|4:2|NKJV|}} giving measurements for the round basin located in front of the Temple in Jerusalem as having a diameter of 10 cubits and a circumference of 30 cubits.

The issue is discussed in the Talmud and in Rabbinic literature.{{Cite journal|first1=Boaz|last1=Tsaban|first2=David|last2=Garber|date=February 1998|title=On the rabbinical approximation of {{pi}}|journal=Historia Mathematica|volume=25|issue=1|pages=75–84|issn=0315-0860|doi=10.1006/hmat.1997.2185|url=http://u.cs.biu.ac.il/~tsaban/Pdf/latexpi.pdf|access-date=14 July 2009|doi-access=free}} Among the many explanations and comments are these:

  • Rabbi Nehemiah explained this in his Mishnat ha-Middot (the earliest known Hebrew text on geometry, ca. 150 CE) by saying that the diameter was measured from the outside rim while the circumference was measured along the inner rim. This interpretation implies a brim about 0.225 cubit (or, assuming an 18-inch "cubit", some 4 inches), or one and a third "handbreadths," thick (cf. {{bibleverse|1|Kings|7:24||NRSV|}} and {{bibleverse|2|Chronicles|4:3||NRSV}}).
  • Maimonides states (ca. 1168 CE) that {{pi}} can only be known approximately, so the value 3 was given as accurate enough for religious purposes. This is taken by someWilbur Richard Knorr, The Ancient Tradition of Geometric Problems, New York: Dover Publications, 1993. as the earliest assertion that {{pi}} is irrational.

There is still some debate on this passage in biblical scholarship.{{failed verification|date=April 2015}}

{{cite web

|first=H. Peter

|last=Aleff

|url=http://www.recoveredscience.com/const303solomonpi.htm

|title=Ancient Creation Stories told by the Numbers: Solomon's Pi

|publisher=recoveredscience.com

|access-date=30 October 2007

|archive-url=https://web.archive.org/web/20071014201334/http://recoveredscience.com/const303solomonpi.htm

|archive-date=14 October 2007

|url-status=dead

}}

{{cite web

|first=J J

|last=O'Connor

|author2=E F Robertson

|url=http://www-groups.dcs.st-and.ac.uk/~history/HistTopics/Pi_through_the_ages.html

|title=A history of Pi

|date=August 2001

|access-date=30 October 2007| archive-url= https://web.archive.org/web/20071030063811/http://www-groups.dcs.st-and.ac.uk/~history/HistTopics/Pi_through_the_ages.html| archive-date= 30 October 2007 | url-status= live}} Many reconstructions of the basin show a wider brim (or flared lip) extending outward from the bowl itself by several inches to match the description given in {{bibleverse|1|Kings|7:26||NRSV}}[http://mathforum.org/library/drmath/view/52573.html Math Forum – Ask Dr. Math] In the succeeding verses, the rim is described as "a handbreadth thick; and the brim thereof was wrought like the brim of a cup, like the flower of a lily: it received and held three thousand baths" {{bibleverse|2|Chronicles|4:5||NRSV}}, which suggests a shape that can be encompassed with a string shorter than the total length of the brim, e.g., a Lilium flower or a Teacup.

Development of efficient formulae

{{Main|List of formulae involving π}}

=Polygon approximation to a circle=

Archimedes, in his Measurement of a Circle, created the first algorithm for the calculation of {{pi}} based on the idea that the perimeter of any (convex) polygon inscribed in a circle is less than the circumference of the circle, which, in turn, is less than the perimeter of any circumscribed polygon. He started with inscribed and circumscribed regular hexagons, whose perimeters are readily determined. He then shows how to calculate the perimeters of regular polygons of twice as many sides that are inscribed and circumscribed about the same circle. This is a recursive procedure which would be described today as follows: Let {{math|pk}} and {{math|Pk}} denote the perimeters of regular polygons of {{math|k}} sides that are inscribed and circumscribed about the same circle, respectively. Then,

:P_{2n} = \frac{2p_nP_n}{p_n + P_n}, \quad \quad p_{2n} = \sqrt{p_n P_{2n}}.

Archimedes uses this to successively compute {{math|P12, p12, P24, p24, P48, p48, P96}} and {{math|p96}}.{{harvnb|Eves|1992|page=131}} Using these last values he obtains

:3 \frac{10}{71} < \pi < 3 \frac{1}{7}.

It is not known why Archimedes stopped at a 96-sided polygon; it only takes patience to extend the computations. Heron reports in his Metrica (about 60 CE) that Archimedes continued the computation in a now lost book, but then attributes an incorrect value to him.{{harvnb|Beckmann|1971|page=66}}

Archimedes uses no trigonometry in this computation and the difficulty in applying the method lies in obtaining good approximations for the square roots that are involved. Trigonometry, in the form of a table of chord lengths in a circle, was probably used by Claudius Ptolemy of Alexandria to obtain the value of {{pi}} given in the Almagest (circa 150 CE).{{harvnb|Eves|1992|page=118}}

Advances in the approximation of {{pi}} (when the methods are known) were made by increasing the number of sides of the polygons used in the computation. A trigonometric improvement by Willebrord Snell (1621) obtains better bounds from a pair of bounds obtained from the polygon method. Thus, more accurate results were obtained from polygons with fewer sides.{{harvnb|Eves|1992|page=119}} Viète's formula, published by François Viète in 1593, was derived by Viète using a closely related polygonal method, but with areas rather than perimeters of polygons whose numbers of sides are powers of two.{{harvnb|Beckmann|1971|pages=94–95}}

The last major attempt to compute {{pi}} by this method was carried out by Grienberger in 1630 who calculated 39 decimal places of {{pi}} using Snell's refinement.

=Machin-like formula=

{{main|Machin-like formula}}

For fast calculations, one may use formulae such as Machin's:

: \frac{\pi}{4} = 4 \arctan\frac{1}{5} - \arctan\frac{1}{239}

together with the Taylor series expansion of the function arctan(x). This formula is most easily verified using polar coordinates of complex numbers, producing:

(5+i)^4\cdot(239-i)=2^2 \cdot 13^4(1+i).

(({{mvar|x}}),({{mvar|y}}) = {239, 132} is a solution to the Pell equation {{mvar|x}}2 − 2{{mvar|y}}2 = −1.)

Formulae of this kind are known as Machin-like formulae. Machin's particular formula was used well into the computer era for calculating record numbers of digits of {{pi}}, but more recently other similar formulae have been used as well.

For instance, Shanks and his team used the following Machin-like formula in 1961 to compute the first 100,000 digits of {{pi}}:

: \frac{\pi}{4} = 6 \arctan\frac{1}{8} + 2 \arctan\frac{1}{57} + \arctan\frac{1}{239}

and they used another Machin-like formula,

: \frac{\pi}{4} = 12 \arctan\frac{1}{18} + 8 \arctan\frac{1}{57} - 5 \arctan\frac{1}{239}

as a check.

The record as of December 2002 by Yasumasa Kanada of Tokyo University stood at 1,241,100,000,000 digits. The following Machin-like formulae were used for this:

: \frac{\pi}{4} = 12 \arctan\frac{1}{49} + 32 \arctan\frac{1}{57} - 5 \arctan\frac{1}{239} + 12 \arctan\frac{1}{110443}

K. Takano (1982).

: \frac{\pi}{4} = 44 \arctan\frac{1}{57} + 7 \arctan\frac{1}{239} - 12 \arctan\frac{1}{682} + 24 \arctan\frac{1}{12943}

F. C. M. Størmer (1896).

=Other classical formulae=

Other formulae that have been used to compute estimates of {{pi}} include:

Liu Hui (see also Viète's formula):

:

\begin{align}

\pi &\approx 768 \sqrt{2 - \sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2 + \sqrt{2+1}}}}}}}}}\\

&\approx 3.141590463236763.

\end{align}

Madhava:

:\pi = \sqrt{12}\sum^\infty_{k=0} \frac{(-3)^{-k}}{2k+1} = \sqrt{12}\sum^\infty_{k=0} \frac{(-\frac{1}{3})^k}{2k+1} = \sqrt{12}\left({1\over 1\cdot3^0}-{1\over 3\cdot3^1}+{1\over5\cdot 3^2}-{1\over7\cdot 3^3}+\cdots\right)

Newton / Euler Convergence Transformation:Unpublished work by Newton (1684), later independently discovered by others, and popularized by Euler (1755).

{{cite book |last=Roy |first=Ranjan |year=2021 |orig-year=1st ed. 2011 |title=Series and Products in the Development of Mathematics |edition=2 |volume=1 |publisher=Cambridge University Press |pages=215–216, 219–220}}

{{cite web |last=Sandifer |first=Ed |year=2009 |title=Estimating π |website=How Euler Did It |url=http://eulerarchive.maa.org/hedi/HEDI-2009-02.pdf }} Reprinted in {{cite book |last=Sandifer |first=Ed |display-authors=0 |year=2014 |title=How Euler Did Even More |pages=109–118 |publisher=Mathematical Association of America}}

{{cite book |last=Newton |first=Isaac |authorlink=Isaac Newton |year=1971 |editor-last=Whiteside |editor-first=Derek Thomas |editor-link=Tom Whiteside |title=The Mathematical Papers of Isaac Newton |volume=4, 1674–1684 |publisher=Cambridge University Press |pages=526–653 }}

{{cite book |last=Euler |first=Leonhard |authorlink=Leonhard Euler |year=1755 |title=Institutiones Calculi Differentialis |chapter=§2.30 |page=318 |publisher=Academiae Imperialis Scientiarium Petropolitanae |language=la |chapter-url=https://archive.org/details/institutiones-calculi-differentialis-cum-eius-vsu-in-analysi-finitorum-ac-doctri/page/318 |id=[https://scholarlycommons.pacific.edu/euler-works/212/ E 212]}}

{{cite journal |last=Euler |first=Leonhard |author-link=Leonhard Euler |year=1798 |orig-year=written 1779 |title=Investigatio quarundam serierum, quae ad rationem peripheriae circuli ad diametrum vero proxime definiendam maxime sunt accommodatae |journal=Nova Acta Academiae Scientiarum Petropolitinae |volume=11 |pages=133–149, 167–168 |url=https://archive.org/details/novaactaacademia11petr/page/133 |id=[https://scholarlycommons.pacific.edu/euler-works/705/ E 705] }}

{{citation |author=Hwang Chien-Lih |year=2005 |title=An elementary derivation of Euler's series for the arctangent function |journal=The Mathematical Gazette |volume=89 |issue=516 |pages=469–470 |doi=10.1017/S0025557200178404 |s2cid=123395287 }}

:\begin{align}

\arctan x

&= \frac{x}{1 + x^2} \sum_{k=0}^\infty \frac{(2k)!!\,x^{2k}}{(2k+1)!!\,(1 + x^2)^k}

= \frac{x}{1 + x^2} + \frac23\frac{x^3}{(1 + x^2)^2}

+ \frac{2\cdot 4}{3 \cdot 5}\frac{x^5}{(1 + x^2)^3} + \cdots

\\[10mu]

\frac{\pi}{2}

&= \sum_{k=0}^\infty\frac{k!}{(2k+1)!!}= \sum_{k=0}^{\infty} \cfrac {2^k k!^2}{(2k + 1)!}

= 1+\frac{1}{3}\left(1+\frac{2}{5}\left(1+\frac{3}{7}\left(1+\cdots\right)\right)\right)

\end{align}

:where {{math|m!!}} is the double factorial, the product of the positive integers up to {{math|m}} with the same parity.

Euler:

:{\pi} = 20 \arctan\frac{1}{7} + 8 \arctan\frac{3}{79}

:(Evaluated using the preceding series for {{math|arctan.}})

Ramanujan:

: \frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum^\infty_{k=0} \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}

David Chudnovsky and Gregory Chudnovsky:

: \frac{1}{\pi} = 12 \sum^\infty_{k=0} \frac{(-1)^k (6k)! (13591409 + 545140134k)}{(3k)!(k!)^3 640320^{3k + 3/2}}

Ramanujan's work is the basis for the Chudnovsky algorithm, the fastest algorithms used, as of the turn of the millennium, to calculate {{pi}}.

=Modern algorithms=

Extremely long decimal expansions of {{pi}} are typically computed with iterative formulae like the Gauss–Legendre algorithm and Borwein's algorithm. The latter, found in 1985 by Jonathan and Peter Borwein, converges extremely quickly:

For y_0=\sqrt2-1,\ a_0=6-4\sqrt2 and

:y_{k+1}=(1-f(y_k))/(1+f(y_k)) ~,~ a_{k+1} = a_k(1+y_{k+1})^4 - 2^{2k+3} y_{k+1}(1+y_{k+1}+y_{k+1}^2)

where f(y)=(1-y^4)^{1/4}, the sequence 1/a_k converges quartically to {{pi}}, giving about 100 digits in three steps and over a trillion digits after 20 steps. Even though the Chudnovsky series is only linearly convergent, the Chudnovsky algorithm might be faster than the iterative algorithms in practice; that depends on technological factors such as memory sizes and access times.{{Cite book |arxiv = 1802.07558|last1 = Trueb|first1 = Peter|title = The Borwein brothers, Pi and the AGM|series = Springer Proceedings in Mathematics & Statistics|year = 2020|volume = 313|doi = 10.1007/978-3-030-36568-4|isbn = 978-3-030-36567-7|s2cid = 214742997}} For breaking world records, the iterative algorithms are used less commonly than the Chudnovsky algorithm since they are memory-intensive.

The first one million digits of {{pi}} and {{frac|1|{{pi}}}} are available from Project Gutenberg.{{Cite book| first1=Scott|last1=Hemphill|title=Pi|year = 1993|url=https://www.gutenberg.org/ebooks/50}}{{Cite book| first1=Yasumasa|last1=Kanada|title=One Divided by Pi|year = 1996|url=https://www.gutenberg.org/ebooks/745}} A former calculation record (December 2002) by Yasumasa Kanada of Tokyo University stood at 1.24 trillion digits, which were computed in September 2002 on a 64-node Hitachi supercomputer with 1 terabyte of main memory, which carries out 2 trillion operations per second, nearly twice as many as the computer used for the previous record (206 billion digits). The following Machin-like formulae were used for this:

: \frac{\pi}{4} = 12 \arctan\frac{1}{49} + 32 \arctan\frac{1}{57} - 5 \arctan\frac{1}{239} + 12 \arctan\frac{1}{110443} (Kikuo Takano (1982))

: \frac{\pi}{4} = 44 \arctan\frac{1}{57} + 7 \arctan\frac{1}{239} - 12 \arctan\frac{1}{682} + 24 \arctan\frac{1}{12943} (F. C. M. Størmer (1896)).

These approximations have so many digits that they are no longer of any practical use, except for testing new supercomputers.{{cite news|url=http://www.extremetech.com/extreme/122159-what-can-you-do-with-a-supercomputer|title=What can you do with a supercomputer? – ExtremeTech|newspaper=Extremetech |date=15 March 2012 |last1=Anthony |first1=Sebastian }} Properties like the potential normality of {{pi}} will always depend on the infinite string of digits on the end, not on any finite computation.

=Miscellaneous approximations=

As well as the formulas and approximations such as \tfrac{22}{7} and \tfrac{355}{113} discussed elsewhere in this article,

The following expressions have been used to estimate {{pi}}:

  • Accurate to three digits: \sqrt{2} + \sqrt{3} = 3.146^+. Karl Popper conjectured that Plato knew this expression, that he believed it to be exactly {{pi}}, and that this is responsible for some of Plato's confidence in the universal power of geometry and for Plato's repeated discussion of special right triangles that are either isosceles or halves of equilateral triangles.{{cite journal

| last = Popper | first = K. R.

| date = August 1952

| doi = 10.1093/bjps/iii.10.124

| issue = 10

| journal = The British Journal for the Philosophy of Science

| jstor = 685553

| pages = 124–156

| publisher = University of Chicago Press

| title = The nature of philosophical problems and their roots in science

| volume = 3}} See p. 150.

  • Accurate to four digits: 1+e-\gamma= 3.1410^+, where e is the natural logarithmic base and \gamma is Euler's constant, and{{Cite book|first=Martin|last=Gardner|author-link=Martin Gardner|title=New Mathematical Diversions|publisher=Mathematical Association of America|year=1995|page=92|isbn=978-0-88385-517-1}} \sqrt[3]{31} = 3.1413^+.
  • Accurate to four digits (or five significant figures):{{cite web|url=http://www.mschneider.cc/papers/pi.pdf|title=A nested radical approximation for {{pi}}|archive-url=https://web.archive.org/web/20110706215615/http://www.mschneider.cc/papers/pi.pdf|date=6 July 2011 |archive-date=2011-07-06|first=Martin|last=Schneider}} \sqrt{7+\sqrt{6+\sqrt{5}}} = 3.1416^+.
  • An approximation by Ramanujan, accurate to 4 digits (or five significant figures): \frac{9}{5}+\sqrt{\frac{9}{5}} = 3.1416^+.
  • Accurate to five digits: \frac{7^7}{4^9} = 3.14156^+ and \sqrt[5]{306}=3.14155^+.
  • accurate to six digits:{{Cite web |title=Hemmes mathematische Rätsel: Die Quadratur des Kreises |url=https://www.spektrum.de/raetsel/die-quadratur-des-kreises/1716402 |access-date=2024-09-30 |website=www.spektrum.de |language=de}} \left(2 - \frac{\sqrt{2 \sqrt{2} - 2}}{2^2}\right)^2 = 3.14159\ 6^+.
  • accurate to eight digits:

::\left(\frac{\sqrt{58}}{4}-\frac{37\sqrt{2}}{33}\right)^{-1} = \frac{66\sqrt{2}}{33\sqrt{29}-148} = 3.14159\ 263^+{{cite book |title= Mathematics by Experiment: Plausible Reasoning in the 21st Century, 2nd Edition |last= Borwein |first= Jonathan |author2= Bailey, David |year= 2008 |publisher= A.K. Peters |isbn= 978-1-56881-442-1 |page= 135}}

:This is the case that cannot be obtained from Ramanujan's approximation (22).

  • accurate to nine digits:

:: \sqrt[4]{3^4+2^4+\frac{1}{2+(\frac{2}{3})^2}} =\sqrt[4]{\frac{2143}{22}} = 3.14159\ 2652^+

: This is from Ramanujan, who claimed the Goddess of Namagiri appeared to him in a dream and told him the true value of {{pi}}.

  • accurate to ten digits (or eleven significant figures): \sqrt[193]{\frac{10^{100}}{11222.11122}} = 3.14159\ 26536^+ This approximation follows the observation that the 193rd power of 1/{{pi}} yields the sequence 1122211125... Replacing 5 by 2 completes the symmetry without reducing the correct digits of {{pi}}, while inserting a central decimal point remarkably fixes the accompanying magnitude at 10100.{{cite journal|last=Hoffman|first=David W.|journal=College Mathematics Journal|volume=40|year=2009|issue=5|date=November 2009|jstor=25653799|title=A pi curiosity}}
  • accurate to 12 decimal places:

::\left(\frac{\sqrt{163}}{6}-\frac{181}{\sqrt{10005}}\right)^{-1} = 3.14159\ 26535\ 89^+

:This is obtained from the Chudnovsky series (truncate the series (1.4){{cite book |title= Pi: A Source Book, 3rd Edition |last= Berggren |first= Lennart |author2= Borwein, Jonathan |author3= Borwein, Peter |year= 2003 |publisher= Springer |isbn= 978-0-387-20571-7 |pages= 596–622}} at the first term and let {{math|E6(τ163)2/E4(τ163)3}} = 151931373056001/151931373056000 ≈ 1).

  • accurate to 16 digits:

::\frac{2510613731736 \sqrt{2}}{1130173253125} = 3.14159\ 26535\ 89793\ 9^+ - inverse of sum of first two terms of Ramanujan series.

::\frac{165707065}{52746197}=3.14159\ 26535\ 89793\ 4^+

  • accurate to 18 digits:

::\left(\frac{\sqrt{253}}{4}-\frac{643\sqrt{11}}{903}-\frac{223}{172}\right)^{-1} = 3.14159\ 26535\ 89793\ 2387^+

:This is the approximation (22) in Ramanujan's paper{{cite journal

| last = Ramanujan | first = S. | author-link = Srinivasa Ramanujan

| journal = Quarterly Journal of Mathematics

| pages = 350–372

| title = Modular equations and approximations to {{pi}}

| url = https://babel.hathitrust.org/cgi/pt?id=uc1.$b417565&seq=366

| volume = 45

| year = 1914}} Reprinted in {{cite book

| last1 = Berggren | first1 = Lennart

| last2 = Borwein | first2 = Jonathan

| last3 = Borwein | first3 = Peter

| contribution = Modular equations and approximations to {{pi}}

| doi = 10.1007/978-1-4757-4217-6_29

| edition = 3rd

| isbn = 0-387-20571-3

| mr = 2065455

| pages = 241–257

| publisher = Springer-Verlag | location = New York

| title = Pi: A Source Book

| year = 2004}} with {{math|n}} = 253.

  • accurate to 19 digits:

::\frac{3949122332 \sqrt{2}}{1777729635} = 3.14159\ 26535\ 89793\ 2382^+ - improved inverse of sum of first two terms of Ramanujan series.

  • accurate to 24 digits:

::\frac{2286635172367940241408 \sqrt{2}}{1029347477390786609545} = 3.14159\ 26535\ 89793\ 23846\ 2649^+ - inverse of sum of first three terms of Ramanujan series.

  • accurate to 25 decimal places:

::\frac{1}{10}\ln\left(\frac{2^{21}}{(\sqrt[4]{5}-1)^{24}}+24\right) = 3.14159\ 26535\ 89793\ 23846\ 26433\ 9^+

:This is derived from Ramanujan's class invariant {{math|g100 {{=}} 25/8/(51/4 − 1)}}.

  • accurate to 30 decimal places:

::\frac{\ln(640320^3+744)}{\sqrt{163}} = 3.14159\ 26535\ 89793\ 23846\ 26433\ 83279^+

: Derived from the closeness of Ramanujan constant to the integer 6403203+744. This does not admit obvious generalizations in the integers,{{clarify|date=December 2021|reason=It does what?}} because there are only finitely many Heegner numbers and negative discriminants d with class number h(−d) = 1, and d = 163 is the largest one in absolute value.

  • accurate to 52 decimal places:

::\frac{\ln(5280^3(236674+30303\sqrt{61})^3+744)}{\sqrt{427}}

:Like the one above, a consequence of the j-invariant. Among negative discriminants with class number 2, this d the largest in absolute value.

  • accurate to 52 decimal places:

::\frac{\ln(2^{-30}((3+\sqrt{5})(\sqrt{5}+\sqrt{7})(\sqrt{7}+\sqrt{11})(\sqrt{11}+3))^{12}-24)}{\sqrt{5}\sqrt{7}\sqrt{11}}

:This is derived from Ramanujan's class invariant {{math|G385}}.

  • accurate to 161 decimal places:

::\frac{\ln\big((2u)^6+24\big)}{\sqrt{3502}}

:where u is a product of four simple quartic units,

::u = (a+\sqrt{a^2-1})^2(b+\sqrt{b^2-1})^2(c+\sqrt{c^2-1})(d+\sqrt{d^2-1})

:and,

:: \begin{align}

a &= \tfrac{1}{2}(23+4\sqrt{34})\\

b &= \tfrac{1}{2}(19\sqrt{2}+7\sqrt{17})\\

c &= (429+304\sqrt{2})\\

d &= \tfrac{1}{2}(627+442\sqrt{2})

\end{align}

:Based on one found by Daniel Shanks. Similar to the previous two, but this time is a quotient of a modular form, namely the Dedekind eta function, and where the argument involves \tau = \sqrt{-3502}. The discriminant d = 3502 has h(−d) = 16.

  • accurate to 256 digits:

::\frac{15261343909396942111177730086852826352374060766771618308167575028500999

}{48590509502030754798379641288876701245663220023884870402810360529259}...

::...\frac{551152789881364457516133280872003443353677807669620554743 \sqrt{10005}}{313

4188302895457201473978137944378665098227220269702217081111} - improved inverse of sum of the first nineteen terms of Chudnovsky series.

  • The continued fraction representation of {{pi}} can be used to generate successive best rational approximations. These approximations are the best possible rational approximations of {{pi}} relative to the size of their denominators. Here is a list of the first thirteen of these:{{Cite OEIS|sequencenumber=A002485 |name=Numerators of convergents to Pi}}{{Cite OEIS|sequencenumber=A002486 |name=Denominators of convergents to Pi}}

:: \frac{3}{1}, \frac{22}{7}, \frac{333}{106}, \frac{355}{113}, \frac{103993}{33102}, \frac{104348}{33215}, \frac{208341}{66317}, \frac{312689}{99532}, \frac{833719}{265381}, \frac{1146408}{364913}, \frac{4272943}{1360120}, \frac{5419351}{1725033}

:Of these, \frac{355}{113} is the only fraction in this sequence that gives more exact digits of {{pi}} (i.e. 7) than the number of digits needed to approximate it (i.e. 6). The accuracy can be improved by using other fractions with larger numerators and denominators, but, for most such fractions, more digits are required in the approximation than correct significant figures achieved in the result.{{cite web|url=http://qin.laya.com/tech_projects_approxpi.html|title=Fractional Approximations of Pi}}

=Summing a circle's area=

File:Pi monte carlo en.gif

Pi can be obtained from a circle if its radius and area are known using the relationship:

: A = \pi r^2.

If a circle with radius {{mvar|r}} is drawn with its center at the point {{math|(0, 0)}}, any point whose distance from the origin is less than {{mvar|r}} will fall inside the circle. The Pythagorean theorem gives the distance from any point {{math|({{var|x}}, {{var|y}})}} to the center:

:d=\sqrt{x^2+y^2}.

Mathematical "graph paper" is formed by imagining a 1×1 square centered around each cell {{math|({{var|x}}, {{mvar|y}})}}, where {{mvar|x}} and {{mvar|y}} are integers between −{{mvar|r}} and {{mvar|r}}. Squares whose center resides inside or exactly on the border of the circle can then be counted by testing whether, for each cell {{math|({{var|x}}, {{mvar|y}})}},

:\sqrt{x^2+y^2} \le r.

The total number of cells satisfying that condition thus approximates the area of the circle, which then can be used to calculate an approximation of {{pi}}. Closer approximations can be produced by using larger values of {{mvar|r}}.

Mathematically, this formula can be written:

:\pi = \lim_{r \to \infty} \frac{1}{r^2} \sum_{x=-r}^{r} \; \sum_{y=-r}^{r} \begin{cases}

1 & \text{if } \sqrt{x^2+y^2} \le r \\

0 & \text{if } \sqrt{x^2+y^2} > r. \end{cases}

In other words, begin by choosing a value for {{mvar|r}}. Consider all cells ({{mvar|x}}, {{mvar|y}}) in which both {{mvar|x}} and {{mvar|y}} are integers between −{{mvar|r}} and {{mvar|r}}. Starting at 0, add 1 for each cell whose distance to the origin {{math|(0, 0)}} is less than or equal to {{mvar|r}}. When finished, divide the sum, representing the area of a circle of radius {{mvar|r}}, by {{mvar|r}}2 to find the approximation of {{pi}}.

For example, if {{mvar|r}} is 5, then the cells considered are:

:

style="font-size:75%;text-align:center;color:blue;height:1em" cellspacing="15"
style="color:black"

| (−5,5)

(−4,5)(−3,5)(−2,5)(−1,5)style="color:#bc1e47" | (0,5)(1,5)(2,5)(3,5)(4,5)(5,5)
style="color:black" | (−5,4)style="color:black" | (−4,4)style="color:#bc1e47" | (−3,4)(−2,4)(−1,4)(0,4)(1,4)(2,4)style="color:#bc1e47" | (3,4)style="color:black" | (4,4)style="color:black" | (5,4)
style="color:black" | (−5,3)style="color:#bc1e47" | (−4,3)(−3,3)(−2,3)(−1,3)(0,3)(1,3)(2,3)(3,3)style="color:#bc1e47" | (4,3)style="color:black" | (5,3)
style="color:black" | (−5,2)(−4,2)(−3,2)(−2,2)(−1,2)(0,2)(1,2)(2,2)(3,2)(4,2)style="color:black" | (5,2)
style="color:black" | (−5,1)(−4,1)(−3,1)(−2,1)(−1,1)(0,1)(1,1)(2,1)(3,1)(4,1)style="color:black" | (5,1)
style="color:#bc1e47" | (−5,0)(−4,0)(−3,0)(−2,0)(−1,0)(0,0)(1,0)(2,0)(3,0)(4,0)style="color:#bc1e47" | (5,0)
style="color:black" | (−5,−1)(−4,−1)(−3,−1)(−2,−1)(−1,−1)(0,−1)(1,−1)(2,−1)(3,−1)(4,−1)style="color:black" | (5,−1)
style="color:black" | (−5,−2)(−4,−2)(−3,−2)(−2,−2)(−1,−2)(0,−2)(1,−2)(2,−2)(3,−2)(4,−2)style="color:black" | (5,−2)
style="color:black" | (−5,−3)style="color:#bc1e47" | (−4,−3)(−3,−3)(−2,−3)(−1,−3)(0,−3)(1,−3)(2,−3)(3,−3)style="color:#bc1e47" | (4,−3)style="color:black" | (5,−3)
style="color:black" | (−5,−4)style="color:black" | (−4,−4)style="color:#bc1e47" | (−3,−4)(−2,−4)(−1,−4)(0,−4)(1,−4)(2,−4)style="color:#bc1e47" | (3,−4)style="color:black" | (4,−4)style="color:black" | (5,−4)
style="color:black"

| (−5,−5)

(−4,−5)(−3,−5)(−2,−5)(−1,−5)style="color:#bc1e47" | (0,−5)(1,−5)(2,−5)(3,−5)(4,−5)(5,−5)

File:Kreuz-5.svg graph. The cells {{math|(±3, ±4)}} and {{math|(±4, ±3)}} are labeled.]]

The 12 cells (0, ±5), (±5, 0), (±3, ±4), (±4, ±3) are exactly on the circle, and 69 cells are completely inside, so the approximate area is 81, and {{pi}} is calculated to be approximately 3.24 because {{sfrac|81|52}} = 3.24. Results for some values of {{mvar|r}} are shown in the table below:For related results see [https://oeis.org/A057655 The circle problem: number of points (x,y) in square lattice with x^2 + y^2 <= n].

{{Table alignment}}

class="wikitable col1right col2right"
rareaapproximation of {{pi}}
2133.25
3293.22222
4493.0625
5813.24
103173.17
2012573.1425
100314173.1417
100031415493.141549

Similarly, the more complex approximations of {{pi}} given below involve repeated calculations of some sort, yielding closer and closer approximations with increasing numbers of calculations.

=Continued fractions=

Besides its simple continued fraction representation [3; 7, 15, 1, 292, 1, 1,{{nbsp}}...], which displays no discernible pattern, {{pi}} has many generalized continued fraction representations generated by a simple rule, including these two.

:

\pi= {3 + \cfrac{1^2}{6 + \cfrac{3^2}{6 + \cfrac{5^2}{6 + \ddots\,}}}}

:

\pi = \cfrac{4}{1 + \cfrac{1^2}{3 + \cfrac{2^2}{5 + \cfrac{3^2}{7 + \cfrac{4^2}{9 + \ddots}}}}} = 3 + \cfrac{1^2}{5 + \cfrac{4^2}{7 + \cfrac{3^2}{9 + \cfrac{6^2}{11 + \cfrac{5^2}{13 + \ddots}}}}}

The remainder of the Madhava–Leibniz series can be expressed as generalized continued fraction as follows.{{cite journal|author-first=J.|author-last=Dutka|title=Wallis's product, Brouncker's continued fraction, and Leibniz's series|journal=Archive for History of Exact Sciences|volume=26|pages=115–126|year=1982|issue=2 |doi=10.1007/BF00348349 |s2cid=121628039 }}

:

\pi = 4\sum_{n=1}^{m}\frac{(-1)^{n-1}}{2n-1}+\cfrac{2(-1)^m}{2m + \cfrac{1^2}{2m + \cfrac{2^2}{2m + \cfrac{3^2}{2m + \ddots}}}} \qquad (m=1,2,3,\ldots)

Note that Madhava's correction term is

:

\frac{2}{2m + \frac{1^2}{2m + \frac{2^2}{2m}}} = 4\frac{m^2+1}{4m^3+5m}

.

The well-known values {{sfrac|22|7}} and {{sfrac|355|113}} are respectively the second and fourth continued fraction approximations to π.Other representations are available at [http://functions.wolfram.com/Constants/Pi/10/ The Wolfram Functions Site].

=Trigonometry=

==Gregory–Leibniz series==

The Gregory–Leibniz series

: \pi = 4\sum_{n=0}^{\infty} \cfrac {(-1)^n}{2n+1} = 4\left( \frac{1}{1} - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} +- \cdots\right)

is the power series for arctan(x) specialized to {{math|x}} = 1. It converges too slowly to be of practical interest. However, the power series converges much faster for smaller values of x, which leads to formulae where \pi arises as the sum of small angles with rational tangents, known as Machin-like formulae.

==Arctangent==

{{further|Double factorial}}

Knowing that 4 arctan 1 = {{pi}}, the formula can be simplified to get:

: \begin{align}

\pi &= 2\left( 1 + \cfrac{1}{3} + \cfrac{1\cdot2}{3\cdot5}

+ \cfrac{1\cdot2\cdot3}{3\cdot5\cdot7} + \cfrac{1\cdot2\cdot3\cdot4}{3\cdot5\cdot7\cdot9}

+ \cfrac{1\cdot2\cdot3\cdot4\cdot5}{3\cdot5\cdot7\cdot9\cdot11} + \cdots\right) \\

&= 2\sum_{n=0}^{\infty} \cfrac {n!}{(2n + 1)!!}

= \sum_{n=0}^{\infty} \cfrac {2^{n+1} n!^2} {(2n + 1)!}

= \sum_{n=0}^{\infty} \cfrac {2^{n+1}} {\binom {2n} n (2n + 1)} \\

&= 2 + \frac{2}{3} + \frac{4}{15} + \frac{4}{35} + \frac{16}{315} + \frac{16}{693}

+ \frac{32}{3003} + \frac{32}{6435} + \frac{256}{109395} + \frac{256}{230945} + \cdots

\end{align}

with a convergence such that each additional 10 terms yields at least three more digits.

:

\pi=2+\frac{1}{3}\left(2+\frac{2}{5}\left(2+\frac{3}{7}\left(2+\cdots\right)\right)\right)

:This series is the basis for a decimal spigot algorithm by Rabinowitz and Wagon.{{Cite journal |last1=Rabinowitz |first1=Stanley |last2=Wagon |first2=Stan |date=1995 |title=A Spigot Algorithm for the Digits of π |url=https://www.jstor.org/stable/2975006 |journal=The American Mathematical Monthly |volume=102 |issue=3 |pages=195–203 |doi=10.2307/2975006 |jstor=2975006 |issn=0002-9890}}

:

Another formula for \pi involving arctangent function is given by

: \frac{\pi}{2^{k+1}}=\arctan \frac{\sqrt{2-a_{k-1}}}{a_k}, \qquad\qquad k\geq 2,

where a_k=\sqrt{2+a_{k-1}} such that a_1=\sqrt{2} . Approximations can be made by using, for example, the rapidly convergent Euler formula{{citation|title= An elementary derivation of Euler's series for the arctangent function|journal = The Mathematical Gazette | author = Hwang Chien-Lih | doi = 10.1017/S0025557200178404 | year = 2005 | volume = 89 | issue = 516|pages = 469–470 |s2cid = 123395287 }}

:\arctan(x) = \sum_{n=0}^\infty \frac{2^{2n} (n!)^2}{(2n + 1)!} \; \frac{x^{2n + 1}}{(1 + x^2)^{n + 1}}.

Alternatively, the following simple expansion series of the arctangent function can be used

:

\arctan(x)=2\sum_{n=1}^{\infty}{\frac{1}{2n-1}\frac{{{a}_{n}}\left(x\right)}{a_{n}^{2}\left(x\right)+b_{n}^{2}\left(x\right)}},

where

:

\begin{align}

& a_1(x)=2/x,\\

& b_1(x)=1,\\

& a_n(x)=a_{n-1}(x)\,\left(1-4/x^2\right)+4b_{n-1}(x)/x,\\

& b_n(x)=b_{n-1}(x)\,\left(1-4/x^2\right)-4a_{n-1}(x)/x,

\end{align}

to approximate \pi with even more rapid convergence. Convergence in this arctangent formula for \pi improves as integer k increases.

The constant \pi can also be expressed by infinite sum of arctangent functions as

:\frac{\pi}{2} = \sum_{n=0}^\infty \arctan\frac{1}{F_{2n+1}} = \arctan\frac{1}{1} + \arctan\frac{1}{2} + \arctan\frac{1}{5} + \arctan\frac{1}{13} + \cdots

and

: \frac{\pi}{4}=\sum_{k \geq 2} \arctan \frac{\sqrt{2-a_{k-1}}}{a_k},

where F_n is the n-th Fibonacci number. However, these two formulae for \pi are much slower in convergence because of set of arctangent functions that are involved in computation.

==Arcsine==

Observing an equilateral triangle and noting that

: \sin\left (\frac{\pi}{6}\right )=\frac{1}{2}

yields

: \begin{align}

\pi &= 6 \sin^{-1} \left( \frac{1}{2} \right)

= 6 \left( \frac{1}{2} + \frac{1}{2\cdot 3\cdot 2^3} + \frac{1\cdot 3}{2\cdot 4\cdot 5\cdot 2^5}

+ \frac{1\cdot 3\cdot 5}{2\cdot 4\cdot 6\cdot 7\cdot 2^7} + \cdots\! \right) \\

&= \frac {3} {16^0 \cdot 1} + \frac {6} {16^1 \cdot 3} + \frac {18} {16^2 \cdot 5} + \frac {60} {16^3 \cdot 7} + \cdots\!

= \sum_{n=0}^\infty \frac {3 \cdot \binom {2n} n} {16^n (2n+1)} \\

&= 3 + \frac{1}{8} + \frac{9}{640} + \frac{15}{7168} + \frac{35}{98304}

+ \frac{189}{2883584} + \frac{693}{54525952} + \frac{429}{167772160} + \cdots

\end{align}

with a convergence such that each additional five terms yields at least three more digits.

Digit extraction methods

The Bailey–Borwein–Plouffe formula (BBP) for calculating {{pi}} was discovered in 1995 by Simon Plouffe. Using Hexadecimal math, the formula can compute any particular digit of {{pi}}—returning the hexadecimal value of the digit—without having to compute the intervening digits (digit extraction).{{MathWorld|title=BBP Formula|urlname=BBPFormula}}

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

In 1996, Simon Plouffe derived an algorithm to extract the {{math|n}}th decimal digit of {{pi}} (using base{{nbsp}}10 math to extract a base{{nbsp}}10 digit), and which can do so with an improved speed of {{math|O(n3(log n)3)}} time. The algorithm requires virtually no memory for the storage of an array or matrix so the one-millionth digit of {{pi}} can be computed using a pocket calculator.{{cite arXiv|eprint=0912.0303v1 |last1=Plouffe |first1=Simon |title=On the computation of the n^th decimal digit of various transcendental numbers |class=math.NT |year=2009 }} However, it would be quite tedious and impractical to do so.

: \pi+3=\sum_{n=1}^\infty \frac{n2^nn!^2}{(2n)!}

The calculation speed of Plouffe's formula was improved to {{math|O(n2)}} by Fabrice Bellard, who derived an alternative formula (albeit only in base{{nbsp}}2 math) for computing {{pi}}.{{Cite web |title=Computation of the n'th digit of in any base in O(n^2) |url=https://bellard.org/pi/pi_n2/pi_n2.html |access-date=2024-09-30 |website=bellard.org}}

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

Efficient methods

Many other expressions for {{pi}} were developed and published by Indian mathematician Srinivasa Ramanujan. He worked with mathematician Godfrey Harold Hardy in England for a number of years.

Extremely long decimal expansions of {{pi}} are typically computed with the Gauss–Legendre algorithm and Borwein's algorithm; the Salamin–Brent algorithm, which was invented in 1976, has also been used.

In 1997, David H. Bailey, Peter Borwein and Simon Plouffe published a paper (Bailey, 1997) on a new formula for {{pi}} as an infinite series:

: \pi = \sum_{k = 0}^\infty \frac{1}{16^k}

\left( \frac{4}{8k + 1} - \frac{2}{8k + 4} - \frac{1}{8k + 5} - \frac{1}{8k + 6}\right).

This formula permits one to fairly readily compute the kth binary or hexadecimal digit of {{pi}}, without having to compute the preceding k − 1 digits. Bailey's website{{cite web|url=http://crd.lbl.gov/~dhbailey/|title=David H Bailey|website=crd.LBL.gov|access-date=11 December 2017|archive-url=https://web.archive.org/web/20110410104840/http://crd.lbl.gov/~dhbailey/|archive-date=2011-04-10}} contains the derivation as well as implementations in various programming languages. The PiHex project computed 64 bits around the quadrillionth bit of {{pi}} (which turns out to be 0).

Fabrice Bellard further improved on BBP with his formula:{{cite web|url=http://www.pi314.net/eng/bellard.php |title=The world of Pi – Bellard |publisher=Pi314.net |date=2013-04-13 |access-date=2016-04-18}}

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

Other formulae that have been used to compute estimates of {{pi}} include:

:

\frac{\pi}{2}=\sum_{k=0}^\infty\frac{k!}{(2k+1)!!}=\sum_{k=0}^{\infty}\frac{2^k k!^2}{(2k+1)!} =1+\frac{1}{3}\left(1+\frac{2}{5}\left(1+\frac{3}{7}\left(1+\cdots\right)\right)\right)

:Newton.

:

: \frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum^\infty_{k=0} \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}

:Srinivasa Ramanujan.

This converges extraordinarily rapidly. Ramanujan's work is the basis for the fastest algorithms used, as of the turn of the millennium, to calculate {{pi}}.

In 1988, David Chudnovsky and Gregory Chudnovsky found an even faster-converging series (the Chudnovsky algorithm):

: \frac{1}{\pi} = \frac{1}{426880\sqrt{10005}} \sum^\infty_{k=0} \frac{(6k)! (13591409 + 545140134k)}{(3k)!(k!)^3 (-640320)^{3k}}.

The speed of various algorithms for computing pi to n correct digits is shown below in descending order of asymptotic complexity. M(n) is the complexity of the multiplication algorithm employed.

class="wikitable"
AlgorithmYearTime complexity or Speed
Gauss–Legendre algorithm1975O(M(n)\log(n))
Chudnovsky algorithm1988O(n \log(n)^3)
Binary splitting of the arctan series in Machin's formulaO(M(n) (\log n)^2)
Leibniz formula for π1300sSublinear convergence. Five billion terms for 10 correct decimal places

Projects

=Pi Hex=

Pi Hex was a project to compute three specific binary digits of {{pi}} using a distributed network of several hundred computers. In 2000, after two years, the project finished computing the five trillionth (5*1012), the forty trillionth, and the quadrillionth (1015) bits. All three of them turned out to be 0.

Software for calculating {{pi}}

Over the years, several programs have been written for calculating {{pi}} to many digits on personal computers.

=General purpose=

Most computer algebra systems can calculate {{pi}} and other common mathematical constants to any desired precision.

Functions for calculating {{pi}} are also included in many general libraries for arbitrary-precision arithmetic, for instance Class Library for Numbers, MPFR and SymPy.

=Special purpose=

Programs designed for calculating {{pi}} may have better performance than general-purpose mathematical software. They typically implement checkpointing and efficient disk swapping to facilitate extremely long-running and memory-expensive computations.

  • TachusPi by Fabrice Bellard{{Cite web|url=https://bellard.org/pi/pi2700e9/tpi.html|title=TachusPi|last=Bellard|first=Fabrice|access-date=20 March 2020}} is the program used by himself to compute world record number of digits of pi in 2009.
  • Y-cruncher by Alexander Yee is the program which every world record holder since Shigeru Kondo in 2010 has used to compute world record numbers of digits. {{math|y}}-cruncher can also be used to calculate other constants and holds world records for several of them.
  • {{anchor|PiFast}}PiFast by Xavier Gourdon was the fastest program for Microsoft Windows in 2003. According to its author, it can compute one million digits in 3.5 seconds on a 2.4 GHz Pentium 4."[http://numbers.computation.free.fr/Constants/PiProgram/timings.html PiFast timings]" PiFast can also compute other irrational numbers like {{math|e}} and {{math|square root of 2}}. It can also work at lesser efficiency with very little memory (down to a few tens of megabytes to compute well over a billion (109) digits). This tool is a popular benchmark in the overclocking community. PiFast 4.4 is available from [https://web.archive.org/web/20090220154930/http://members.shaw.ca/francislyster/pi/pi.html Stu's Pi page]. PiFast 4.3 is available from Gourdon's page.
  • QuickPi by Steve Pagliarulo for Windows is faster than PiFast for runs of under 400 million digits. Version 4.5 is available on Stu's Pi Page below. Like PiFast, QuickPi can also compute other irrational numbers like {{math|e}}, {{math|{{radic|2}}}}, and {{math|square root of 3}}. The software may be obtained from the Pi-Hacks Yahoo! forum, or from [https://web.archive.org/web/20090220154930/http://members.shaw.ca/francislyster/pi/pi.html Stu's Pi page].
  • Super PI by Kanada Laboratory{{cite web|url=http://pi2.cc.u-tokyo.ac.jp/index.html |title=Kanada Laboratory home page |date=10 August 2010 |author1=Takahashi, Daisuke |author2=Kanada, Yasumasa |publisher=University of Tokyo |access-date=1 May 2011 |url-status=dead |archive-url=https://web.archive.org/web/20110824110203/http://pi2.cc.u-tokyo.ac.jp/index.html |archive-date=24 August 2011 }} in the University of Tokyo is the program for Microsoft Windows for runs from 16,000 to 33,550,000 digits. It can compute one million digits in 40 minutes, two million digits in 90 minutes and four million digits in 220 minutes on a Pentium 90 MHz. Super PI version 1.9 is available from [https://www.filecluster.com/Super-PI.html Super PI 1.9 page].

See also

Notes

{{Reflist}}

References

  • {{Cite journal

| author1 = Bailey, David H. |author2-link = Peter Borwein |author2 = Borwein, Peter B. |author3-link = Simon Plouffe |author3 = Plouffe, Simon |name-list-style=amp|date=April 1997

| title = On the Rapid Computation of Various Polylogarithmic Constants

| journal = Mathematics of Computation

| volume = 66 | issue = 218 | pages = 903–913

| url = http://crd.lbl.gov/~dhbailey/dhbpapers/digits.pdf

| doi = 10.1090/S0025-5718-97-00856-9

|author1-link = David H. Bailey (mathematician) |bibcode = 1997MaCom..66..903B |doi-access = free }}

  • {{Cite book|first=Petr|last=Beckmann |title=A History of {{pi}} |year=1971 |publisher=St. Martin's Press |place=New York |isbn=978-0-88029-418-8 |mr=0449960 |author-link=Petr Beckmann |title-link=A History of π}}
  • {{Cite book|first=Howard|last=Eves |title=An Introduction to the History of Mathematics |year=1992 |edition=6th |publisher=Saunders College Publishing |isbn=978-0-03-029558-4}}
  • {{Cite book

| author = Joseph, George G.

| year =2000

| title = The Crest of the Peacock: Non-European Roots of Mathematics

| edition=New ed., London : Penguin

| isbn=978-0-14-027778-4

| publisher = Penguin

| location = London

}}

  • {{Cite book |author1=Jackson, K |author2=Stamp, J. |year=2002 |isbn=9780563488033 |title=Pyramid: Beyond Imagination. Inside the Great Pyramid of Giza |publisher=BBC |location=London}}
  • {{Cite book

|author1=Berggren, Lennart |author2=Borwein, Jonathan M. |author3=Borwein, Peter B.

| year =2004

| edition = 3rd

| title = Pi: a source book

| publisher = Springer Science + Business Media LLC

| location = New York

| isbn = 978-1-4757-4217-6

}}

{{DEFAULTSORT:Approximations of Pi}}

Category:Approximations

Category:History of mathematics

Category:Pi

Category:Pi algorithms

Category:Real transcendental numbers