A New Form of the Machin-like Formula for π by Iteration with Increasing Integers

Sanjar M. Abrarov^{∗}, Rehan Siddiqui, Rajinder K. Jagpal Epic College of Technology, 5670 McAdam Rd. Mississauga, Canada, L4Z 1T2

Brendan M. Quine Department of Physics and Astronomy York University 4700 Keele St. Toronto, Canada, M3J 1P3

Abstract

We present a new form of the Machin-like formula for π that can be generated by using iteration. This form of the Machin-like formula may be promising for computation of the constant π due to rapidly increasing integers at each step of the iteration. The computational test we performed shows that, with an integer k ≥ 17, the Lehmer measure remains small and practically does not increase after 18 steps of iteration. Keywords: constant pi; Machin-like formula; Lehmer’s measure

1 Introduction

A remarkable discovery, made in 1706 by English astronomer and mathematician John Machin [?, ?, ?]

\frac{π}{4} = 4 arctan \frac{1}{5} − arctan \frac{1}{239},  (1)

had a great impact on the mathematical society of that time. Specifically, due to relatively rapid convergence, he was the first to calculate 100 digits of π. Nowadays Equation (1) is named in his honor as the Machin formula for π.

The equations of the kind [?]

\frac{π}{4} = ∑_{j=1}^{J} α_{j} arctan \frac{1}{β_{j}} ,  α_{j}, β_{j} ∈ ℝ,  (2)

∗Corresponding author: sanjar@epiccollege.ca

are known to be the Machin-like formulas for π. Historically, some of the earliest formulas are

\frac{π}{4} = arctan \frac{1}{2} + arctan \frac{1}{3},  (3)
\frac{π}{4} = 2 arctan \frac{1}{2} − arctan \frac{1}{7},  (4)
\frac{π}{4} = 2 arctan \frac{1}{3} + arctan \frac{1}{7},  (5)

due to Euler, Hermann, and Hutton, respectively.

Since the Maclaurin series expansion of the arctangent function is given by

arctan x = x − \frac{1}{3}x^{3} + \frac{1}{5}x^{5} − \frac{1}{7}x^{7} + ⋯ = x + O(x^{3}),  (6)

we can see that it is very desirable to get the arguments of the arctangent function as small as possible to improve the convergence rate in the Machin-like formula (2) for π.

In 1938 Lehmer introduced a measure [?, ?, ?, ?]

μ = ∑_{j=1}^{J} \frac{1}{log_{10} |β_{j}|}.  (7)

showing how much computational labor is needed to compute a given Machin-like formula for π. In particular, a given Machin-like formula for π is more efficient if its constants β_{j} are larger by absolute value and if the number J of the terms in Equation (2) is smaller. More detailed description and significance of Lehmer’s measure in the computation of constant π by using the Machin-like formulas can be found in [?].

Application of the Machin-like formulas with small Lehmer measure is one of the most efficient ways to compute digits of π. In particular, in 2002, Kanada computed over one trillion digits of π by using a pair of self-checking Machin-like formulas [?, ?].

In 1997, Chien-Lih published a remarkable six-term Machin-like formula for π [?]

\frac{π}{4} = 183 arctan \frac{1}{239} + 32 arctan \frac{1}{1023} − 68 arctan \frac{1}{5832}
+ 12 arctan \frac{1}{110443} − 12 arctan \frac{1}{4841182} − 100 arctan \frac{1}{6826318}

with relatively small Lehmer measure μ ≈ 1.51244. Later Chien-Lih showed how to reduce Lehmer’s measure even further by generating the two-term Machin-like formulas for π by iteration involving Euler-type identities. However, his method is not simple and requires some algorithmic manipulations at each step of the iteration [?].

Previously, Abrarov et al. [?] developed a new method of generating the two-term Machinlike formulas for π

\frac{π}{4} = 2^{k−1} arctan \frac{1}{β_{1}} + arctan \frac{1}{β_{2}} ,  (8)

where the constant β_{1} can be chosen as a positive integer

β_{1} = ⌊\frac{a_{k}}{\sqrt{2 − a_{k−1}}} ⌋  (9)

