Fact-checked by Grok 2 weeks ago

Machin-like formula

A Machin-like formula is a mathematical identity that expresses \pi/4 as an integer linear combination of arctangents (or equivalently, arccotangents) of rational numbers, enabling efficient computation of \pi through the rapid convergence of the arctangent Taylor series for arguments less than 1. These formulas take the general form m \cot^{-1} u + n \cot^{-1} v = \pi/(4k), where u, v, and k are positive integers and m, n are nonnegative integers, though extensions to more terms are common. The prototype was discovered by English mathematician and astronomer John Machin in 1706, given by \pi/4 = 4 \arctan(1/5) - \arctan(1/239), which he used—along with the Leibniz formula for arctangent—to calculate \pi to 100 decimal places, setting a record that stood for over a century. This two-term formula arises from the complex number identity (5 + i)^4 = (239 + i)(2 + 2i), leading to the angle addition relation $4 \arctan(1/5) = \pi/4 + \arctan(1/239). Subsequent mathematicians, including Leonhard Euler, Carl Friedrich Gauss, and Derrick Henry Lehmer, generalized Machin's approach, deriving hundreds of similar identities, such as the two-term formula \pi/4 = \arctan(1/2) + \arctan(1/3) or the five-term Hermann formula \pi/4 = 2 \arctan(1/3) + 2 \arctan(1/7) - \arctan(1/44). These are generated by solving for integer relations in the argument of complex numbers of the form (1 + i)^k (u + i)^m (v + i)^n being real and positive. Machin-like formulas have been instrumental in historical and modern computations of \pi, with their efficiency quantified by Lehmer's measure e = \sum \frac{1}{\log_{10} b_i}, where b_i are the denominators of the reduced arctangent arguments; lower e values indicate faster convergence to more digits. For instance, a 1997 six-term formula by Chan Hwang achieves e \approx 1.512, better than Machin's e \approx 1.851. Databases as of 2025 list over 17,000 such formulas, including 4 two-term, 106 three-term, and 90 five-term variants, continuing to inform high-precision algorithms despite the advent of faster methods like the Chudnovsky algorithm.

Definition and History

Definition

A Machin-like formula expresses \pi/4 as a finite linear combination of arctangent functions with rational arguments, specifically of the form \frac{\pi}{4} = \sum_{k=1}^n a_k \arctan(b_k), where the coefficients a_k are nonzero integers (positive or negative) and the arguments b_k are positive rational numbers, often taken as reciprocals of positive integers to ensure |b_k| < 1 for rapid convergence. These formulas are named after the English mathematician John Machin, who in 1706 discovered the first practical two-term example, \pi/4 = 4\arctan(1/5) - \arctan(1/239), which enabled the computation of \pi to 100 decimal places—a record at the time. Arctangent functions are employed in these formulas because their Taylor series expansions converge more quickly when evaluated at small arguments, allowing for efficient numerical approximation of \pi. The underlying series is \arctan(x) = \sum_{m=0}^\infty (-1)^m \frac{x^{2m+1}}{2m+1}, \quad |x| < 1, which alternates and decreases rapidly for small |x|, minimizing the number of terms needed for high precision. By selecting appropriate small b_k and integer coefficients a_k, the combined series benefits from partial cancellation of higher-order terms across the sum, further accelerating convergence compared to the slower direct series for \arctan(1).

Historical Development

The origins of Machin-like formulas trace back to 1706, when English mathematician John Machin developed a two-term arctangent identity that allowed for the computation of π to 100 decimal places, a significant advancement over the slower-converging single arctangent series proposed by Gottfried Wilhelm Leibniz in the late 17th century. Machin's approach leveraged the Leibniz-Gregory series for arctangent but combined terms to accelerate convergence, enabling manual calculations that were both faster and more precise for the era. This formula was instrumental in early 18th-century computations, notably employed by French mathematician Thomas Fantet de Lagny in 1719 to verify 112 correct decimal digits of π. In the 18th and 19th centuries, mathematicians expanded upon Machin's idea, developing multi-term variants to further optimize convergence. Leonhard Euler introduced a prominent three-term formula in 1755, expressed as π/4 = 5 arctan(1/7) + 2 arctan(3/79), which offered improved efficiency for subsequent calculations. Contributions from Jacob Hermann in the early 18th century and Carl Friedrich Gauss in the early 1800s built on this foundation; Hermann explored related arctangent relations around the time of Machin's work, while Gauss devised a three-term identity, \pi/4 = 12 \arctan(1/18) + 8 \arctan(1/57) - 5 \arctan(1/239), that enhanced computational practicality for larger digit counts. These developments marked a shift toward more systematic exploration of arctangent combinations, laying groundwork for broader applications in pi computation. The 20th century saw the introduction of systematic search methods for discovering Machin-like formulas with enhanced efficiency, exemplified by Derrick Henry Lehmer's work in 1957, which facilitated the identification of identities boasting smaller Lehmer measures—a metric quantifying computational merit based on term magnitudes. Earlier, Lehmer had pioneered the measure itself in 1938 while analyzing arctangent relations for π. In 1841, William Rutherford derived a three-term formula, \pi/4 = \arctan(1/2) + \arctan(1/5) + \arctan(1/8). A notable milestone in automated computation was the 1949 calculation of \pi to 2,037 decimal places on ENIAC by G.W. Reitwiesner and colleagues, using Machin's formula. In the modern era, computational tools have revolutionized the enumeration of Machin-like formulas, culminating in comprehensive databases such as machin-like.org, launched around 2020, which catalogs over 17,000 such identities derived through algorithmic searches. These resources underscore the transition from manual derivations to high-throughput discovery, enabling ongoing refinements in pi calculation efficiency while preserving the foundational principles established centuries earlier.

