keisoku

Pi via Four-Term Machin-like Arctangent Formula

Approximate pi quickly with a Machin-like formula built from four arctangent terms. Set the number of series terms to see the approximation, the error against true pi, the matching digits, and each term broken down.

Input

Approximate pi using a Machin-like formula built from four arctangent terms. Each arctangent is computed by a series, and you choose how many terms to add.

Formula used

pi / 4 = 44 arctan(1/57) + 7 arctan(1/239) − 12 arctan(1/682) + 24 arctan(1/12943)

Set how many leading series terms to add for each arctangent. Enter a whole number from 1 to 200.

Result

Pi approximation with 5 terms

3.14159265359

True pi

3.14159265359

Error vs true pi

0

Matching digits

about 15 digits

Breakdown of each arctangent term

Shows the coefficient, denominator, arctangent value, and contribution to the formula for each term.

TermCoefficientArctangent valueContribution
arctan(1/57)440.0175420600570.771850642526
arctan(1/239)70.0041840760020.029288532015
arctan(1/682)-120.001466274609-0.017595295308
arctan(1/12,943)240.000077261840.001854284165

Terms with a larger denominator converge faster, so even a few terms are accurate. Increasing the term count makes the error shrink rapidly.

How it works

  • This tool expresses pi divided by four as a combination of four arctangent terms of the form arctan of one over a denominator, and approximates each arctangent with the Gregory series.
  • Terms with a larger denominator contribute less per term, so the series converges faster and few terms already give high accuracy.
  • The result shows the approximation, the absolute error against true pi, and the approximate number of matching significant digits at once.
  • Each arctangent term is broken down into its coefficient, denominator, arctangent value, and contribution so you can see how the formula is assembled.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Pi via Four-Term Machin-like Arctangent Formula