Arctan Formulae for Computing π
Derivation of the Machin Formula
In 1706 John Machin, Professor of Astronomy in London, computed π to 100 digits using the formula (Formula 8):
π = 16·arctan(1/5) − 4·arctan(1/239)
This is not an arbitrary formula. It can be derived easily.
First, start with:
tan α = 1/5
for some angle α that we need not be concerned with since it will disappear from the final result. (For the curious, α ≈ 11° 18' 35.8").
Using the trig formula for double angles:
| tan 2α = | 2·tan α | = | 2/5 |   = | 5 |
| 1 − tan2 α | 1 − 1/25 | 12 |
Applying the double angle formula once more:
| tan 4α = | 2·tan 2α | = | 5/6 |   = | 120 |
| 1 − tan2 2α | 1 − 5/144 | 119 |
This differs from 1 by only the small value 1/119, and tan 1 = π/4 which means that tan 4α − 1 = 1/119, and 4α differs from π/4 by a small value thus tan (4α − π/4) is small. Indeed, it is just::
| tan (4α − π/4) = | tan 4α − tan π/4 | = | tan 4α − 1 | = | 120/119 − 1 |   = | 1 |
| tan 4α + tan π/4 | tan 4α + 1 | 120/119 + 1 | 239 |
Taking the arctan of both sides results in:
4α − π/4 = arctan (1/239)
Solving for π and substituting α = arctan(1/5) finally gives:
π = 16·arctan(1/5) − 4·arctan(1/239)