Mathematical Foundations

Arctangent Identities

The tangent addition formula provides the foundation for identities involving arctangents in Machin-like formulas. It states that for angles A and B, \tan(A + B) = \frac{\tan A + \tan B}{1 - \tan A \tan B}, provided that A + B is within the appropriate range to avoid discontinuities in the tangent function. This formula directly implies the addition identity for arctangents. Specifically, if A = \arctan x and B = \arctan y, then \tan A = x and \tan B = y, so \arctan x + \arctan y = \arctan\left( \frac{x + y}{1 - xy} \right), with the condition xy < 1 to ensure the sum lies within the principal range of the arctangent function, which is (-\pi/2, \pi/2). If xy > 1, an adjustment by \pi (with sign depending on the arguments) is required to account for the branch of the arctangent. A related identity arises from subtraction, derived by setting y to negative in the addition formula. For a > b > 0, \arctan a - \arctan b = \arctan\left( \frac{a - b}{1 + ab} \right), since \arctan(-b) = -\arctan b and the denominator becomes $1 + ab. This holds under the condition that ab > -1, which is satisfied for positive arguments, and it preserves the principal value when the difference is between -\pi/2 and \pi/2. Such subtraction identities are instrumental in constructing chains of arctangents that simplify algebraic expressions. These identities generalize to sums and differences of multiple arctangents by iterative application, leading to expressions like \arctan x + \arctan y - \arctan z = \arctan\left( \frac{x + y - z + xyz}{1 - xy + xz + yz} \right) or telescoping forms in specific cases. Conditions on the products of arguments ensure the result stays within the principal branch; for instance, in sums \sum \arctan h(k), adjustments by multiples of \pi may be needed if intermediate products exceed 1 or fall below -1. Central to Machin-like formulas is the relation \arctan 1 = \pi/4, which follows directly from the definition since \tan(\pi/4) = 1. Thus, these formulas seek integer linear combinations \sum k_i \arctan r_i = \pi/4, where the tangent of the sum simplifies to 1 through repeated application of the addition and subtraction identities, yielding rational r_i that facilitate series expansions for \pi.

Complex Number Representations

The arctangent function for a real argument x > 0 can be expressed as the imaginary part of the complex logarithm: \arctan x = \operatorname{Im} \left( \log(1 + i x) \right), where i is the imaginary unit and \log denotes the principal branch of the complex logarithm. This representation follows from the argument of the complex number $1 + i x, which lies in the open first quadrant and equals \arctan x. More generally, the principal value of \arctan z for complex z is given by \arctan z = \frac{i}{2} \ln \left( \frac{i + z}{i - z} \right), with the branch cut chosen to exclude the rays where z/i \in (-\infty, -1] \cup [1, \infty). Machin-like formulas, which express \pi/4 as an integer linear combination of arctangents, admit a natural interpretation in the complex plane through products of such logarithmic terms. Specifically, a formula \pi/4 = \sum_k a_k \arctan(b_k^{-1}) corresponds to \pi/4 = \operatorname{Im} \left( \log \left( \prod_k (1 + i b_k^{-1})^{a_k} \right) \right), or equivalently, after clearing denominators, \pi/4 = \operatorname{Im} \left( \log \left( \prod_k (b_k + i)^{a_k} \right) \right). The imaginary part yields \pi/4 when the argument of the product is \pi/4, meaning the product is a positive real multiple of $1 + i. This geometric condition ensures the total phase aligns with the direction of the line \operatorname{Re} z = \operatorname{Im} z in the complex plane. The summation of individual arguments in the product reflects the additive property of arguments under complex multiplication: \arg(\prod z_k) = \sum \arg(z_k) \pmod{2\pi}. For the formula to hold without branch crossings, the cumulative argument must equal \pi/4 modulo $2\pi, typically achieved by configurations where the terms combine to traverse a total angle of \pi/4 from the positive real axis. This principle, rooted in the geometry of the complex plane, underpins the validity of the representation and distinguishes it from purely real trigonometric identities. Gaussian integers—complex numbers of the form a + b i with a, b \in \mathbb{Z}—play a crucial role in constructing such representations with rational tangent arguments, ensuring b_k are integers for \arctan(1/b_k). The ring of Gaussian integers possesses unique prime factorization up to units ($1, -1, i, -i), analogous to the integers, which facilitates systematic generation of products. For instance, factoring Gaussian primes allows balancing exponents so that \prod (b_k + i)^{a_k} = r (1 + i) for some positive real r, yielding the desired argument \pi/4. This algebraic structure guarantees the tangents remain rational while enabling efficient combinations for \pi computation.

Derivation Methods

Complex Logarithm Approach

The complex logarithm approach to deriving Machin-like formulas leverages the relationship between the arctangent function and the argument of complex numbers. Specifically, for a positive real number x, \arctan(x) = \arg(1 + i x), where \arg denotes the principal argument, and i is the imaginary unit. This follows from the definition of the complex logarithm, where \log(z) = \ln|z| + i \arg(z), so the imaginary part \Im(\log(z)) = \arg(z). Thus, a linear combination \sum_k c_k \arctan(1/t_k) = \pi/4 for integers t_k > 0 and rational coefficients c_k (typically integers) corresponds to \arg\left( \prod_k (1 + i / t_k)^{c_k} \right) = \pi/4, provided the total argument lies within the principal range (-\pi/2, \pi/2) to avoid branch cut issues. To find such formulas, the product is expanded in the complex plane, aiming for the result to equal a positive real multiple of e^{i \pi/4} = (1 + i)/\sqrt{2}, ensuring the argument is exactly \pi/4 and the magnitude adjustment does not affect the phase. Clearing denominators transforms the terms into Gaussian integers: $1 + i / t_k = (t_k + i)/t_k, so the product becomes \prod_k [(t_k + i)^{c_k} / t_k^{c_k}]. The goal is to solve for integers where the numerator product \prod_k (t_k + i)^{c_k} equals a real scalar times (1 + i)^m for some integer m, often normalized to match $1 + i or i up to scaling. This multiplication is performed directly in the complex plane, verifying that the real and imaginary parts satisfy the desired ratio (e.g., equal for \arg = \pi/4). The process relies on the unique factorization in the ring of Gaussian integers \mathbb{Z}, allowing systematic search for factors that align the arguments correctly. A classic example is the two-term Machin formula \pi/4 = 4 \arctan(1/5) - \arctan(1/239), derived by considering the product (1 + i/5)^4 (1 - i/239), where the negative sign accounts for the subtraction via \arg(1 - i/239) = -\arg(1 + i/239). Scaling to Gaussian integers yields (5 + i)^4 (239 - i) = 114244 (1 + i), as direct computation confirms: first, (5 + i)^2 = 24 + 10i, then (24 + 10i)^2 = 476 + 480i, and multiplying by (239 - i) gives [476 \times 239 + 480] + [480 \times 239 - 476]i = 114244 + 114244i = 114244 (1 + i), with \arg(1 + i) = \pi/4. This equality ensures the arguments sum correctly to \pi/4. Key challenges in this approach include navigating the multi-valued nature of the complex logarithm, particularly avoiding branch cuts where the argument jumps by $2\pi. The principal branch restricts \arg to (-\pi, \pi], so the combined product must not wind around the origin, keeping the total phase within bounds compatible with \pi/4. Additionally, ensuring the coefficients c_k are integers requires solving Diophantine equations in Gaussian integers, which can be computationally intensive for multi-term formulas, though the method guarantees exact identities when solutions exist.

Algebraic and Iterative Techniques

Algebraic methods for deriving Machin-like formulas rely on the tangent addition theorem to express the tangent of a linear combination of arctangents as a rational function of the arguments b_k. Specifically, consider the equation \tan\left( \sum_k a_k \arctan(b_k) \right) = 1, where \tan(\pi/4) = 1 and the a_k are small integers. Applying the tangent addition formula iteratively yields a rational expression set equal to 1, which rearranges to a polynomial equation with integer coefficients in the variables b_k, forming a Diophantine equation. Solutions in positive rationals b_k < 1 correspond to valid formulas, often requiring the b_k to be fractions with small denominators for computational efficiency. For two-term formulas of the form a \arctan(b) - c \arctan(d) = \pi/4, the method simplifies to solving a specific polynomial Diophantine equation derived from the subtraction formula \tan(\alpha - \beta) = (\tan \alpha - \tan \beta)/(1 + \tan \alpha \tan \beta). Starting with a base angle like \theta = \arctan(1/5), repeated application of the double-angle formula \tan(2\theta) = 2\tan\theta / (1 - \tan^2\theta) gives \tan(4\theta) = 120/119. Then, \tan(\pi/4 - 4\theta) = (1 - 120/119)/(1 + 120/119) = -1/239, yielding Machin's formula \pi/4 = 4\arctan(1/5) - \arctan(1/239). More general solutions involve equations like x^2 + 2^a = y^n for parametric families, where sporadic and infinite classes of integer solutions generate distinct formulas. Iterative approaches build upon this by recursively combining known formulas using the tangent addition theorem to generate new ones with potentially lower Lehmer measure. Starting from simple identities like \arctan(1/2) + \arctan(1/3) = \pi/4, the addition formula produces a new rational tangent value, which can be adjusted or combined further to approximate \pi/4 more efficiently. For instance, combining two existing two-term formulas via addition yields a multi-term formula where the resulting tangent expression equals 1 after clearing denominators, reducing the overall measure without increasing term count excessively. This recursive process leverages trigonometric identities from arctangent sums to explore larger sets systematically. Computational enumeration enhances these techniques by employing search algorithms to solve the associated Diophantine equations for minimal solutions. Methods such as backtracking or breadth-first search systematically test small integer values for the a_k and b_k, verifying when the polynomial evaluates to zero while bounding the search space by measure or denominator size. Advanced methods include constrained PSLQ (Partial Sum of Least Squares) searches to efficiently find integer relations for arctangent sums, enabling discovery of high-efficiency multi-term formulas. As of 2025, this has yielded new records in Lehmer measure. Modern resources, like the GitHub machin repository and associated website machin-like.org, catalog thousands of known formulas for reference and study.

Evaluation Metrics

Lehmer's Measure

