Machin-like formula

In mathematics, Machin-like formulas are a popular technique for computing π (the ratio of the circumference to the diameter of a circle) to a large number of digits. They are generalizations of John Machin's formula from 1706:

which he used to compute π to 100 decimal places.

Machin-like formulas have the form

where is a positive integer, are signed non-zero integers, and and are positive integers such that .

These formulas are used in conjunction with Gregory's series, the Taylor series expansion for arctangent: