Next Article in Journal
Energy-and-Blocking-Aware Routing and Device Assignment in Software-Defined Networking—A MILP and Genetic Algorithm Approach
Previous Article in Journal
Three-Dimensional Model for Bioventing: Mathematical Solution, Calibration and Validation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Iterative Method for Computing π by Argument Reduction of the Tangent Function

by
Sanjar M. Abrarov
1,2,3,*,
Rehan Siddiqui
2,3,4,
Rajinder Kumar Jagpal
2,4 and
Brendan M. Quine
1,3,4
1
Algonquin Radio Observatory, Thoth Technology Inc., Achray Rd., RR6, Pembroke, ON K8A 6W7, Canada
2
Epic College of Technology, 5670 McAdam Rd., Mississauga, ON L4Z 1T2, Canada
3
Department Earth and Space Science and Engineering, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada
4
Department Physics and Astronomy, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada
*
Author to whom correspondence should be addressed.
Math. Comput. Appl. 2024, 29(2), 17; https://doi.org/10.3390/mca29020017
Submission received: 14 December 2023 / Revised: 5 February 2024 / Accepted: 14 February 2024 / Published: 25 February 2024

Abstract

:
In this work, we develop a new iterative method for computing the digits of π by argument reduction of the tangent function. This method combines a modified version of the iterative formula for π with squared convergence that we proposed in a previous work and a leading arctangent term from the Machin-like formula. The computational test we performed shows that algorithmic implementation can provide more than 17 digits of π per increment. Mathematica codes, showing the convergence rate for computing the digits of π , are presented.

1. Introduction

In 1706, English astronomer and mathematician John Machin discovered a formula for π , expressed in terms of two arctangents:
π 4 = 4 arctan 1 5 arctan 1 239 .
By using this formula, he was the first to compute 100 digits of π [1,2,3,4]. Nowadays, identities of the kind
π 4 = j = 1 J α j arctan 1 β j ,
where the coefficients α j and β j are either integers or rational numbers, are named after him as the Machin-like formulas for π .
The Maclaurin series expansion of the arctangent function is given by
arctan x = x x 3 3 ! + x 5 5 ! x 7 7 ! + = n = 0 ( 1 ) n x 2 n + 1 2 n + 1 ,
from which it follows that
arctan ( x ) = x + O ( x 3 ) .
Consequently, we can conclude that the convergence of the Machin-like Formula (2) for π is better when the coefficients β j are larger by their absolute values.
In order to estimate the efficiency of a given Machin-like formula, Lehmer introduced the measure [5,6,7,8,9]:
μ = j = 1 J 1 log 10 | β j | .
A smaller value of μ indicates a higher efficiency of a given Machin-like formula. According to this formula, the measure μ is smaller when the total number of the terms J is lower and the coefficients β j are higher by their absolute values. A more detailed description and the significance of the measure (5) can be found in the literature [6,9].
Although Lehmer’s paper [5] assumes that β j Q , it seems that the measure (5) is applicable only when all values of β j are integers. Otherwise, even if a single value from the set β j represents a quotient, its presence causes complexities in the computation [10], which appear due to the rapidly increasing number of digits in the numerators in summation terms when a series expansion of the arctangent function, like Equations (3), (30) or (31), is used in the computation. That is why it is very desirable to generate the Machin-like formulas for π where β j Z .
The following Machin-like formula [5]
π 4 = 12 arctan 1 18 + 8 arctan 1 57 5 arctan 1 239 ,
discovered by Gauss, has Lehmer’s measure μ 1.78661 . This signifies that this equation is more efficient in computing digits of π since its measure is smaller than the original Machin-like Formula (1) with measure μ 1.85113 .
All coefficients in any Machin-like formula for π satisfy the relation
j = 1 J ( β j + i ) α j ( 1 + i )
implying that the real and imaginary parts of this product must be equal to each other. This relation can be used for validation. For example, there is a simple and elegant proof of the original Machin Formula (1) for π [11]
( 5 + i ) 4 ( 259 + i ) 1 = 2 ( 1 + i ) .
Although several iterative formulas with quadratic, cubic, quartic, quintic and nonic convergences have been discovered [12,13,14,15,16], they require undesirable surd numbers that appear over and over again at each consecutive step of the iteration.
Historically, algorithms based on the Chudnovsky and Machin-like formulas successively broke records in computing the digits of π  [4]. Currently, the Chudnovsky formula, providing linear convergence with 14 to 16 digits of π per increment of the summation terms [1,2,4], appears to be the most efficient.
In 2002, Kanada broke a record by computing more than one trillion decimal digits of π for the first time by using the following self-checking pair (also known as the Störmer–Takano pair) of Machin-like formulas [4,17]
π 4 = 44 arctan 1 57 + 7 arctan 1 239 12 arctan 1 682 + 24 arctan 1 12943
and
π 4 = 12 arctan 1 49 + 32 arctan 1 57 5 arctan 1 239 + 12 arctan 1 110443
with Lehmer’s measures of 1.58604 and 1.7799 , respectively. Although the current record, achieved by using the Chudnovsky formula, exceeds one hundred trillion digits of π [10], application of the Machin-like formulas may be promising to calculate a comparable number of digits due to availability of more advanced and powerful supercomputers then those used by Kanada more than 20 years ago. Furthermore, more Machin-like formulas with smaller Lehmer’s measures have been discovered [18,19,20]. For example, the following two equations
π 4 = 83 arctan 1 107 + 17 arctan 1 1710 22 arctan 1 103697 24 arctan 1 2513489 44 arctan 1 18280007883 + 12 arctan 1 7939642926390344818 + 22 arctan 1 3054211727257704725384731479018
and
π 4 = 83 arctan 1 107 + 17 arctan 1 1710 22 arctan 1 103097 12 arctan 1 1256744 22 arctan 1 9140003941 + 12 arctan 1 3158812219818 + 22 arctan 1 167079344092131066905 ,
may be more efficiently used as a self-checking pair since their Lehmer’s measures of 1.34085 and 1.39524 , respectively, are considerably smaller. Therefore, application of Machin-like formulas with small Lehmer’s measure have colossal potential and can be competitive for computing the digits of the constant π .
Equation (7) was reported by Wetherfield [20]. Equation (8) was obtained from another Wetherfield identity [20]
π 4 = 83 arctan 1 107 + 17 arctan 1 1710 22 arctan 1 103697 12 arctan 2 2513489 22 arctan 2 18280007883 .
by using the identity [21]
arctan 1 z = arctan 1 z + arctan z z 1 + z z , z 0 , 1 .
In our earlier publication [22], we derived the following two-term Machin-like formula
π 4 = 2 k 1 arctan 1 γ + arctan 1 sin 2 k 1 arctan 2 γ γ 2 1 cos 2 k 1 arctan 2 γ γ 2 1 ,
where the constant γ may be conveniently chosen according to a relation [23]
2 k 1 γ π 4 .
The complete proof of the identity (9) is quite lengthy and, therefore, beyond the scope of the present work. However, the detailed derivation of identity (9), which is available in [22], can be briefly outlined as a determination of the value η at a given k and γ in the two-term Machin-like formula of kind
π 4 = 2 k 1 arctan 1 γ + arctan 1 η
and a subsequent reformulation of Equation (11) into Equation (9) with the help of de Moivre’s formula
cos ( x ) + i sin ( x ) n = cos ( n x ) + i sin ( n x ) .
It is not difficult to prove that if the first constant γ of Equation (11) is an integer or a rational number, then the second constant η must also be a rational number. Specifically, when γ is either an integer or a rational number, then from the relation [22]
η = 2 γ + i γ i 2 k 1 i i
it follows that both the real and the imaginary parts of η must be rational numbers. However, from the identity
η = cos 2 k 1 arctan 2 γ γ 2 1 1 sin 2 k 1 arctan 2 γ γ 2 1
it follows that η R since γ R . Consequently, we prove that η is a rational number at γ Q .
It should be noted that the two-term Machin-like formula of kind (11) that we considered in our paper [22] represents a practical interest. Recently, a group of independent researchers has developed a different method for determination of the value of η at given values of k and γ (see Table 2 in [10]). Unlike our iterative method described in [22], their algorithm is built on the basis of the rational functions R j ( n , x ) with a remarkable property (see [10] a for detailed description).
R j ( n , x ) = tan ( n θ + n j / 4 ) , x = tan θ , j N .
Following the same procedure that is described in our work [22], one can also obtain a generalization of identity (9) in the form
π 4 = φ arctan 1 γ + arctan 1 sin φ arctan 2 γ γ 2 1 cos φ arctan 2 γ γ 2 1 .
Consequently, the two-term Machin-like Formula (11) can be generalized as
π 4 = φ arctan 1 γ + arctan 1 η ,
where (compared with Equation (12) above)
η = 2 γ + i γ i φ i i .
Both constants φ and γ in Equation (13) may be chosen conveniently. For example, consider a ratio of 22 / 7 , representing a rough approximation of π . Therefore, we can write
22 28 22 arctan 1 28 π 4 .
Thus, by choosing φ = 22 and γ = 28 , we can show that the ratio
1 sin 22 arctan 2 × 28 28 2 1 cos 22 arctan 2 × 28 28 2 1 = 1744507482180328366854565127 98646395734210062276153190241239
since
η = 2 28 + i 28 i 22 i i = 98646395734210062276153190241239 1744507482180328366854565127 .
Consequently, we obtain the identity that corresponds to the first row of Table 1 in [10]
π 4 = 22 arctan 1 28 + arctan 1744507482180328366854565127 28 digits 98646395734210062276153190241239 32 digits .
We can see now that Equation (9) is just a specific case φ = 2 k 1 of more general form of the two-term Machin-like Formula (13) for π . Therefore, the method described in our paper [22] can also be generalized to generate all two-term Machin-like formulas of kind (14), shown in Table 1 from the work [10] (see first row showing f 32 28 ).
In our recent publication [24], using the two-term Machin-like Formula (9) for π , we found the following iterative formula
θ n = 1 1 θ n 1 + 1 2 k 1 tan 2 k 1 θ n 1 , k 1 ,
where θ 1 = 2 k , such that
π 4 = 2 k 1 lim n 1 θ n .
This equation can be employed to compute digits of the constant π with quadratic convergence (see Mathematica code provided in [24]).
Motivated by recent publications [10,23,25,26] in connection to our works [21,22,24,27,28], we developed a new algorithm based on a modified version of the iterative Formula (15).
Although Equation (15) provides squared convergence in computing digits of π , its direct application results in a slow convergence rate in the intermediate steps of the calculations of the tangent function. This occurs because the argument of the tangent function in this equation tends to the relatively large value of π / 4 as n increases. In this work, we propose a new method that resolves this problem. In particular, we show how Equation (15) can be rearranged and used in combination with arctangent terms of the Machin-like formula for π . Such an approach may be promising for efficient computation of π with more than 17 digits per increment of n in Equation (29) that will be discussed below. To the best of our knowledge, algorithmic implementation based on the combination of iterative and Machin-like formulas for computing digits of π has never been reported.