Lehmer's measure, denoted as e, is a metric designed to evaluate the quality of Machin-like formulas by estimating the bit length required for their computational implementation. It is defined as e = \sum_k \frac{1}{\log_{10} b_k}, where the Machin-like formula takes the form \pi/4 = \sum_k a_k \arctan(1/b_k) with integer coefficients a_k and positive integers b_k > 0 (summing over distinct terms, disregarding coefficients). This measure captures the aggregate size of the arguments in logarithmic terms, providing a proxy for the memory and arithmetic overhead involved in evaluating the formula. The primary purpose of Lehmer's measure is to quantify the overall efficiency of a Machin-like formula in terms of computational resources. A lower value of e suggests that the formula requires fewer arithmetic operations to achieve high-precision approximations of \pi, as it reflects reduced complexity in handling the numerical values during series expansion and summation. This makes it particularly useful for comparing formulas in contexts where bit-level operations dominate the runtime, such as early digital computations or resource-constrained environments. By focusing on the inverse logarithmic scale of the arguments, the measure balances the impact of multiple terms against the magnitude of individual components. Historically, Lehmer's measure was proposed by Derrick Henry Lehmer in 1938 as a systematic tool for comparing the relative merits of various Machin-like formulas beyond ad hoc assessments. Prior to this, evaluations often relied on qualitative judgments or trial computations, but Lehmer's approach introduced a quantitative framework that facilitated objective analysis and discovery of superior identities. This contribution built on earlier work in arctangent relations and has since become a standard benchmark in the study of such formulas. For example, applying the measure to Machin's classic formula \pi/4 = 4 \arctan(1/5) - \arctan(1/239) yields e \approx 1.851, highlighting its favorable efficiency. In contrast, the single-term formula \pi/4 = \arctan(1) has e = \infty effectively, due to its poor convergence despite minimal numerical size, underscoring how Lehmer's measure favors formulas with larger b_k that enable practical high-precision calculations. Despite its utility, Lehmer's measure has notable limitations. It disregards the coefficients a_k, treating terms without multiplicity and thus overlooking potential added work from larger |a_k|. Additionally, it overlooks the signs of the coefficients, ignoring potential cancellations that could affect numerical stability. Furthermore, developed in an era of mechanical and early electronic computing, it does not incorporate modern hardware optimizations such as parallel processing, fast Fourier transforms for series summation, or specialized arithmetic units, which can dramatically alter the effective cost of evaluation in contemporary settings.

Convergence and Term Count Analysis

The convergence of Machin-like formulas in approximating π depends significantly on the number of terms in the linear combination of arctangent functions. Two-term formulas, such as Machin's original \pi/4 = 4\arctan(1/5) - \arctan(1/239), exhibit a convergence rate where the number of terms required across the series scales linearly with the desired number of decimal digits d, specifically requiring approximately O(d) total terms due to the geometric decay of each arctangent series with ratios determined by the arguments. This is a substantial improvement over single-term formulas like the Leibniz series, which converge exponentially slowly, but remains less efficient than optimized multi-term variants for high-precision computations. The size of the arguments, typically expressed as $1/b_k where b_k are positive integers (the denominators), plays a critical role in individual series convergence. Smaller arguments (larger b_k) result in faster convergence for each arctangent series alone, as the geometric ratio $1/b_k^2 is smaller, requiring fewer terms per series to achieve a given precision—roughly O(d / \log b_k) terms for the k-th series. However, in the combined formula, these smaller arguments enable greater cancellation of leading error terms across the weighted sum, leading to an overall faster effective convergence when the coefficients are appropriately chosen. A common framework for comparing convergence efficiency across formulas is the digits-per-term ratio, which quantifies how many decimal digits of π are gained per term evaluated in the series expansions. For two-term formulas, this ratio is typically around 0.5 to 1 digit per term, limited by the moderate size of the denominators. In contrast, multi-term formulas can achieve ratios exceeding 1 digit per term, particularly for very high precision (e.g., billions of digits), by distributing the approximation across more components with progressively larger b_k, as demonstrated in iterative constructions that stabilize the effective measure of complexity. This metric highlights the advantage of multi-term approaches in scenarios demanding extreme precision, where the cumulative benefit outweighs the added complexity. While increasing the number of terms enhances convergence through better error cancellation and higher digits-per-term ratios, it introduces trade-offs in computational setup. Each additional term requires evaluating an extra arctangent series, incurring overhead in coefficient computation and series initialization, which can dominate for low to moderate precision. However, for large d, the reduced number of terms needed per series compensates, minimizing the total evaluations and making multi-term formulas preferable despite the initial cost. This balance is often assessed using Lehmer's measure as a proxy for overall complexity, with lower values favoring multi-term configurations.

Formula Classifications

Two-Term Formulas

