Connect via MCP →

Enter Calculation

Display precision is capped to about 15-16 significant digits in double-precision arithmetic.

Formula

Formula: Pi Calculator: Three-Term Machin-like ATAN Formulas
Show calculation steps (1)
  1. Gregory (Maclaurin) series for arctangent

    Gregory (Maclaurin) series for arctangent: Pi Calculator: Three-Term Machin-like ATAN Formulas

    Each arctan of a small argument x = 1/b is summed term by term until the increment falls below the precision target.

Advertisement

Results

Computed value of pi
3.141592653589793
pi (dimensionless)
Term 1 0.797349219929296
Term 2 -0.004184076002075
Term 3 -0.007766980529773
Absolute error vs Math.PI 4.440892098500626E-16

What this calculator does

This tool computes the mathematical constant pi using one of four classic three-term Machin-like arctangent identities. Each identity writes pi/4 as a weighted sum of three arctangent terms of the form \(a \cdot \arctan(1/b)\), where every coefficient is an exact integer. Because each argument \(1/b\) is small, the arctangent is evaluated efficiently with the Gregory (Maclaurin) power series. This is pure mathematics and applies universally with no regional assumptions.

How to use it

Pick a formula from the dropdown: Klingenstierna (1730), Strassnitzky (1844), Gauss (1863), or Stormer (1896). Then choose the number of digits of precision. All four formulas converge to the same value of pi; they differ only in how quickly the arctangent series settles. Formulas with larger denominators (such as 239 and 515) converge faster than Strassnitzky's small denominators. Note that this build uses double-precision floating point, so the displayed accuracy is limited to roughly 15-16 significant digits regardless of the requested precision.

The formula explained

For chosen coefficients the calculator evaluates each term as term_i = a_i * atanSeries(1/b_i), where atanSeries(x) = x - x^3/3 + x^5/5 - x^7/7 + .... That is, $$\arctan x = x - \tfrac{x^3}{3} + \tfrac{x^5}{5} - \tfrac{x^7}{7} + \cdots$$ The series is summed until the next increment is smaller than the tolerance (about 10 to the negative of the digit count plus two). Finally $$\pi = 4\left(a_1\arctan\tfrac{1}{b_1} + a_2\arctan\tfrac{1}{b_2} + a_3\arctan\tfrac{1}{b_3}\right)$$ Negative coefficients simply subtract their arctangent term, and the sign is preserved exactly as tabulated.

Advertisement
Three small angle wedges summing to a quarter circle representing pi over four
Three weighted arctangent angles combine to equal a quarter of pi.
Right triangle showing arctan(1/b) as an angle with opposite side 1 and adjacent side b
Each term \(\arctan(1/b)\) is the angle of a right triangle with legs 1 and b.

Worked example

Using Strassnitzky's identity: \(\arctan(1/2) = 0.4636476090008061\), \(\arctan(1/5) = 0.1973955598498807\), \(\arctan(1/8) = 0.1243549945467614\). Their sum is $$0.4636476090008061 + 0.1973955598498807 + 0.1243549945467614 = 0.7853981633974482,$$ and four times that is $$4 \times 0.7853981633974482 = 3.141592653589793,$$ which matches pi to full double precision.

FAQ

Why use arctangent identities instead of a simpler series? The plain Leibniz series for pi/4 converges painfully slowly. Splitting pi/4 into arctangents of small arguments makes each series converge much faster.

Why can't I get 50 exact digits? Standard double-precision arithmetic carries only about 15-16 significant decimal digits. A true arbitrary-precision build would use BigDecimal arithmetic to reach the larger targets.

Do all four formulas give the same answer? Yes. They are mathematically equivalent identities for pi; only their convergence speed differs.

Last updated: