Papers
Topics
Authors
Recent
Search
2000 character limit reached

Two-Term Machin-Like Formulas

Updated 12 July 2026
  • Two-Term Machin-Like Formulas are identities that express π/4 as the sum of two arctangent terms with carefully chosen rational parameters, often involving a dyadic coefficient.
  • Key methods include nested-radical parametrization and iterative recurrences that transform complex exponentiation into purely rational computations.
  • Refinements like Lehmer’s measure and continued fraction techniques enable high-precision π evaluation with accelerated convergence and manageable computational steps.

Two-term Machin-like formulas are identities that represent π/4\pi/4 as a sum of two arctangent terms, typically with rational arguments and, in a widely studied family, a dyadic coefficient on one term. A central form is

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,

with u1,ku_{1,k} chosen as an integer and u2,ku_{2,k} obtained as a rational number determined by u1,ku_{1,k} and kk (Abrarov et al., 2021). Research on these formulas has focused on exact derivation from the arctangent addition law, nested-radical and purely rational constructions of the parameters, reduction of Lehmer’s measure, and high-precision evaluation strategies that avoid irrational numbers in the final computation (Abrarov et al., 2017, Abrarov et al., 2017, Abrarov et al., 2020). Later work has extended the subject to classification results, continued-fraction refinements, and rational approximations with squared convergence (Gasull et al., 2023, Abrarov et al., 2024, Farhi, 15 Jan 2026).

1. General algebraic structure

The algebraic basis of a two-term Machin-like formula is the addition law

arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),

together with the doubling identity

2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).

In the standard dyadic family, one sets

x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)

and then chooses yy so that

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,0

Solving gives

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,1

and therefore

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,2

which yields the required identity for π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,3 (Abrarov et al., 2021).

An equivalent route uses complex exponentials. One shows

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,4

or, in a closely related formulation,

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,5

from which the second parameter emerges as a rational number whenever the first one is rational (Abrarov et al., 2021, Abrarov et al., 2017). This complex representation is central in the literature because it converts the analytic condition that the arctangent sum equal π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,6 into an explicit algebraic relation.

The general theory is not restricted to the dyadic coefficient π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,7. A broader two-term setting considers

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,8

with π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,9 and u1,ku_{1,k}0, u1,ku_{1,k}1 (Farhi, 15 Jan 2026). This wider formulation supports later refinement procedures based on continued fractions, while the dyadic family remains the main computationally oriented branch of the subject.

2. Nested-radical parametrization of the first argument

A classical construction of the “large” integer in the dyadic family uses nested radicals. Defining

u1,ku_{1,k}2

one sets

u1,ku_{1,k}3

This provides a closed-form choice of the first integer parameter (Abrarov et al., 2021). Related work also allows the ceiling choice

u1,ku_{1,k}4

in the construction of a two-term identity (Abrarov et al., 2021).

The nested radicals are directly tied to classical trigonometric half-angle structure. In the notation u1,ku_{1,k}5, u1,ku_{1,k}6, one has

u1,ku_{1,k}7

and

u1,ku_{1,k}8

which tends to infinity with u1,ku_{1,k}9 (Abrarov et al., 24 Sep 2025). This explains why the first argument in the arctangent becomes very small as u2,ku_{2,k}0 increases.

The classical Machin formula appears as a small-u2,ku_{2,k}1 instance of this scheme. The computation

u2,ku_{2,k}2

recovers

u2,ku_{2,k}3

(Abrarov et al., 2021). In this way the literature places Machin’s original identity inside a systematic infinite family indexed by u2,ku_{2,k}4.

The nested-radical parametrization is compact, but it requires repeated square roots. Later papers therefore distinguish between the theoretical convenience of the closed form and the practical difficulty of carrying deep surd chains at large u2,ku_{2,k}5 (Abrarov et al., 2021, Abrarov et al., 2020).

3. Iterative determination of the second argument and surd-free updates

Once the first parameter is fixed, the second one can be computed by a short real iteration rather than by direct exponentiation of a complex rational. In one standard formulation, define

u2,ku_{2,k}6

and for u2,ku_{2,k}7 iterate

u2,ku_{2,k}8

Then

u2,ku_{2,k}9

This “u1,ku_{1,k}0-u1,ku_{1,k}1 iteration” produces exactly the rational second parameter that makes the two-term identity valid (Abrarov et al., 2021).

Equivalent recurrences appear throughout the literature. With

u1,ku_{1,k}2

one may iterate

u1,ku_{1,k}3

and again obtain

u1,ku_{1,k}4

(Abrarov et al., 2017). The computational purpose is the same in each version: direct raising of u1,ku_{1,k}5 is avoided.

A further development replaces the nested-radical construction of the first parameter by a purely rational iteration. For large u1,ku_{1,k}6, one may postulate

u1,ku_{1,k}7

The tangent value is then computed by repeated doubling,

u1,ku_{1,k}8

so that the update uses only rational operations and the real function u1,ku_{1,k}9 (Abrarov et al., 2021). The stated computational observation is that in practice only kk0–kk1 nested calls suffice, no matter how large kk2 is.

Another iterative route begins with

kk3

and shows that

kk4

A second application of the addition law yields the compact identity

kk5

or, equivalently,

kk6

(Abrarov et al., 24 Sep 2025). This suggests a structurally different, but still two-term, normalization of the same underlying half-angle mechanism.

4. Lehmer’s measure and convergence behavior

Lehmer introduced a measure for Machin-like formulas,

kk7

to quantify the computational efficiency of

kk8