Two-term Machin-like formulas express \pi/4 as a linear combination of exactly two arctangent terms: \pi/4 = a \arctan(r_1) + b \arctan(r_2), where a and b are nonzero integers and r_1, r_2 are positive rationals (often reciprocals of integers greater than 1). These formulas arise from the tangent addition formula applied to angles whose tangents are rationals, ensuring the sum equals \pi/4 since \tan(\pi/4) = 1, or equivalently from complex number identities where the argument is \pi/4. All known primitive two-term formulas—those not derivable from simpler instances via angle addition or scaling—are enumerated through computer-assisted searches. As of 2023, exactly 12 primitive pairs are known, comprising 10 sporadic cases and 2 infinite parametric families, confirmed via exhaustive searches using tools like Mathematica and Maple over large parameter ranges (e.g., up to $10^{10}). These searches indicate no additional primitives within practical bounds for pi computation, with properties such as positive or negative coefficients allowing for efficient series convergence via the arctangent Taylor expansion. Key examples illustrate the structure and historical significance of these formulas. John Machin's seminal 1706 formula is \pi/4 = 4 \arctan(1/5) - \arctan(1/239), which enabled the first computation of 100 decimal digits of \pi. Leonhard Euler's 1755 discovery provides \pi/4 = 5 \arctan(1/7) + 2 \arctan(3/79), notable for its smaller coefficients despite the non-reciprocal second argument (a variant fitting the generalized form). Another classic is Hermann's formula, \pi/4 = 2 \arctan(1/2) - \arctan(1/7), though this is technically three-term when considering the double angle; valued for its balance in term magnitudes during historical calculations. These representatives highlight how primitive solutions optimize the trade-off between coefficient size and argument values in the framework.

Multi-Term Formulas

Multi-term Machin-like formulas extend the structure of two-term identities to sums involving three or more arctangent functions, providing greater flexibility for optimizing computational efficiency in evaluating \pi. The general form is given by \frac{\pi}{4} = \sum_{k=1}^n a_k \arctan(r_k), where n \geq 3, the coefficients a_k are nonzero integers (positive or negative), and the r_k are positive rational numbers, often taken as reciprocals of positive integers b_k > 1 to ensure rapid convergence via the arctangent series expansion. These formulas are constructed by chaining simpler two-term Machin-like identities through repeated application of the tangent addition formula, \tan(\alpha + \beta) = \frac{\tan \alpha + \tan \beta}{1 - \tan \alpha \tan \beta}, or by solving higher-degree polynomial equations arising from the condition that the imaginary part of a product of complex numbers equals \pi/4. For example, Gauss's three-term formula, \frac{\pi}{4} = 12 \arctan\left(\frac{1}{18}\right) + 8 \arctan\left(\frac{1}{57}\right) - 5 \arctan\left(\frac{1}{239}\right), results from algebraic manipulation of such polynomials to balance the arguments. A key advantage of multi-term formulas lies in their scalability: as n increases, it becomes possible to achieve a smaller minimal Lehmer measure \mu = \sum_{k=1}^n \frac{1}{\log_{10} b_k}, which quantifies the formula's efficiency by estimating the number of terms needed in the arctangent series for a given precision; lower \mu correlates with fewer total series terms overall. Computational databases catalog formulas with n = 10 or more, enabling ultra-high-precision \pi calculations where the largest b_k remains manageable, thus reducing rounding errors and iteration counts in arbitrary-precision arithmetic. Illustrative examples highlight this scalability. Gauss's formula above has \mu \approx 1.787, while a modern four-term variant achieves \mu \approx 1.586: \frac{\pi}{4} = 44 \arctan\left(\frac{1}{57}\right) + 7 \arctan\left(\frac{1}{239}\right) - 12 \arctan\left(\frac{1}{682}\right) + 24 \arctan\left(\frac{1}{12943}\right). Further extension to ten terms can yield \mu < 1, as demonstrated in systematic searches using iterative reduction techniques.

Notable Examples and Applications

Classic Formulas

One of the earliest and most influential Machin-like formulas was discovered by John Machin in 1706. This formula expresses π/4 as a linear combination of arctangents with rational arguments less than 1 in absolute value, enabling rapid convergence when expanded using the arctangent series: \frac{\pi}{4} = 4 \arctan\left(\frac{1}{5}\right) - \arctan\left(\frac{1}{239}\right). Machin employed this identity, combined with the Gregory-Leibniz series for arctan(x) = ∑ (-1)^n x^{2n+1}/(2n+1), to compute π to 100 decimal places, surpassing previous records. The identity can be verified using the tangent addition formula, confirming that the tangent of the right-hand side equals 1. Another early example, known as Hermann's formula (c. 1706), is: \frac{\pi}{4} = 2 \arctan\left(\frac{1}{2}\right) - \arctan\left(\frac{1}{7}\right). This two-term formula also leverages small arguments for efficient series expansion and exemplifies the general property of Machin-like expressions, where the tangent of the combination equals 1 within the principal range of arctangent. In 1755, Leonhard Euler developed another seminal formula, building on similar arctangent identities: \frac{\pi}{4} = 5 \arctan\left(\frac{1}{7}\right) + 2 \arctan\left(\frac{3}{79}\right). Euler used this relation with an accelerated arctangent series to compute 20 digits of π in under an hour, demonstrating its practical value for hand calculation. The formula's Lehmer measure, which quantifies computational efficiency as λ = ∑ 1 / log_{10} (1 / |r_k| ) where r_k are the distinct arctangent arguments (ignoring coefficients), is approximately 1.887. For comparison, Machin's formula has λ ≈ 1.851. Lower values indicate faster convergence; Euler's is slightly higher than Machin's but allowed for effective acceleration techniques. A simple two-term classic is Hutton's formula from 1776: \frac{\pi}{4} = \arctan\left(\frac{1}{2}\right) + \arctan\left(\frac{1}{3}\right).

Use in Pi Computations