2. Preliminaries

2.1. Machin-Like Formulas

In our recent work, we derived the following identity [21]
π 4 = 2 k 1 arctan 1 A k + m = 1 M arctan 1 B m , k + arctan 1 B M + 1 , k ,
where
A k = a k 2 a k 1
such that a 0 = 0 and a k = 2 + a k 1 are nested radicals of 2 and
B m , k = 1 + B m 1 , k B m 1 , k B m 1 , k B m 1 , k , m 2
with an initial value B 1 , k that can be computed by substituting A k into Equation (12)
B 1 , k = 2 A k + i A k i 2 k 1 i i .
Equation (17) implies two important rules. First, since the integer B 0 , k is not defined, it follows that at M = 0 , the sum of arctangent functions
m = 1 M arctan 1 B m , k M = 0 = 0 .
Second, if  B M + 1 , k B M + 1 , k = 0 , then no further iteration is required, as the fractional part of the number B M + 1 , k does not exist.
We may compute the coefficient B 1 , k by using Equation (20) at smaller values of the integer k. However, the computation slows down as k increases. To resolve this problem, we proposed a more efficient method of computation based on a two-step iterative formula [22]
u n = u n 1 2 v n 1 2 , v n = 2 u n 1 v n 1 , n = 2 , 3 , 4 , , k
with initial values
u 1 = A k 2 1 A k 2 + 1
and
v 1 = 2 A k A k 2 + 1
leading to
B 1 , k = u k 1 v k .
Equation (22), based on the two-step iteration (21), is more efficient for computation of the constant B 1 , k than Equation (20), since at larger values of the integer k, the rapidly growing exponent 2 k 1 in Equation (20) drastically decelerates the computation.
Consider a few examples. At  k = 2 , we can find that
A 2 = 2 + 2 2 2 = 2
and at M = 0 , the constant B 1 , 2 = 7 according to Equation (22). Since B 1 , 2 B 1 , 2 = 0 , the constants B m , 2 at m 2 do not exist. Consequently, we get the identity
π 4 = 2 2 1 arctan 1 A 2 + arctan 1 B 1 , 2 = 2 arctan 1 2 arctan 1 7
that is commonly known as Hermann’s formula [15].
At k = 3 , we obtain
A 3 = 2 + 2 + 2 2 2 + 2 = 5
and at M = 0 , the coefficient B 1 , 3 = 239 according to Equation (22). Since B 1 , 3 B 1 , 3 = 0 , the constants B m , 3 at m 2 do not exist. Consequently, we end up with the following identity
π 4 = 2 3 1 arctan 1 A 3 + arctan 1 B 1 , 3
representing the original Machin-like Formula (1) for π .
The case k = 4 requires more computations. In particular, we can see that
A 4 = 2 + 2 + 2 + 2 2 2 + 2 + 2 = 10
and at M = 0 , we have
B 1 , 4 = 147153121 1758719 .
Consequently, we can write
π 4 = 2 4 1 arctan 1 A 4 + arctan 1 B 1 , 4 = 8 arctan 1 10 arctan 1758719 147153121 .
Since B 1 , 4 B 1 , 4 0 , the constant B 2 , 4 exists and can be computed according to Equation (19).
Thus, at  M = 1 , this leads to
π 4 = 8 arctan 1 10 arctan 1 84 arctan 579275 12362620883 ,
where
1 84 = 1 B 1 , 4
and
579275 12362620883 = 1 B 2 , 4 .
Again, since B 2 , 4 B 2 , 4 0 , the constant B 3 , 4 can be computed, and at M = 2 , we can derive the following identity
π 4 = 8 arctan 1 10 arctan 1 84 arctan 1 21342 arctan 266167 263843055464261 ,
where
1 21342 = 1 B 2 , 4
and
266167 263843055464261 = 1 B 3 , 4 .
Repeating the same procedure over and over again up to M = 5 , we can finally obtain the following seven-term Machin-like formula
π 4 = 8 arctan 1 10 arctan 1 84 arctan 1 21342 arctan 1 991268848 arctan 1 193018008592515208050 arctan 1 197967899896401851763240424238758988350338 arctan 1 B 6 , 4 ,
where
B 6 , 4 = 117573868168175352930277752844194126767991915008537 018836932014293678271636885792397 .
is also an integer. Therefore, all iterations are completed.
From these examples, we can see that Hermann’s (23), Machin’s (1) and the derived (24) formulas for π belong to the same generic group, since all of them can be constructed from their generalized form (17) at different integers k, equal to 2, 3 and 4, respectively. Further, we will use Equation (24) as an example for computing digits of π .
The following Mathematica code:
  • (* Define long string *)
  • longStr = StringJoin["11757386816817535293027775284419412676",
  • "7991915008537018836932014293678271636885792397"];
  •  
  • coeff = (10 + I)^8*(84 + I)^-1*(21342 + I)^-1*
  • (991268848 + I)^-1*(193018008592515208050 + I)^-1*
  • (197967899896401851763240424238758988350338 + I)^-1*
  • (FromDigits[longStr] + I)^-1;
  •  
  • Re[coeff] == Im[coeff]
  •  
  • validates Equation (24) by returning True. This code applies the product relation (6) for verification.

2.2. Tangent Function

Since the tangent function can be represented as a series expansion
tan ( x ) = n = 1 ( 1 ) n 1 2 2 n ( 2 2 n 1 ) B 2 n ( 2 n ) ! x 2 n 1 = x + x 3 3 + 2 x 5 15 + 17 x 7 315 + 62 x 9 2835 + ,
where B 2 n are the Bernoulli numbers, defined by the contour integral
B n = n ! 2 π i z e z 1 d z z n + 1 ,
it follows that
tan ( x ) = x + O ( x 3 ) .
Consequently, the accuracy of the tangent function improves with decreasing the argument x.
Unfortunately, the series expansion of the tangent function (25) requires the determination of the Bernoulli numbers, which is itself a big challenge [29,30,31,32]. For example, one of the most known formulas for computation of the Bernoulli numbers
B n = m = 0 n 1 m + 1 = 0 m ( 1 ) m n ,
is based on double summation with the binomial coefficients that decelerate the computation.
There are other equations for computation of the tangent function [31,32,33] and one of the efficient techniques to perform computation of the tangent function is the Newton–Raphson iteration (see [27] for more details). In particular, the following iteration formula
s n ( x ) = s n 1 ( x ) 1 + s n 1 2 ( x ) arctan s n 1 ( x ) x
with an initial value that can be taken as
s 1 ( x ) = x ,
can be employed. This iteration leads to
tan ( x ) = lim n s n .
Iteration (27) leads to the quadratic convergence of the tangent function. In practice, however, quadratic convergence can be achieved only if a sufficiently large number of the summation terms are applied in the series expansions like (3), (30) or (31) to approximate the arctangent function. We have already applied the Newton–Raphson iteration (27) to compute the digits of π [27].
As an option, we can also apply the most common equation
tan ( x ) = sin ( x ) cos ( x ) = n = 0 ( 1 ) n x 2 n + 1 ( 2 n + 1 ) ! n = 0 ( 1 ) n x 2 n ( 2 n ) ! ,
where sine and cosine functions in the numerator and denominator are represented as the Maclaurin expansions. Unfortunately, this representation is not optimal for practical application since it requires separate computations of the expansion terms for the sine and cosine functions. However, if we rewrite the tangent function as
tan ( x ) = sin ( x ) cos ( x ) sin ( 2 x ) sin ( 2 x )
and take into account that sin ( 2 x ) = 2 sin ( x ) cos ( x ) , we can obtain the following identity
tan ( x ) = 2 sin 2 ( x ) sin ( 2 x ) .
Although this this representation of the tangent function is not common, its application is significantly advantageous, since each nth term in the expansion
sin ( x ) = x x 3 3 ! + x 5 5 ! x 7 7 ! + ,
can be utilized again just by multiplying 2 2 n + 1 to obtain the expansion for the denominator
sin ( 2 x ) = ( 2 ) x ( 2 3 ) x 3 3 ! + ( 2 5 ) x 5 5 ! ( 2 7 ) x 7 7 ! + .
Such a technique may accelerate computation and reduce memory usage. Thus, we can write the following iterative procedure
p 0 x = 0 ,
q 0 x = 0 ,
r n x = 1 n x 2 n + 1 2 n + 1 ! ,
p n x = p n 1 x + r n 1 x ,
q n x = q n 1 x + 2 2 n 1 r n 1 x ,
leading to
tan ( x ) = lim n 2 p n 2 ( x ) q n ( x ) ,
according to Equation (28).
In this work, we used truncated Equation (29) as an alternative to Equations (25) and (27) since one of our objectives in this work is to develop an algorithm for computing the digits of π as simply as possible and without undesirable surd numbers.

2.3. Arctangent Function