(Abrarov et al., 2020). In a coefficient-sensitive two-term normalization

kk9

the measure is written as

arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),0

(Gasull et al., 2023). Across these formulations, the common interpretation is that smaller measure corresponds to faster convergence.

A landmark example in the computational branch takes arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),1 and

arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),2

The resulting second parameter is a rational number whose numerator and denominator have arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),3 and arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),4 decimal digits, respectively, and the corresponding measure is reported as

arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),5

For this construction, each additional term in the arctangent series improves arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),6 by about arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),7 correct decimal digits, and the paper describes this as the smallest Lehmer measure ever reported for the Machin-like formulas for arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),8 (Abrarov et al., 2017).

The later theoretical picture is broader. Gasull, Luca, and Varona proved that in the two-term case one can make arctanx+arctany=arctan ⁣(x+y1xy),\arctan x+\arctan y=\arctan\!\Bigl(\frac{x+y}{1-xy}\Bigr),9 through a construction based on convergents to 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).0 and a rational-function mechanism they call the “Machin’s formulas machine” (Gasull et al., 2023). This does not negate the earlier computational record; rather, it shows that the existence theory allows arbitrarily small Lehmer measure, while explicit constructions with practical computational behavior must still address the size and handling of the rational parameters.

The relation between convergence and argument size is also visible in the elementary Maclaurin estimate

2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).1

for small 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).2. Since two-term Machin-like formulas are designed so that both reciprocal arguments are small, increasing 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).3 can greatly accelerate convergence (Abrarov et al., 2017). The computational challenge is that the second rational parameter often grows to enormous size, so asymptotic speed in the series variable does not automatically translate into low wall-clock cost.

5. Numerical evaluation and rational approximations

A major computational issue is that the second argument may be tiny while its rational representation is huge. Direct evaluation of 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).4 by a power series can therefore be slowed by large intermediate numerators and denominators (Abrarov et al., 2017). To address this, the literature applies Newton–Raphson to

2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).5

with update

2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).6

This gives quadratic convergence: each iteration roughly doubles the number of correct digits (Abrarov et al., 2017).

A concrete example takes 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).7 and 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).8. Using the nested-radical prescription, one obtains an explicit rational 2arctanx=arctan ⁣(2x1x2).2\,\arctan x=\arctan\!\Bigl(\frac{2x}{1-x^2}\Bigr).9, starts from a coarse value of x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)0, and then refines x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)1 by Newton–Raphson. The reported sequence improves from about x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)2 correct digits of x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)3 to x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)4 and then to about x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)5 digits in successive iterations (Abrarov et al., 2017). Related work argues that this evaluation strategy establishes the unconditional applicability of Lehmer’s measure in the two-term rational case, because the algorithm never requires exponentiating the giant rational x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)6; the only use of x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)7 is a single subtraction inside a Newton–Raphson step (Abrarov et al., 2020).

A separate line of work replaces both surds and trigonometric function calls by a rational approximation built from the binary expansion of x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)8. In that setting,

x=tan ⁣(2k1arctan(1/u1))x=\tan\!\bigl(2^{k-1}\arctan(1/u_1)\bigr)9

with yy0, is approximated by

yy1

where

yy2

The resulting error satisfies

yy3

and the paper describes this as squared convergence in computing digits of yy4 without any trigonometric functions and surd numbers (Abrarov et al., 2024). This suggests that two-term Machin-like structure can function not only as an exact identity but also as the basis of purely rational approximation algorithms.

6. Refinements, classifications, and later theoretical developments

The two-term theory now includes both classification results and transformation procedures. In the 2-integer setting, Gasull, Luca, and Varona prove that the only solutions of

yy5

with yy6 of the form yy7 or yy8, consist of ten sporadic cases plus two infinite yy9-parameter families (Gasull et al., 2023). The two families are

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,00

and

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,01

This establishes a rare complete classification statement inside the two-term landscape.

The same paper also formulates the “Machin’s formulas machine.” For suitable rational functions π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,02 satisfying

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,03

one obtains infinitely many two-term formulas by choosing parameters so that the resulting arctangent arguments stay inside π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,04 (Gasull et al., 2023). In the special case π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,05, the authors state that the method is quite useful, recovers most known formulas, gives some new ones, and allows one to prove in an easy way that there are two terms Machin formulas with Lehmer measure as small as desired.

A different extension is the refinement process for a general two-term formula

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,06

Setting

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,07

forming the continued fraction π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,08, and defining a decreasing sequence of positive rationals by

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,09

one obtains, recursively,

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,10

and hence a whole sequence of two-term identities

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,11

(Farhi, 15 Jan 2026). Closed forms in terms of the convergents π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,12 of π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,13 are given by

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,14

and

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,15

The associated rational sequence

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,16

converges to π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,17 with geometric decay, and the method is illustrated from Euler’s formula

π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,18

(Farhi, 15 Jan 2026).

These later developments show that two-term Machin-like formulas are not a single isolated family but a broad class of exact identities and approximation schemes. The subject now spans nested radicals, rational recurrences, Newton–Raphson evaluation, continued-fraction refinements, and structural classification, while preserving the defining feature that π4=2k1arctan(1u1,k)+arctan(1u2,k),kZ, k1,\frac{\pi}{4}=2^{k-1}\arctan\left(\frac{1}{u_{1,k}}\right)+\arctan\left(\frac{1}{u_{2,k}}\right),\qquad k\in\mathbb{Z},\ k\ge 1,19 is represented by only two arctangent contributions.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Two-Term Machin-Like Formulas.