Machin-like formulas played a pivotal role in historical hand computations of π during the 18th century, enabling mathematicians to achieve unprecedented precision through manual arctangent series expansions. For instance, Thomas Fantet de Lagny employed a formula similar to John Machin's to calculate π to 127 decimal places in 1719, of which 112 were correct, marking a significant advancement in decimal expansion at the time. Similarly, Leonhard Euler utilized arctangent-based methods akin to Machin-like formulas to compute π to 39 decimal places (35 correct) in 1755, contributing to extensive pi tables that supported 18th- and 19th-century mathematical and astronomical work. In the 20th century, these formulas transitioned to early electronic computations, powering the first machine-based records of π. The ENIAC computer, in 1949, leveraged a Machin-type formula to compute π to 2,037 decimal places over 70 hours, a feat that revolutionized pi calculation by demonstrating the potential of digital machinery while still relying on classical arctangent identities. This computation, conducted by G. W. Reitwiesner and colleagues, highlighted the efficiency of Machin-like approaches in the nascent era of computing, where hardware limitations favored series with rapid initial convergence over more complex alternatives. Today, Machin-like formulas retain relevance in arbitrary-precision arithmetic libraries for obtaining initial approximations of π up to medium precision levels, such as around 10^6 digits, due to their straightforward implementation and low overhead compared to higher-order series. Although the Chudnovsky algorithm has become dominant for computing billions of digits owing to its superior convergence rate of approximately 14 digits per term, Machin-like methods are often preferred for quicker setups in applications requiring moderate accuracy, such as educational tools or preliminary validations. Their compatibility with binary splitting techniques further enhances efficiency by enabling parallel evaluation of arctangent terms, reducing computational time for series summation in multi-term variants without excessive memory demands.

Recent Developments

New Discovery Algorithms

The discovery of Machin-like formulas traditionally relies on solving Diophantine equations within the ring of Gaussian integers, where the goal is to find integer combinations of arctangents that equal \pi/4. This approach, pioneered by D. H. Lehmer in his 1938 paper, involves expressing the relation as a product of Gaussian integers whose arguments sum appropriately, exploiting the unique prime factorization in \mathbb{Z} to identify viable factors. Lehmer's method systematically derives arccotangent relations by considering the imaginary part of logarithms of complex numbers, leading to formulas like \pi/4 = 4 \cot^{-1}(5) - \cot^{-1}(239). Computationally, this has been extended using backtracking algorithms to enumerate possible coefficients and denominators, iteratively building relations while checking for exact equality to \pi/4. Modern discovery algorithms build on these foundations with more efficient search strategies, such as depth-first search enhanced by pruning mechanisms that use upper bounds on Lehmer's measure to eliminate unpromising branches early. The Lehmer measure, \lambda = \sum_{j=1}^J |m_j| / \log_{10} b_j, where m_j are the coefficients and b_j the denominators, quantifies efficiency, with lower values indicating faster convergence; pruning focuses on paths likely to produce small \lambda values, reducing the exponential complexity of the search space. Additionally, the symmetry inherent in Gaussian integers—arising from the four units $1, -1, i, -i and associate equivalences—allows algorithms to normalize representations and avoid duplicate explorations, streamlining the enumeration of distinct formulas. These techniques, often implemented in programming languages like Python or Go, facilitate targeted searches for multi-term relations. A key advancement in recent algorithms is the integration of the PSLQ (Partial Sum of Least Squares) method, an integer relation algorithm that detects linear dependencies among vectors including \pi and arctangent values. Constrained variants of PSLQ incorporate number-theoretic filters, such as prime factorization norms of denominators, to prioritize candidates with potential low Lehmer measures before full relation detection. For instance, this approach has uncovered new 5- and 6-term formulas achieving record-low measures by iteratively selecting arctangent terms and applying PSLQ to verify relations. Such methods outperform brute-force enumeration by orders of magnitude, enabling discoveries that manual or basic backtracking could not achieve efficiently. Software tools play a crucial role in systematizing these discoveries. The open-source GitHub repository "machin" maintains a comprehensive database of Machin-like formulas, generating the website machin-like.org through scripts that parse, verify, and index submissions in compact notation. This tool supports formula validation via high-precision arithmetic and has compiled over 17,000 entries by aggregating community contributions and programmatic checks. Complementing this, integration with symbolic computation environments like Mathematica allows for automated iteration and reduction of measures, as demonstrated in algorithms that generate multi-term formulas from base relations using Euler-type identities. Post-2010 developments have leveraged parallel computing to conduct exhaustive searches up to Lehmer measures of 20, dramatically expanding known formulas through distributed enumeration of Gaussian integer factorizations and PSLQ runs across multiple cores. These efforts, often utilizing libraries like MPI for inter-process communication, have yielded thousands of new entries in databases, with the machin-like.org collection growing substantially since its inception around 2015. Parallelization not only accelerates verification but also enables broader exploration of high-term formulas, contributing to ongoing refinements in \pi computation efficiency.

Optimized Formulas Since 2020