Since in this work we utilize the terms from the Machin-like Formula (17), a series expansion with rapid convergence of the arctangent function should be applied. Based on our empirical results, we can consider two equations with rapid convergence that can be used for implementation. The first equation is Euler’s series expansion [6,34]
arctan ( x ) = n = 0 2 2 n ( n ! ) 2 ( 2 n + 1 ) ! x 2 n + 1 1 + x 2 n + 1 .
The second equation is given by the series expansion [35]
arctan ( x ) = 2 m = 1 M n = 1 1 ( 2 n 1 ) ( 2 m 1 ) 2 n 1 κ n ( x , γ m , M ) κ n 2 ( x , γ m , M ) + λ n 2 ( x γ m , M ) ,
where the expansion coefficients are computed by a two-step iteration such that
κ 1 ( x , t ) = 1 / ( x t ) ,
λ 1 ( x , t ) = 1 ,
κ n ( x , t ) = κ n 1 ( x , t ) 1 1 / ( x t ) 2 + 2 λ n 1 ( x , t ) / ( x t ) ,
λ n ( x , t ) = λ n 1 ( x , t ) 1 1 / ( x t ) 2 2 κ n 1 ( x , t ) / ( x t ) ,
and
γ m , M = m 1 / 2 M .
The derivation of the series expansion (31), shown in our work [35], is based on the Enhanced Midpoint Integration (EMI) formula (see also [22])
0 1 f ( x , t ) d t = 2 m = 1 M n = 0 1 ( 2 M ) 2 n + 1 ( 2 n + 1 ) ! 2 n t 2 n f ( x , t ) t = m 1 / 2 M ,
where we imply that
f ( x , t ) = x 2 1 1 + i x t + 1 1 i x t
since
arctan ( x ) = 0 1 x 1 + x 2 t 2 d t = 0 1 x 2 1 1 + i x t + 1 1 i x t d t .
The series expansion (31) appears to be rapid in convergence. In particular, even at M = 1 , its convergence rate is faster by many orders of the magnitude than that of Euler’s Formula (30) (see [35] for details). Thus, by taking M = 1 , Equation (31) can be conveniently rearranged as
arctan ( x ) = 2 n = 1 1 2 n 1 g n ( x ) g n 2 ( x ) + h n 2 ( x ) ,
where the expansion coefficient can be computed by the following two-step iteration
g n ( x ) = g n 1 ( x ) 1 4 / x 2 + 4 h n 1 ( x ) / x ,
h n ( x ) = h n 1 ( x ) 1 4 / x 2 4 g n 1 ( x ) / x ,
with initial values
g 1 ( x ) = 2 / x ,
h 1 ( x ) = 1 .
Series expansions (30) and (32) are significantly faster in convergence than the Maclaurin series expansion (3). In this work, the truncated series expansion (32) is used. Although a value of integer M that is greater than 1 further improves the convergence rate, it may be preferable to apply Equation (32) rather than its generalization (31), since an increment of M just by 1 increases the number of the terms in series expansion (31) by a factor of 2.

3. Results and Discussion

3.1. Modified Iteration

Changing the variable θ n 1 / σ n in Equation (15) leads to a more convenient form
σ n = σ n 1 + 2 k 1 tan 2 k 1 σ n 1 , k 1 ,
where
σ 1 = 2 k .
Consequently, the constant π can be found by iteration in accordance with Equation (16) such that
π 4 = 2 k 1 lim n σ n .
Comparing the limit (34) with (see [28] for derivation)
π 4 = 2 k 1 arctan 2 a k 1 a k ,
we can obtain an important relation
σ n arctan 2 a k 1 a k , n
or
2 k 1 σ n π 4 , n .
Consequently, the argument of the tangent function in Equation (33) tends to 1 with increasing n.
Since, in Equation (33), the argument of the tangent function tends to 1, the convergence per iteration of n in applied Equation (29) is expected to be extremely slow. Indeed, if the argument of the tangent function is not small enough, then, in accordance with relation (26), we cannot gain a reasonable convergence of the tangent function.
This problem can be effectively resolved by introducing a constant such that
c 1 2 k 1 π 4 .
The value of this constant is close to σ n when n is sufficiently large (see Equation (35)). Therefore, with the help of this constant, we can modify the iteration Formula (33) by using the following procedure
σ 1 = 2 k , δ 1 = c σ 1 , σ 2 = c δ 1 + 2 k 1 tan 2 k 1 ( c δ 1 ) , δ 2 = c σ 2 , σ 3 = c δ 2 + 2 k 1 tan 2 k 1 ( c δ 2 ) , δ 3 = c σ 3 , σ n = c δ n 1 + 2 k 1 tan 2 k 1 ( c δ n 1 ) , δ n = c σ n .
The expression for σ n can be simplified as follows
σ n = c δ n 1 + 2 k 1 tan 2 k 1 ( c δ n 1 ) = c δ n 1 + 2 k 1 tan 2 k 1 c 2 k 1 δ n 1 = c δ n 1 + 2 k 1 tan 2 k 1 c tan 2 k 1 δ n 1 1 + tan 2 k 1 c tan 2 k 1 δ n 1
or
σ n = c δ n 1 + 2 k 1 α tan 2 k 1 δ n 1 1 + α tan 2 k 1 δ n 1
or
σ n = σ n 1 + 2 k 1 α tan 2 k 1 δ n 1 1 + α tan 2 k 1 δ n 1 ,
where α = tan 2 k 1 c . Since δ n is supposed to be a small value, we may expect a reasonable convergence rate in iteration (36) at each increment n in Equation (29).
The tangent function in Equation (36) is represented twice. Therefore, we can define
τ n = tan 2 k 1 δ n
and rewrite this equation in a more simplified form
σ n = σ n 1 + 2 k 1 α τ n 1 1 + α τ n 1 .

3.2. Methodology

