HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, Machin-like formulas are a popular technique for computing (the ratio of the circumference to the diameter of a
circle A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre. The distance between any point of the circle and the centre is cal ...
) to a large number of digits. They are generalizations of John Machin's formula from 1706: :\frac = 4 \arctan \frac - \arctan \frac which he used to compute to 100 decimal places.

Reprinted in

Machin-like formulas have the form where c_0 is a positive integer, c_n are signed non-zero
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
s, and a_n and b_n are positive integers such that a_n < b_n. These formulas are used in conjunction with Gregory's series, the
Taylor series In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor ser ...
expansion for
arctangent In mathematics, the inverse trigonometric functions (occasionally also called ''antitrigonometric'', ''cyclometric'', or ''arcus'' functions) are the inverse functions of the trigonometric functions, under suitably restricted domains. Specific ...
:


Derivation

The angle addition formula for arctangent asserts that if -\frac < \arctan \frac + \arctan \frac < \frac. All of the Machin-like formulas can be derived by repeated application of equation . As an example, we show the derivation of Machin's original formula one has: \begin 2 \arctan \frac & = \arctan \frac + \arctan \frac \\ & = \arctan \frac \\ & = \arctan \frac \\ & = \arctan \frac , \end and consequently \begin 4 \arctan \frac & = 2 \arctan \frac + 2 \arctan \frac \\ &= \arctan \frac + \arctan \frac \\ &= \arctan \frac \\ &= \arctan \frac. \end Therefore also \begin 4 \arctan \frac - \frac & = 4 \arctan \frac - \arctan \frac \\ &= 4 \arctan \frac + \arctan \frac \\ &= \arctan \frac + \arctan \frac \\ &= \arctan \frac \\ &= \arctan \frac, \end and so finally \frac = 4 \arctan \frac - \arctan \frac. An insightful way to visualize equation is to picture what happens when two complex numbers are multiplied together: :(b_1 + a_1 \mathrm)\cdot (b_2 + a_2 \mathrm) ::=b_1 b_2 + a_2 b_1 \mathrm + a_1 b_2 \mathrm - a_1 a_2 The angle associated with a complex number (b_n + a_n \mathrm) is given by: :\arctan \frac Thus, in equation , the angle associated with the product is: :\arctan \frac Note that this is the same expression as occurs in equation . Thus equation can be interpreted as saying that multiplying two complex numbers means adding their associated angles (see multiplication of complex numbers). The expression: :c_n \arctan \frac is the angle associated with: :(b_n + a_n \mathrm)^ Equation can be re-written as: :k \cdot (1 + \mathrm)^ = \prod_^N (b_n + a_n \mathrm)^ Here k is an arbitrary constant that accounts for the difference in magnitude between the vectors on the two sides of the equation. The magnitudes can be ignored, only the angles are significant.


Using complex numbers

Other formulas may be generated using complex numbers. For example, the angle of a complex number (a + b \mathrm) is given by \arctan\frac and, when one multiplies complex numbers, one adds their angles. If a=b then \arctan\frac is 45 degrees or \frac radians. This means that if the real part and complex part are equal then the arctangent will equal \frac. Since the arctangent of one has a very slow convergence rate if we find two complex numbers that when multiplied will result in the same real and imaginary part we will have a Machin-like formula. An example is (2 + \mathrm) and (3 + \mathrm). If we multiply these out we will get (5 + 5 \mathrm). Therefore, \arctan\frac + \arctan\frac = \frac. If you want to use complex numbers to show that \frac = 4\arctan\frac - \arctan\frac, you first must know that raising a complex number to a real power k implies multiplying its anomaly (angle) by k, and that the anomaly of the product of two complex numbers is equal to the sum of their anomalies. Since it can by shown, by doing the calculation, that (5+\mathrm)^4 (239-\mathrm) = (1+\mathrm)\cdot 2^2\cdot 13^4 , i.e. that the real and imaginary parts of both sides are equal, and since that equality is equivalent to: 4\arctan\frac - \arctan\frac = \frac, the latter equality is also demonstrated.