In recent years, advancements in Machin-like formulas have focused on iterative methods that generate highly efficient two-term variants with reduced Lehmer measures. A 2024 study introduced a recurrent formula for deriving Machin-like expressions starting from an initial arctangent term, enabling rapid convergence through signed adjustments in the series expansion. This approach produces partial two-term approximations, such as truncations of \pi/4 = 8 \arctan(1/10) - \arctan(1/84) - \arctan(1/21342) - \cdots, allowing for fewer terms in high-precision computations compared to classical forms. Complementing these developments, a rational approximation algorithm for two-term Machin-like formulas was proposed in 2024, leveraging binary representations of $1/\pi to compute digits via quadratic convergence without relying on full trigonometric series. This method iteratively refines approximations, doubling the number of accurate digits per step—for instance, yielding over 60 digits per increment at high iterations—thus enhancing efficiency for digit extraction in \pi calculations. Multi-term optimizations have also seen significant progress, with a 2025 application of the constrained PSLQ algorithm uncovering new formulas with record-low Lehmer measures. The method reports a new six-term formula attaining a measure of 1.3291, surpassing prior multi-term efficiencies by minimizing the logarithmic cost of arctangent evaluations. Such formulas prioritize small leading arguments to accelerate series summation in practical \pi computations. For example, an earlier six-term formula from 2004 is \pi/4 = 83 \arctan(1/107) + 17 \arctan(1/1710) - 44 \arctan(1/225443) - 68 \arctan(1/2513489) + 22 \arctan(1/42483057) + 34 \arctan(1/7939642926390344818). A 2025 paper presented an iterative formula for computing \pi and nested radicals with roots of 2, showing how it can generate and approximate two-term Machin-like formulas. This approach facilitates efficient approximations tied to Machin-like structures. In 2024, on Pi Day, Matt Parker and over 400 volunteers performed the largest hand calculation of \pi in a century using a custom six-term Machin-like formula: \pi/4 = 1587 \arctan(1/2852) + 295 \arctan(1/4193) + 593 \arctan(1/4246) + 359 \arctan(1/39307) + 481 \arctan(1/55603) + 625 \arctan(1/211050) - 708 \arctan(1/390112), achieving more than 100 decimal places and demonstrating the practical utility of these formulas. Databases like machin-like.org have expanded their collections of these optimized formulas, incorporating thousands of new entries generated via automated searches since 2020, facilitating broader access to low-measure variants for research and computation.