In our algorithm, we utilize a modified Equation (37). This yields the iteration based on a set of equations
δ n 1 = c σ n 1 , τ n 1 = tan 2 k 1 δ n 1 , σ n = σ n 1 + 2 k 1 α τ n 1 1 + α τ n 1 .
We can take a few initial terms in the Machin-like Formula (17) as a value to compute the constant c.
Return to Equation (24), corresponding to the case k = 4 . If we take only the first term, then the constant
c = 1 2 k 1 8 arctan 1 10 first term of Equation ( 24 ) = arctan 1 10
is not close enough to π / ( 4 × 2 k 1 ) to compute the digits of π . As a consequence, we cannot achieve a rapid convergence. Specifically, our empirical results show that with constant (39), the set (38) of iteration formulas provides convergence of four to five digits of π per increment of n in Equation (29). However, if we take the first two terms from Equation (24) such that
c = 1 2 k 1 8 arctan 1 10 first term of Equation ( 24 ) arctan 1 84 second term of Equation ( 24 ) = arctan 1 10 1 8 arctan 1 84 ,
then the convergence rate significantly improves, providing ten digits of π per increment.
Consider the following identity [36]
tan ( n x ) = 1 i 1 + i tan ( x ) n 1 i tan ( x ) n 1 + i tan ( x ) n + 1 i tan ( x ) n = 2 i 1 i tan ( x ) n 1 i tan ( x ) n + 1 + i tan ( x ) n i .
This identity can be used for computation of the constant α . Thus, according to identity (41), we have
tan 8 arctan 1 10 = 2 i 1 i / 10 8 1 i / 10 8 + 1 + i / 10 8 i = 74455920 72697201 .
Now, using
tan arctan 1 84 = 1 84
and an elementary trigonometric relation
tan ( x y ) = tan ( x ) tan ( y ) 1 + tan ( x ) tan ( y )
we can find that the constant is
α = tan 8 arctan 1 10 arctan 1 84 = 6181600079 6181020804 .
Once the exact value of the constant α is calculated according to Equation (43), we can use the set of iteration Formula (38) for computing the digits of π . The Mathematica codes and their description are provided in the next section.
Although the convergence rate of 10 digits of π per increment of n in Equation (29) is relatively high, application of the Machin-like Formula (17) may not be efficient at a smaller value of the integer k. In particular, the computation of both arctangents arctan ( 1 / 10 ) and arctan ( 1 / 84 ) is expected to be slow, since the two integers in the argument denominators (10 and 84) are not big enough for rapid convergence in accordance with Equation (4).
Consider another case where k is sufficiently large. We can take, for example, k = 27 . Applying identity (17) together with Equation (22), we can find that [22]
π 4 = 2 27 1 arctan 1 A 27 + arctan 1 B 1 , 27 = 67108864 arctan 1 85445659 arctan 9732933578 4975692799 522 , 185 , 807 digits 2368557598 9903554561 522 , 185 , 816 digits .
Recently, the same equation was derived by Gasull et al. by a different method of computation (see Table 2 in [10] showing the row with f 522 , 185 , 816 522 , 185 , 807 ).
At first glance, it may appear problematic to find the corresponding coefficient α , since at k = 27 , the substitution 2 27 1 = 67108864 into identity (41) results in an expression
α = tan 67108864 arctan 1 85445659 = 2 i 1 i / 85445659 67108864 1 i / 85445659 67108864 + 1 + i / 85445659 67108864 i
that is impossible to compute due to the extremely large value of the exponent. However, application of the two-term Machin-like formula for π of kind (11) gives a big advantage, since the multiplier 2 k 1 is continuously divisible by 2. Thus, using the elementary trigonometric identity
tan ( 2 x ) = 2 tan ( x ) 1 tan 2 ( x )
in the iteration process, we can compute the required constant α . Specifically, in accordance with this identity and due to relation x = tan arctan ( x ) , at  k = 27 , the following iteration formula
λ n ( x ) = 2 λ n 1 ( x ) 1 λ n 1 2 ( x ) ,
with initial value
λ 1 ( x ) = 2 x 1 x 2 ,
yields a rational number
α = λ 27 1 1 85445659 = 1184278804 8037709539 522 , 185 , 816 digits 1184278794 2617464027 522 , 185 , 816 digits = 1.00000000821844790606 ,
in which the integer 85445659 = A 27 is calculated according to Equation (18). It is interesting to note that the number of digits (522,185,816) in this equation is the same as the number of digits in the denominator of Equation (44).
At a larger value of the integer k, it is sufficient to take only the first term (leading term) of the Machin-like formula for π to achieve rapid convergence. In particular, using only the leading term from Equation (44)
67108864 arctan 1 85445659 ,
the set of iteration Formula (38) provides 17 to 18 digits of π per increment of n in Equation (29). The corresponding Mathematica code and its description are discussed in the next section.

4. Mathematica Codes and Description

The Mathematica codes consist of seven cells that can be copied and pasted directly to the Mathematica notebook. The first cell is given by the following code:
  • atanF := {(* ARCTANGENT FUNCTION APPROXIMATION *)
     
    Clear[atan,g,h];
     
    (* Expansion coefficients *)
    g[1,x_] := g[1,x] = 2/x;
    h[1,x_] := h[1,x] = 1;
    g[m_,x_] := g[m,x] = g[m - 1,x]*(1 - 4/x^2) + 4*(h[m - 1,x]/x);
    h[m_,x_] := h[m,x] = h[m - 1,x]*(1 - 4/x^2) - 4*(g[m - 1,x]/x);
     
    (* Arctangent approximation *)
    atan[x_,n_] := atan[x,n] = 2*Sum[(1/(2*m - 1))*(g[m,x]/
     (g[m,x]^2 + h[m,x]^2)),{m,1,n}]};
that defines the two-step iterative method for the arctangent function, based on Equation (32). This function can be invoked by running the command atanF.
The second cell provides the code:
  • tanF:= {(*TANGENT FUNCTION APPROXIMATION*)
     
    Clear[p,q,r,t];
     
    (* Computing coefficients *)
    r[n_,x_] := r[n,x] = (-1)^n*(x^(2*n + 1)/(2*n + 1)!);
    p[0,x_] := p[0,x] = 0;
    q[0, x_] := q[0,x] = 0;
    p[n_,x_] := p[n,x] = p[n - 1,x] + r[n - 1,x];
    q[n_,x_] := q[n,x] = q[n - 1,x] + 2^(2*n - 1)*r[n - 1,x];
     
    (* Tangent approximation *)
    t[x_,n_] := t[x,n] = 2*(p[n,x]^2/q[n,x])};
that defines the iterative method for the tangent function, based on Equation (29). This function can be invoked by running the command tanF.
The code below in the third cell:
  • heading := {Print[Abs[MantissaExponent[Pi - 2^(k + 1)*\[Sigma][1]][[2]]],
     ″ digits of \[Pi] before iteration″];
      Print[″-------------------------------″];
       Print[″Number of terms n″,″ | ″,″Digits of \[Pi]″];
        Print[″-------------------------------″]};
     
    ending:={Print[″-------------------------------″];
     Print[Abs[MantissaExponent[Pi - 2^(k + 1)*\[Sigma][2]][[2]]],
      ″ digits of \[Pi] after iteration″]};
defines the output format that includes the heading and ending parts for intermediate computed data. The header and the ending parts can be invoked by running the commands heading and ending, respectively.
The code in the fourth cell:
  • Clear[k,f,\[Alpha],c,\[Sigma],\[Delta],\[Tau],n];
    (* Computing coefficient alpha *)
    k=4; f[x_,n_] = (2*I*(1 - I*x)^n)/((1 - I*x)^n + (1 + I*x)^n) - I;
    \[Alpha] = f[1/10,2^(k - 1)];
    (* Computing coefficient c *)
    atanF; c = atan[1/10,500];
     
    (* Iteration *)
    \[Sigma][1] = SetPrecision[Floor[Pi*10^100]/10^100,250]/2^(k + 1);
    \[Delta] = c - \[Sigma][1];
    n = 1;
    heading;
    While[n <= 42,
     tanF; \[Tau] = t[2^(k - 1)*\[Delta],n]; \[Sigma][2] =
      SetPrecision[\[Sigma][1] + (1 - (\[Alpha] - \[Tau])/
       (1 + \[Alpha]*\[Tau]))/2^k,5 + 5*n];
        piApp1 = 2^(k + 1)*\[Sigma][2];
         str=If[n < 10,″         | ″,″        | ″];
          If[n <= 5 || n >= 33,
           Print[n,str,Abs[MantissaExponent[Pi - piApp1][[2]]]]];
            If[n==6,Print[″...  COMPUTING  ...″]]; n++];
    ending;