Lehmer's measure

One of the most important parameters that characterize computational efficiency of a Machin-like formula is the Lehmer's measure, defined as : = \sum_^N \frac. In order to obtain the Lehmer's measure as small as possible, it is necessary to decrease the ratio of positive integers a_n/b_n in the arctangent arguments and to minimize the number of the terms in the Machin-like formula. Nowadays at a_n=1 the smallest known Lehmer's measure is \lambda\approx 1.51244 due to H. Chien-Lih (1997), whose Machin-like formula is shown
below Below may refer to: *Earth *Ground (disambiguation) *Soil *Floor * Bottom (disambiguation) *Less than *Temperatures below freezing *Hell or underworld People with the surname * Ernst von Below (1863–1955), German World War I general * Fred Belo ...
. It is very common in the Machin-like formulas when all
numerator A fraction (from , "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight-fifths, thre ...
s a_n = 1~.


Two-term formulas

In the special case where the numerator a_n=1, there are exactly four solutions having only two terms. All four were found by John Machin in 1705–1706, but only one of them became widely known when it was published in William Jones's book ''Synopsis Palmariorum Matheseos'', so the other three are often attributed to other mathematicians. These are
Euler Leonhard Euler ( ; ; ; 15 April 170718 September 1783) was a Swiss polymath who was active as a mathematician, physicist, astronomer, logician, geographer, and engineer. He founded the studies of graph theory and topology and made influential ...
's 1737 (known to Machin 1706): :\frac = \arctan\frac + \arctan\frac Hermann's 1706 (known to Machin 1706): :\frac = 2 \arctan\frac - \arctan\frac Hutton's or Vega's (known to Machin 1706): :\frac = 2 \arctan\frac + \arctan\frac and Machin's 1706: :\frac = 4 \arctan\frac - \arctan\frac . In the general case, where the value of a numerator a_n is not restricted, there are infinitely many other solutions. For example: :\frac = 22 \arctan\frac + \arctan\frac or


Example

The adjacent diagram demonstrates the relationship between the arctangents and their areas. From the diagram, we have the following: :\begin (PON)&=(MOF)=\pi\times\frac=\angle MEF=\arctan\\ (POM)&=(NOF)=\arctan\\ (POF)&

(PON)+(NOF)=\arctan+\arctan\\ (MON)&=\arctan\\ (PON)=\arctan&=(POM)+(MON)=\arctan+\arctan , \end
a relation which can also be found by means of
the following calculation within the complex numbers :(3+\mathrm) (7+\mathrm) = 21-1 + (3+7)\mathrm = 10\cdot(2+\mathrm) .


More terms

The 2002 record for digits of , 1,241,100,000,000, was obtained by Yasumasa Kanada of
Tokyo University The University of Tokyo (, abbreviated as in Japanese and UTokyo in English) is a public research university in Bunkyō, Tokyo, Japan. Founded in 1877 as the nation's first modern university by the merger of several pre-westernisation era ins ...
. The calculation was performed on a 64-node
Hitachi () is a Japanese Multinational corporation, multinational Conglomerate (company), conglomerate founded in 1910 and headquartered in Chiyoda, Tokyo. The company is active in various industries, including digital systems, power and renewable ener ...
supercomputer A supercomputer is a type of computer with a high level of performance as compared to a general-purpose computer. The performance of a supercomputer is commonly measured in floating-point operations per second (FLOPS) instead of million instruc ...
with 1 terabyte of main memory, performing 2 trillion operations per second. The following two equations were both used: : \frac = 12 \arctan\frac + 32 \arctan\frac - 5 \arctan\frac + 12 \arctan\frac : Kikuo Takano (1982). : \frac = 44 \arctan\frac + 7 \arctan\frac - 12 \arctan\frac + 24 \arctan\frac : F. C. M. Størmer (1896). Two equations are used so that one can check they both give the same result; it is helpful if the equations used to cross-check the result reuse some of the arctangent arguments (note the reuse of 57 and 239 above), so that the process can be simplified by only computing them once, but not all of them, in order to preserve their independence. Machin-like formulas for can be constructed by finding a set of m integers b_n, n=1..m, where all the prime factorisations of , taken together, use a number of distinct primes \le m, and then using either linear algebra or the LLL basis-reduction algorithm to construct linear combinations of arctangents of \frac. For example, in the Størmer formula above, we have :57^2+1 = 2 \cdot 5^3 \cdot 13 :239^2+1 = 2 \cdot 13^4 :682^2+1 = 5^3 \cdot 61^2 :12943^2+1 = 2 \cdot 5^4 \cdot 13^3 \cdot 61 so four expressions whose factors are powers of only the four primes 2, 5, 13 and 61. In 1993 Jörg Uwe Arndt found the 11-term formula: : \begin \frac =&\; 36462\arctan\frac + 135908\arctan\frac + 274509\arctan\frac\\ & - 39581\arctan\frac + 178477\arctan\frac - 114569\arctan\frac\\ & - 146571\arctan\frac + 61914\arctan\frac - 69044\arctan\frac\\ & - 89431\arctan\frac - 43938\arctan\frac\\ \end using the set of 11 primes \ . Another formula where 10 of the \arctan-arguments are the same as above has been discovered by Hwang Chien-Lih (黃見利) (2004), so it is easier to check they both give the same result: : \begin \frac =&\; 36462\arctan\frac + 26522\arctan\frac + 19275\arctan\frac\\ & - 3119\arctan\frac - 3833\arctan\frac - 5183\arctan\frac\\ & - 37185\arctan\frac - 11010\arctan\frac + 3880\arctan\frac\\ & - 16507\arctan\frac - 7476\arctan\frac\\ \end You will note that these formulas reuse all the same arctangents after the first one. They are constructed by looking for numbers where is divisible only by primes less than 102. The most efficient currently known Machin-like formula for computing is: : \begin \frac =&\; 183\arctan\frac + 32\arctan\frac - 68\arctan\frac\\ & + 12\arctan\frac - 12\arctan\frac - 100\arctan\frac\\ \end :(Hwang Chien-Lih, 1997) where the set of primes is \ . A further refinement is to use "Todd's Process", as described in; this leads to results such as : \begin \frac =&\; 183\arctan\frac + 32\arctan\frac - 68\arctan\frac\\ & + 12\arctan\frac - 100\arctan\frac\\ & - 12\arctan\frac + 12\arctan\frac \\ \end :(Hwang Chien-Lih, 2003) where the large prime 834312889110521 divides the of the last two indices.
M. Wetherfield found 2004 : \begin \frac =&\; 83\arctan\frac + 17\arctan\frac - 22\arctan\frac\\ & - 24\arctan\frac - 44\arctan\frac\\ & + 12\arctan\frac\\ & + 22\arctan\frac .\\ \end On
Pi Day Pi Day is an annual celebration of the mathematical constant (pi). Pi Day is observed on March 14 (the 3rd month) since 3, 1, and 4 are the first three significant figures of , and was first celebrated in the United States. It was founded i ...
2024,
Matt Parker Matthew Thomas Parker (born 22 December 1980) is an Australian recreational mathematics, recreational mathematician, author, comedian, YouTube personality and Science communication, science communicator based in the United Kingdom. His book ''H ...
along with 400 volunteers used the following formula to hand calculate \pi: \begin \frac =&\; 1587\arctan\frac + 295\arctan\frac + 593\arctan\frac \\ & + 359\arctan\frac + 481\arctan\frac + 625\arctan\frac \\ & - 708\arctan\frac \end It was the biggest hand calculation of \pi in a century.


More methods

There are further methods to derive Machin-like formulas for \pi with reciprocals of integers. One is given by the following formula:https://arxiv.org/pdf/2108.07718.pdf (2021) : \frac = 2^ \cdot \arctan \frac + \sum \limits_^M \arctan \frac + \arctan \frac, where :a_0 := 0 and recursively : a_k := \sqrt, \; A_k := \left \lfloor \frac \right \rfloor and : B_ := \frac - \mathrm and recursively : B_ := \frac ~. E.g., for k = 4 and M = 5 we get: :\begin \frac = & \;8 \arctan \frac - \arctan \frac - \arctan \frac\\ & - \arctan \frac - \arctan \frac\\ & - \arctan \frac\\ & - \arctan \frac \end This is verified by the following MuPAD code: z:=(10+I)^8*(84-I)*(21342-I)*(991268848-I)*(193018008592515208050-I)\ *(197967899896401851763240424238758988350338-I)\ *(117573868168175352930277752844194126767991915008537018836932014293678271636885792397-I): Re(z)-Im(z) 0 meaning :\begin z:= & \,(10+\mathrm)^8\cdot(84-\mathrm)\cdot(21342-\mathrm)\cdot(991268848-\mathrm)\cdot(193018008592515208050-\mathrm) \\ & \cdot(197967899896401851763240424238758988350338-\mathrm) \\ & \cdot(117573868168175352930277752844194126767991915008537018836932014293678271636885792397-\mathrm) \\ \;= & \,(1+\mathrm)\cdot \Re(z) ~. \end


Efficiency

For large computations of , the binary splitting algorithm can be used to compute the arctangents much, much more quickly than by adding the terms in the Taylor series naively one at a time. In practical implementations such as y-cruncher, there is a relatively large constant overhead per term plus a time proportional to 1/\log b_n, and a point of diminishing returns appears beyond three or four arctangent terms in the sum; this is why the supercomputer calculation above used only a four-term version. It is not the goal of this section to estimate the actual run time of any given algorithm. Instead, the intention is merely to devise a relative metric by which two algorithms can be compared against each other. Let N_d be the number of digits to which is to be calculated. Let N_t be the number of terms in the
Taylor series In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor ser ...
(see equation ). Let u_n be the amount of time spent on each digit (for each term in the Taylor series). The Taylor series will converge when: :\left(\left(\frac\right)^2\right)^ = 10^ Thus: :N_t = N_d \quad \frac For the first term in the Taylor series, all N_d digits must be processed. In the last term of the Taylor series, however, there's only one digit remaining to be processed. In all of the intervening terms, the number of digits to be processed can be approximated by linear interpolation. Thus the total is given by: : \frac The run time is given by: : \mathtt = \frac Combining equations, the run time is given by: : \mathtt = \frac = \frac Where is a constant that combines all of the other constants. Since this is a relative metric, the value of can be ignored. The total time, across all the terms of equation , is given by: :\mathtt = \sum_^N \frac u_n cannot be modelled accurately without detailed knowledge of the specific software. Regardless, we present one possible model. The software spends most of its time evaluating the Taylor series from equation . The primary loop can be summarized in the following pseudo code: :\mathtt ^2 :\mathtt -^2 :\mathtt (2*n+1) :\mathtt In this particular model, it is assumed that each of these steps takes approximately the same amount of time. Depending on the software used, this may be a very good approximation or it may be a poor one. The unit of time is defined such that one step of the pseudo code corresponds to one unit. To execute the loop, in its entirety, requires four units of time. u_n is defined to be four. Note, however, that if a_n is equal to one, then step one can be skipped. The loop only takes three units of time. u_n is defined to be three. As an example, consider the equation: The following table shows the estimated time for each of the terms: The total time is 0.75467 + 0.54780 + 0.60274 = 1.9052 Compare this with equation . The following table shows the estimated time for each of the terms: The total time is 1.1191 + 0.8672 = 1.9863 The conclusion, based on this particular model, is that equation is slightly faster than equation , regardless of the fact that equation has more terms. This result is typical of the general trend. The dominant factor is the ratio between a_n and b_n. In order to achieve a high ratio, it is necessary to add additional terms. Often, there is a net savings in time.


References


External links

* {{MathWorld, urlname=Machin-LikeFormulas, title=Machin-like formulas
The constant π


at MathPages Pi algorithms