References

  1. [1]
    Machin-Like Formulas -- from Wolfram MathWorld
    Machin-like formulas have the form mcot^(-1)u+ncot^(-1)v=1/4kpi, where u, v, and k are positive integers and m and n are nonnegative integers.
  2. [2]
    [PDF] How to Calculate pi: Machin's Inverse Tangents
    Aug 19, 2018 · In the end, John Machin used his formula, and a lot of hard work, to calculate π to 100 decimal places, a record for his time. More ...
  3. [3]
    [PDF] Machin's Method of Computing the Digits of π
    Machin's Method of Computing the Digits of π. Here is the identity that goes into Machin's formula for estimating π. π = 4 arctan(1) = 16 arctan(1/5) - 4 ...
  4. [4]
    Three essays on Machin's type formulas - ScienceDirect
    Besides (1), the following are the most classical formulas (3) arctan ( 1 / 2 ) + arctan ( 1 / 3 ) = π / 4 , (4) 2 arctan ( 1 / 2 ) − arctan ( 1 / 7 ) = π / 4 , ...
  5. [5]
    Digits of Pi
    Mar 30, 2009 · Machin's formula became the basis for almost all computations of π for the next two cen- turies. Machin himself computed a hundred digits, and ...
  6. [6]
    John Machin - Biography - MacTutor - University of St Andrews
    John Machin was an English mathematician and astronomer best known for the formulas he invented for calculating π. Thumbnail of John Machin View one larger ...
  7. [7]
    How to Calculate π: Machin's Inverse Tangents, A Mini-Primary ...
    One of the first people to put this technology to work was John Machin (1680–1751), a long-time secretary of the British Royal Society. Machin's work is ...
  8. [8]
    Pi history - MacTutor History of Mathematics - University of St Andrews
    Machin used an improvement to get 100 digits and the following used his methods: 1719: de Lagny found 112 correct digits. 1789: Vega got 126 places and in ...
  9. [9]
    5. Arcus Tangens "4 = aretan 1
    For example, Leonhard Euler in 1755 used the following relation: 7T. 1. 3. "4 = 5 arctan "7 + 2 arctan 79. Euler, PI=1.89. (5.25). Its performance index of 1.89 ...
  10. [10]
    Mathematical Tables
    Volume XI 1957 Nos. 57-60. Mathematical Tables and other. Aids to ... Garcia 106, Lehmer 107, Lehmer 108, Gloden 109, Leech 110, Robinson 111, Leh ...
  11. [11]
    [PDF] COMPUTING PI: - Milefoot
    Apr 12, 2024 · Thomas Fantet de Lagny. 1719. Arctangent series for π/6 ... Machin's Formula, desk calculator. 1120. Levi B. Smith, John Wrench.<|control11|><|separator|>
  12. [12]
    Machin-like formulae
    Machin's formula (M000000001) is a formula for π that was discovered by John Machin in 1706: π = 16 arctan ⁡ ( 1 5 ) − 4 arctan ⁡ ( 1 239 ) There are a huge ...Missing: database | Show results with:database
  13. [13]
    Trigonometric Addition Formulas -- from Wolfram MathWorld
    Angle addition formulas express trigonometric functions of sums of angles alpha+/-beta in terms of functions of alpha and beta.Missing: inverse | Show results with:inverse
  14. [14]
    Inverse Tangent -- from Wolfram MathWorld
    The inverse tangent satisfies the addition formula. tan^(-1)x+tan^(-1)y= (36). for -1<x,y<1 , as well as the more complicated formula. tan^(-1)(1/a)=2tan ...
  15. [15]
    [PDF] Sums of arctangents and some formulas of Ramanujan
    Throughout tan−1 x will always denote the principal value. We make use of the addition formulas for tan−1 x: tan−1 x + tan−1 y = ( tan−1 x+y. 1−xy if ...
  16. [16]
    Gaussian Integers and Arctangent Identities for π
    Jan 31, 2018 · (2009). Gaussian Integers and Arctangent Identities for π. The American Mathematical Monthly: Vol. 116, No. 6, pp. 515-530.
  17. [17]
    [PDF] Gaussian Integers and Arctangent Identities for π
    The factor of 4 in the denominator appears throughout the work of Grave, Gauss, Störmer, and others, both in single- and multi-term identities (for instance, ...Missing: like | Show results with:like
  18. [18]
    (PDF) ON THE DERIVATION OF MACHIN–LIKE ARCTANGENT ...
    John Machin, with his accurate and ready pen, first computed 100 decimal digits of pi in 1706 using his celebrated arctangent identity. Several others ...
  19. [19]
    [PDF] On Machin-like formulas and Gaussian integers - MathsJam
    Gauss's formula is a whole 2% faster for calculating π. Page 8. summary. • The 1-2-3 puzzle is linked to approximations of π. • You can create machin-like.Missing: complex logarithms
  20. [20]
    [PDF] Three essays on Machin's type formulas - arXiv
    Jul 16, 2023 · Abstract. We study three questions related to Machin's type formulas. The first one gives all two terms Machin formulas where both ...
  21. [21]
    GitHub - mscroggs/machin
    ### Summary of Methods for Generating Machin-like Formulas
  22. [22]
  23. [23]
  24. [24]
  25. [25]
    A method to reduce the Lehmer measure in a multi-term Machin-like ...
    Feb 25, 2022 · Here we show how to generate a multi-term Machin-like formula for \pi with a reduced Lehmer measure. The Mathematica codes validating these results are ...
  26. [26]
    [PDF] machin's formula and pi
    α = β + γ, and the original version of this problem seems to be related to Euler's formula for the calculation of Pi. (4) is Machin's formula.
  27. [27]
    [PDF] THE INTRODUCTION OF THE SYMBOL π IN 1706
    completing a proof of John Machin's formula dated 1706, recalling that tan−1(1) = π/4 π = 16 tan−1 1. 5. − 4 tan−1. 1. 239 . Machin evaluated π to 100 ...
  28. [28]
    Homework IX
    (A) p/4 = arctan(1/2) + arctan(1/3) (Hutton, 1776). (B) p/4 = 2 arctan(1/3) + arctan(1/7) (Hutton, 1776). (C) p/4 = 5 arctan(1/7) + 2 arctan(3/79) (Euler, 1755).
  29. [29]
    The constant
    2.4 Machin type formulae ; p. 4. = arctan, 1. 2, +arctan, 1. 5, +arctan, 1. 8, Strassnitzky 1844. (6) ; p. 4. = 12arctan, 1. 18, +8arctan, 1. 57, -5arctan, 1. 239Missing: five- | Show results with:five-
  30. [30]
    Calculating Pi - RF Cafe
    In 1949, the ENIAC computer computed π to 2,037 decimal places in 70 hours using Machin's formula. By 1958, the IBM 704 mainframe extended π to 10,000 ...Missing: like | Show results with:like
  31. [31]
    [PDF] The Life of Pi History and Computation Jonathan M. Borwein, FRSC ...
    Jun 1, 2003 · million digits of Pi, viz, π/4 = 12 arctan (1/18) +8 arctan (1/57)−5 arctan (1/239) in the efficient form π = 864. ∞. ∑ n=0. (n!) 2. 4 n. (2n ...
  32. [32]
    Chudnovsky formula vs. Machin type formulae for calculating π
    Mar 16, 2017 · The Chudnovsky formula far outperforms any Machin-like (or other known) approach at quickly calculating approximations of π.Machin-like formulas for logarithms - MathOverflowπ and rapid series for the inverse tangent - MathOverflowMore results from mathoverflow.net
  33. [33]
    $$\pi$ and its computation through the ages - Free
    John Machin reached 100 decimal places with a fast converging arctan formula which now bares his name. The same year, William Jones (1675-1749) uses the symbol ...
  34. [34]
    On Arccotangent Relations for π - jstor
    THEOREM 2. The measure of the left member of (9) is less than that of the right member if and only if x > 6.6760135.
  35. [35]
    ncw/find_arctan_formulae: Find machin-like arctan formulae using ...
    A Go tool find_arctan_relations that searches for Machin‑style arctan formulas for π by selecting arctan(1/x) terms according to prime‑factor norms and ...Missing: computational breadth- backtracking<|control11|><|separator|>
  36. [36]
    [2403.09654] A Rapidly Converging Machin-like Formula for $π$
    Nov 29, 2023 · We present a simple recurrent formula to generate the Machin-like expression for calculating \pi/4. The method works for any denominator in the starting term.Missing: systematic | Show results with:systematic
  37. [37]
    A Rational Approximation of the Two-Term Machin-like Formula for π
    π 4 = 2 2 − 1 arctan 1 α 2 + arctan 1 μ 1 , 2 = 2 arctan 1 2 − arctan 1 7 . (25). This equation is commonly known as the Hermann's formula ...