computes the coefficient α according to Equation (41) and coefficient c at k = 4 by taking only the leading (first) term of the Machin-like Formula (24) for π . As we do not require the highest precision at each cycle of computation within the while loop, the precision increases with increasing n in Equation (29). The parameter of the precision is given as 5 + 5 n , where n is the increment in Equation (29), since at n = 1 , the number of correct digits of π is 5 and multiplier 5 is the largest number of digits of π per increment n.
Suppose we know the first 100 digits of π . These digits of π can be extracted from Mathematica by using the following division
10 100 π 10 100 .
Once we know 100 digits of π , we can use the described iteration to double its number.
Running this cell generates the following output:
  • 100 digits of π before iteration
    --------------------------------------
    Number of terms n  | Digits of π
    --------------------------------------
    1            | 5
    2            | 9
    3            | 14
    4            | 19
    5            | 25
    ...   COMPUTING    ...
    33           | 169
    34           | 174
    35           | 179
    36           | 184
    37           | 189
    38           | 194
    39           | 199
    40           | 200
    41           | 200
    42           | 200
    --------------------------------------
    200 digits of π after iteration
that shows the first five and last fifteen cycles. As we can see, each increment of n by one gives four to five digits of π . After 39 cycles, the convergence slows down due to saturation. In particular, after 40th cycle, the number of digits doubles to 200. This saturation occurs since we have reached the limit of squared convergence in the determination of the digits of π .
The code in the fifth cell:
  • Clear[k,f,\[Alpha],c,\[Sigma],\[Delta],\[Tau],n];
    (* Computing coefficient alpha *)
    k=4; f[x_,n_] = (2*I*(1 - I*x)^n)/((1 - I*x)^n + (1 + I*x)^n) - I;
    (* Computing coefficient c *)
    \[Alpha] = f[1/10,2^(k - 1)]; \[Alpha] = (\[Alpha] - 1/84)/(1 + \[Alpha]/84);
    atanF; c = atan[1/10,500] - (1/2^(k - 1))*atan[1/84,500];
     
    (* Iteration *)
    \[Sigma][1] = SetPrecision[piApp1/2^(k + 1),500];
    \[Delta] = c-\[Sigma][1];
    n = 1;
    heading;
    While[n <= 42,
     tanF; \[Tau] = t[2^(k - 1)*\[Delta],n]; \[Sigma][2] =
      SetPrecision[\[Sigma][1] + (1 - (\[Alpha] - \[Tau])/
       (1 + \[Alpha]*\[Tau]))/2^k,12 + 10*n];
        piApp2 = 2^(k + 1)*\[Sigma][2];
         str=If[n < 10,″         | ″,″        | ″];
          If[n <=5 || n >= 33,
           Print[n,str,Abs[MantissaExponent[Pi - piApp2][[2]]]]];
            If[n == 6,Print[″...  COMPUTING   ...″]]; n++];
    ending;
computes the coefficients c and α at k = 4 with the help of Equations (40), (45) and (46). Again, the precision increases with increasing n in Equation (29). The parameter of the precision is given as 12 + 10 n , where n is the increment in Equation (29), since at n = 1 , the number of correct digits of π is 12 and multiplier 10 is the largest number of digits of π per increment n. We can use the 200 already obtained digits of π to double it by iteration.
Running this cell produces the output:
  • 200 digits of π before iteration
    --------------------------------------
    Number of terms n | Digits of π
    --------------------------------------
    1            | 12
    2            | 21
    3            | 31
    4            | 41
    5            | 51
    ...   COMPUTING    ...
    33           | 341
    34           | 351
    35           | 361
    36           | 371
    37           | 381
    38           | 391
    39           | 401
    40           | 402
    41           | 402
    42           | 402
    --------------------------------------
    402 digits of π after iteration
that shows first five and last fifteen cycles. The convergence rate always remains the same, 10 digits per increment of n. After 39 cycles, the convergence slows down. In particular, after the 40th cycle, the number of digits of π doubles to 402. Further cycles do not contribute to increasing the number of digits since again we reached the limit in the determination of the digits of π .
The code in the sixth cell is the most interesting:
  • Clear[k,\[Alpha],c,\[Sigma],\[Delta],\[Tau],n];
    (* Computing coefficient alpha *)
    k = 27; \[Sigma][1] = SetPrecision[piApp2/2^(k + 1),1000];
    (* Computing coefficient c *)
    c = SetPrecision[atan[1/85445659,500],1000];
     
    (* Iteration *)
    \[Alpha] = t[2^(k - 1)*c,500];
    \[Delta] = c - \[Sigma][1];
    n = 1;
    heading;
    While[n <= 46,
     tanF; \[Tau] = t[2^(k - 1)*\[Delta],n]; \[Sigma][2] =
      SetPrecision[\[Sigma][1] + (1 - (\[Alpha] - \[Tau])/
       (1 + \[Alpha]*\[Tau]))/2^k,25 + 18*n]; piApp3 = 2^(k + 1)*\[Sigma][2];
        str=If[n < 10,″         | ″,″        | ″];
         If[n <=5 || n >= 37,
          Print[n,str,Abs[MantissaExponent[Pi - piApp3][[2]]]]];
           If[n == 6,Print[″...  COMPUTING   ...″]]; n++];
    ending;
as it provides an excellent convergence rate at 17 to 18 digits per increment n in Equation (29) at k = 27 . Although the exact value of the rational number α can be used (see Equation (46)), this code does not utilize it since a regular desktop or laptop computer requires a few hours for computation by using Equation (46). However, we can observe a rapid convergence computing this coefficient with tangent and arctangent approximations based on Equations (46) and (32), respectively. The code in this cell utilizes only a leading term of the Machin-like Formula (44) for π . This is possible to achieve since at larger value of k = 27 , the argument 1 / 85445659 in the leading arctangent term becomes small. Consequently, this reduces the value of δ n and improves the convergence rate according to Equation (29).
The precision of this code increases with increasing n in Equation (29). The parameter of the precision is given as 25 + 18 n , where n is the increment in Equation (29), since at n = 1 , the number of correct digits of π is 25 and the multiplier 18 is the largest number of digits of π per increment n. Again, we can use the 402 already obtained digits of π to double it by iteration.
Running this cell produces the output:
  • 402 digits of π before iteration
    --------------------------------------
    Number of terms n | Digits of π
    --------------------------------------
    1            | 25
    2            | 42
    3            | 60
    4            | 78
    5            | 96
    ...   COMPUTING    ...
    37           | 690
    38           | 708
    39           | 726
    40           | 744
    41           | 762
    42           | 780
    43           | 798
    44           | 804
    45           | 804
    46           | 804
    --------------------------------------
    804 digits of π after iteration
