What is the Machin-like Pi Calculator?
This tool computes the mathematical constant pi using one of six historical "Machin-like" four-term arctangent formulas. Each formula expresses pi/4 as a weighted sum of four arctan(1/x) terms with large x, so the underlying Gregory series converges quickly. All six formulas produce the identical constant pi; they differ only in their convergence speed and historical origin.
How to use it
Pick a formula from the dropdown (Gauss 1863, Stormer 1896, Escott 1896, K. Takano 1982, T. Murata 1982, or A. Shibata 1983) and choose how many significant digits to display. The calculator then evaluates each arctangent and combines them into pi. Because this build uses double-precision floating point, the effective accuracy is about 15-16 significant digits regardless of the larger display option chosen.
The formula explained
A Machin-like formula has the form $$\frac{\pi}{4} = a_1\arctan\frac{1}{b_1} + a_2\arctan\frac{1}{b_2} + a_3\arctan\frac{1}{b_3} + a_4\arctan\frac{1}{b_4}.$$ Each arctangent can be computed with the Gregory series $$\arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots,$$ which converges rapidly when \(x = 1/b\) is small. Multiplying the weighted sum by 4 gives \(\pi\).
Worked example
Using Gauss (1863): $$\frac{\pi}{4} = 12\arctan\frac{1}{38} + 20\arctan\frac{1}{57} + 7\arctan\frac{1}{239} + 24\arctan\frac{1}{268}.$$ Evaluating the arctangents gives \(0.0263097861\), \(0.0175420604\), \(0.0041840760\) and \(0.0037313259\). The weighted sum equals \(0.785398163\), and multiplying by 4 yields $$\pi = 3.14159265358979.$$
FAQ
Why do all formulas give the same answer? They are algebraically equivalent identities for \(\pi/4\); only the convergence rate differs.
Can I get 50 digits? The display lets you request up to 50 digits, but standard double precision tops out near 15-16 significant digits, so extra digits are not reliable.
What is a Machin-like formula? A generalization of John Machin's 1706 formula $$\frac{\pi}{4} = 4\arctan\frac{1}{5} - \arctan\frac{1}{239},$$ using arctangent terms with small arguments for fast convergence.