such that the nested radicals are defined as a_{k} = \sqrt{2 + a_{k−1}} and a_{0} = 0. Unlike Chien-Lih’s method of generating the two-term Machin-like formulas for π, this method is significantly easier in implementation as it is based on simple two-step iteration (12) below. Therefore, this method is more efficient to reduce the Lehmer measure than the method proposed by Chien-Lih in his work [?].

In general, the constants β_{j} in Equation (2) may not necessarily be integers. In particular, Chien-Lih [?] and Abrarov et al. [?] methods of generating the two-terms Machin-like formulas for π result in quotients with rapidly increasing number of digits in their numerators and denominators. As a consequence, this makes the computation of the arctangent function difficult due to exponentiation with increasing orders. In this work, we propose a method showing how this problem can be effectively resolved by generating a new form of the Machin-like formula for π. This method is based on simple iteration and, due to rapidly increasing values of integers, may be promising for computation of π with rapid convergence.

2 Results and discussion

2.1 Methodology

The first constant β_{1} from Equation (8) that was derived from the following identity [?]

\frac{π}{4} = 2^{k−1} arctan \frac{\sqrt{2 − a_{k−1}}}{a_{k}} ,  k ≥ 1,  k ∈ ℤ.

can be chosen arbitrarily. However, it would be reasonable to choose it in such a way that the ratio

\frac{2^{k−1}}{β_{1}} ≈ \frac{π}{4} .

Therefore, if we imply that β_{1} is an integer, the best choice is given either by Equation (9) or by Equation

β_{1} = ⌈\frac{a_{k}}{\sqrt{2 − a_{k−1}}} ⌉ ,  (10)

based on floor and ceiling functions, respectively. Once the constant β_{1} is chosen, the second constant can be found as [?]

β_{2} = \frac{2}{((β_{1} + i)/(β_{1} − i))^{2^{k−1}} − i} − i.  (11)

It is interesting to note that all four earliest two-term Machin-like formulas (1), (3), (4) and (5) for π can be readily found with help of Equations (8) and (11). In particular, the original Machin formula (1) for π can be obtained by substituting k = 3 into Equations (9), (11) and then (8). The Euler Equation (3) can be obtained by substituting k = 1 and β_{1} = 2 into Equation (11) and then (8). The Hutton Equation (4) can be found by substituting k = 2 into Equations (9), (11) and then (8). Finally, the Hermann Equation (5) can be found by substituting k = 2 into Equations (10), (11) and then (8).

While Equation (11) is useful when integer k is small, its application becomes problematic when k increases. Such a problem arises as a result of rapidly increasing power 2^{k−1} in the denominator of Equation (11). However, as we have shown in publication [?], this problem can be resolved by using simple two-step iteration

\begin{matrix}σ_{n} & = σ_{n−1}^{2} − τ_{n−1}^{2} \\ τ_{n} & = 2σ_{n−1}τ_{n−1} \end{matrix}\} ,  n = \{2, 3, 4, …, k\} ,  (12)

with initial values defined as

σ_{1} = \frac{β_{1}^{2} − 1}{β_{1}^{2} + 1}

and

τ_{1} = \frac{2β_{1}}{β_{1}^{2} + 1}

such that the second constant can be found from the ratio

β_{2} = \frac{σ_{k}}{1 − τ_{k}} .  (13)

There is an identity for the arctangent function

arctan x + arctan y = arctan \frac{x + y}{1 − xy} .

It is not difficult to see that from this identity we get

arctan(x + y) = arctan x + arctan \frac{y}{1 + (x + y)x}.  (14)

Let z ∈ ℝ and z = x + y such that its integer and fractional parts are given by x = ⌊z⌋ and y = frac(z), respectively. Then, using Equation (14) we have

arctan(⌊z⌋ + frac(z)) = arctan⌊z⌋ + arctan \frac{frac(z)}{1 + (⌊z⌋ + frac(z))⌊z⌋}

or

arctan z = arctan⌊z⌋ + arctan \frac{z − ⌊z⌋}{1 + z⌊z⌋}

from which it follows that

arctan \frac{1}{z} = \begin{cases}\frac{π}{2} − arctan \frac{z−⌊z⌋}{1+z⌊z⌋}, & if z ∈ (0, 1); \\ undefined, & if z = 0; \\ arctan \frac{1}{⌊z⌋} − arctan \frac{z−⌊z⌋}{1+z⌊z⌋}, & otherwise, \end{cases}