that shows first five and last fifteen cycles. After 43 cycles, the convergence slows down. In particular, after the 44th cycle, the number of digits of π doubles to 804. Further cycles do not contribute to the number of digits since we have reached the limit in the determination of the digits of π for squared convergence.
Since the proposed method requires at least the leading term of the Machin-like Formula (44) for π , we have to verify its convergence rate to ensure efficient computation. Thus, at  k = 27 , the corresponding value of the leading term in Equation (44) is
arctan 1 A 27 = arctan 1 85445659 .
An additional cell below is the Mathematica code:
  • Clear[arg,n]
    (* Argument of arctangent *)
    arg=SetPrecision[1/85445659,500];
     
    Print[″Increment of n″,″ | ″,″Correct digits″];
    Print[″---------------------------------″];
    n = 1;
    (* Convergence of arctangent *)
    While[n <= 15,
     str=If[n < 10,″       | ″,″       | ″];
      Print[n,str,
       Abs[MantissaExponent[ArcTan[arg] - atan[arg,n]][[2]]]]; n++];
showing the convergence rate of the arctangent function. This code generates following output:
  • Increment of n | Correct digits
    ------------------------------------
    1          | 24
    2          | 41
    3          | 58
    4          | 74
    5          | 91
    6          | 107
    7          | 124
    8          | 140
    9          | 157
    10         | 173
    11         | 190
    12         | 206
    13         | 223
    14         | 239
    15         | 256
As we can see, the code provides 16 to 17 correct digits of the arctangent function value (47) per increment of n in Equation (32). Furthermore, computing just a single arctangent term greatly minimizes Lehmer’s measure (5). In particular, the value of the measure of the arctangent term (47) is only
μ = 1 log 10 ( 85445659 ) 0.126077 .
The increase of the convergence rate with increasing k is due to a decrease of the argument of the tangent function. These results show that the set of Equation (38) can provide rapid convergence when computing the digits of π .

5. Rational Numbers

There is an alternative method for computing the digits of π . This method is based only on rational numbers and implemented without the iterative Formula (29).
As an example, consider the following approximation
π 4 8 arctan 1 10 arctan 1 84 arctan 1 21342 arctan 1 991268848
that represents the first four terms in Equation (24). This approximation can provide at most 19 decimal digits of π . Consequently, we can define
σ 1 = arctan 1 10 1 8 arctan 1 84 + arctan 1 21342 + arctan 1 991268848 = 0.098174770424681038702605213693
such that
π 4 8 σ 1
according to relation (48).
Using the iterative Formula (45) together with identity (42), we can find the exact value of the tangent as a rational number
tan ( 8 σ 1 ) = 26153940164285810690885 26153940164285810690614
since all arguments of the arctangent terms in approximation (48) are also rational numbers (integer reciprocals). Once the exact value of tangent (49) is known, substituting it into iterative Formula (33) results in
σ 2 = σ 1 + 1 16 1 26153940164285810690885 26153940164285810690614
such that the value 32 σ 2 doubles the number of the decimal digits of π up to 39.
The corresponding Mathematica code:
  • (* Iterative formula (45) *)
    \[Lambda][x_,1] := \[Lambda][x,1] = (2*x)/(1 - x^2);
    \[Lambda][x_,n_] := \[Lambda][x,n] = (2\[Lambda][x,n - 1])/
     (1 - \[Lambda][x,n - 1]^2);
     
    (* Integer k *)
    k = 4;
     
    (* Computation of rational number *)
    rNum = \[Lambda][1/10,k - 1];
    rNum = (rNum - 1/84)/(1 + rNum*1/84);
    rNum = (rNum - 1/21342)/(1 + rNum*1/21342);
    rNum = (rNum - 1/991268848)/(1 + rNum*1/991268848);
     
    (* Before iteration *)
    \[Sigma][1] = N[ArcTan[1/10] - 1/2^(k - 1)*
     (ArcTan[1/84] + ArcTan[1/21342] + ArcTan[1/991268848]),100];
    (* After iteration *)
    \[Sigma][2]=\[Sigma][1] + 1/2^k*(1 - rNum);
     
    Print[MantissaExponent[Pi - 2^(k + 1)*\[Sigma][1]][[2]]//Abs,
     ″ digits of \[Pi] before iteration″];
    Print[MantissaExponent[Pi - 2^(k + 1)*\[Sigma][2]][[2]]//Abs,
     ″ digits of \[Pi] after iteration″];
produces the following output:
  • 19 digits of π before iteration
    39 digits of π after iteration
showing number of digits of π before and after a single iteration. This example demonstrates that the combination of iteration Formula (33) with the Machin-like formula for π of type (17) can also be implemented for computing the digits of π without any approximation formula of the tangent function.
Since Equation (24) consists of only seven terms, we should not expect a high accuracy. However, increasing k in Equation (17) leads to a rapid increase in the number of arctangent terms. Therefore, at sufficiently large values of k, we may also achieve the required accuracy for computing the digits of π by using this alternative method based on rational numbers.

6. Conclusions

A new iterative method for computing the digits of π by argument reduction of the tangent function is developed. This method combines a modified iterative formula for π with squared convergence and a leading arctangent term from the Machin-like Formula (17). The computational test shows that algorithmic implementation can provide more than 17 digits of π per increment n in Equation (29). This method requires no surd numbers, and with an arbitrarily large k, there is no upper limit for the convergence rate.

Author Contributions

S.M.A. developed the methodology, wrote the codes and prepared a draft version of the manuscript. R.S., R.K.J. and B.M.Q. verified, reviewed and edited the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Acknowledgments

This work was supported by National Research Council Canada, Thoth Technology Inc., York University and Epic College of Technology. The authors wish to thank the reviewers for their constructive comments and recommendations.

Conflicts of Interest

The authors declare no conflicts of interest. The authors declare that the research was conducted in the absence of any commercial or financial relationships from Thoth Technology Inc. that could be construed as a potential conflict of interest.

References

  1. Beckmann, P. A History of Pi; Golem Press: New York, NY, USA, 1971. [Google Scholar]
  2. Berggren, L.; Borwein, J.; Borwein, P. Pi: A Source Book, 3rd ed.; Springer: New York, NY, USA, 2004. [Google Scholar]
  3. Borwein, J.; Bailey, D. Mathematics by Experiment—Plausible Reasoning in the 21st Century, 2nd ed.; Taylor & Francis Group: Abingdon, UK, 2008. [Google Scholar]
  4. Agarwal, R.P.; Agarwal, H.; Sen, S.K. Birth, growth and computation of pi to ten trillion digits. Adv. Differ. Equ. 2013, 2023, 100. [Google Scholar] [CrossRef]
  5. Lehmer, D.H. On arccotangent relations for π. Am. Math. Mon. 1938, 45, 657–664. [Google Scholar] [CrossRef]
  6. Castellanos, D. The ubiquitous π. Math. Mag. 1998, 61, 67–98. [Google Scholar] [CrossRef]
  7. Abeles, F.F.; Charles, L. Dodgson’s geometric approach to arctangent relations for Pi. Hist. Math. 1993, 20, 151–159. [Google Scholar] [CrossRef]
  8. Tweddle, I. John Machin and Robert Simson on inverse-tangent series for π. Arch. Hist. Exact Sci. 1991, 42, 1–14. Available online: http://www.jstor.org/stable/41133896 (accessed on 13 February 2024). [CrossRef]
  9. Wetherfield, M. The enhancement of Machin’s formula by Todd’s process. Math. Gaz. 1996, 80, 333–344. [Google Scholar] [CrossRef]
  10. Gasull, A.; Luca, F.; Varona, J.L. Three essays on Machin’s type formulas. Indag. Math. 2023, 34, 1373–1396. [Google Scholar] [CrossRef]
  11. Guillera, J. History of the formulas and algorithms for pi. arXiv 2009, arXiv:0807.0872. [Google Scholar]
  12. Borwein, J.M.; Borwein, P.B. Cubic and higher order algorithms for π. Can. Math. Bull. 1984, 27, 436–443. [Google Scholar] [CrossRef]
  13. Borwein, J.M.; Borwein, P.B. More quadratically converging algorithms for π. Math. Comput. 1986, 46, 247–253. [Google Scholar] [CrossRef]
  14. Borwein, J.M.; Borwein, P.B. An explicit cubic iteration for π. BIT Numer. Math. 1986, 26, 123–126. [Google Scholar] [CrossRef]
  15. Borwein, J.M.; Borwein, P.B. Pi and the AGM—A Study in Analytic Number Theory and Computational Complexity; Wiley & Sons Inc.: Hoboken, NJ, USA, 1987. [Google Scholar]
  16. Bailey, D.H.; Borwein, J.M.; Borwein, P.B.; Plouffe, S. The quest for pi. Math. Intell. 1997, 19, 50–57. [Google Scholar] [CrossRef]
  17. Calcut, J.S. Gaussian integers and arctangent identities for π. Am. Math. Mon. 2009, 116, 515–530. Available online: www.jstor.org/stable/40391144 (accessed on 13 February 2024). [CrossRef]
  18. Chien-Lih, H. More Machin-type identities. Math. Gaz. 1997, 81, 120–121. [Google Scholar] [CrossRef]
  19. Nimbran, A.S. On the derivation of Machin-like arctangent identities for computing pi (π). Math. Stud. 2010, 79, 171–186. [Google Scholar]
  20. Wetherfield, M.R.; Chien-Lih, H. Computing Pi: Lists of Machin-Type (Inverse Cotangent) Identities for Pi/4. Available online: http://www.machination.eclipse.co.uk (accessed on 2 December 2023).
  21. Abrarov, S.M.; Jagpal, R.K.; Siddiqui, R.; Quine, B.M. A new form of the Machin-like formula for π by iteration with increasing integers. J. Integer Seq. 2022, 25, 22.4.5. [Google Scholar]
  22. Abrarov, S.M.; Quine, B.M. An iteration procedure for a two-term Machin-like formula for pi with small Lehmer’s measure. arXiv 2017, arXiv:1706.08835. [Google Scholar]
  23. Wolfram Cloud. A Wolfram Notebook Playing with Machin-like Formulas. Available online: https://www.wolframcloud.com/obj/exploration/MachinLike.nb (accessed on 2 December 2023).
  24. Abrarov, S.M.; Jagpal, R.K.; Siddiqui, R.; Quine, B.M. Algorithmic determination of a large integer in the two-term Machin-like formula for pi. Mathematics 2021, 9, 2162. [Google Scholar] [CrossRef]
  25. Campbell, J. Nested radicals obtained via the Wilf–Zeilberger method and related results. Maple Trans. 2023, 3, 16011. [Google Scholar] [CrossRef]
  26. Maritz, M.F. Extracting Pi from Chaos. Coll. Math. J. 2023. [Google Scholar] [CrossRef]
  27. Abrarov, S.M.; Jagpal, R.K.; Siddiqui, R.; Quine, B.M. Unconditional applicability of Lehmer’s measure to the two-term Machin-like formula for π. Math. J. 2021, 23, 1–23. [Google Scholar] [CrossRef]
  28. Abrarov, S.M.; Quine, B.M. A formula for pi involving nested radicals. Ramanujan J. 2018, 46, 657–665. [Google Scholar] [CrossRef]
  29. Knuth, D.E.; Buckholtz, T.J. Computation of tangent, Euler, and Bernoulli numbers. Math. Comp. 1967, 21, 663–688. [Google Scholar] [CrossRef]
  30. Harvey, D. A multimodular algorithm for computing Bernoulli numbers. Math. Comput. 2010, 79, 2361–2370. Available online: https://www.jstor.org/stable/20779149 (accessed on 13 February 2024). [CrossRef]
  31. Bailey, D.H.; Bauschke, H.H.; Borwein, P.; Garvan, F.; Vanderwerff, M.T.J.D.; Wolkowicz, H. Computational and Analytical Mathematics; Springer: New York, NY, USA, 2013. [Google Scholar]
  32. Beebe, N.H.F. The Mathematical Function Computation Handbook; Springer International Publishing AG: New York, NY, USA, 2017. [Google Scholar]
  33. Havil, J. The Irrationals: A Story of the Numbers You Can’t Count On; Princeton University Press: Princeton, NJ, USA, 2012. [Google Scholar]
  34. Chien-Lih, H. An elementary derivation of Euler’s series for the arctangent function. Math. Gaz. 2005, 89, 469–470. [Google Scholar] [CrossRef]
  35. Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A generalized series expansion of the arctangent function based on the enhanced midpoint integration. AppliedMath 2023, 3, 395–405. [Google Scholar] [CrossRef]
  36. Oliver, K.; Prodinger, H. The continued fraction expansion of Gauss’ hypergeometric function and a new application to the tangent function. Trans. R. Soc. S. Afr. 2012, 67, 151–154. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. An Iterative Method for Computing π by Argument Reduction of the Tangent Function. Math. Comput. Appl. 2024, 29, 17. https://doi.org/10.3390/mca29020017

AMA Style

Abrarov SM, Siddiqui R, Jagpal RK, Quine BM. An Iterative Method for Computing π by Argument Reduction of the Tangent Function. Mathematical and Computational Applications. 2024; 29(2):17. https://doi.org/10.3390/mca29020017

Chicago/Turabian Style

Abrarov, Sanjar M., Rehan Siddiqui, Rajinder Kumar Jagpal, and Brendan M. Quine. 2024. "An Iterative Method for Computing π by Argument Reduction of the Tangent Function" Mathematical and Computational Applications 29, no. 2: 17. https://doi.org/10.3390/mca29020017

APA Style

Abrarov, S. M., Siddiqui, R., Jagpal, R. K., & Quine, B. M. (2024). An Iterative Method for Computing π by Argument Reduction of the Tangent Function. Mathematical and Computational Applications, 29(2), 17. https://doi.org/10.3390/mca29020017

Article Metrics

Back to TopTop