Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You or Your Team.

Learn More →

A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration

A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration Article A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration 1,2,3, 2,3,4 2,4 1,3,4 Sanjar M. Abrarov *, Rehan Siddiqui , Rajinder Kumar Jagpal and Brendan M. Quine Thoth Technology Inc., Algonquin Radio Observatory, Achray Rd., RR6, Pembroke, ON K8A 6W7, Canada Epic College of Technology, 5670 McAdam Rd., Mississauga, ON L4Z 1T2, Canada Department Earth and Space Science and Engineering, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada Department Physics and Astronomy, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada * Correspondence: sanjar@thothx.com Abstract: In this work, we derive a generalized series expansion of the acrtangent function by using the enhanced midpoint integration (EMI). Algorithmic implementation of the generalized series expansion utilizes a two-step iteration without surd or complex numbers. The computational test we performed reveals that such a generalization improves the accuracy in computation of the arctangent function by many orders of magnitude with increasing integer M, associated with subintervals in the EMI formula. The generalized series expansion may be promising for practical applications. It may be particularly useful in practical tasks, where extensive computations with arbitrary precision floating points are needed. The algorithmic implementation of the generalized series expansion of the arctangent function shows a rapid convergence rate in the computation of digits of p in the Machin-like formulas. Keywords: arctangent function; midpoint integration; iterative algorithm; constant pi MSC: 26A18; 41A10 Citation: Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A 1. Introduction Generalized Series Expansion of the In 2010, Adegoke and Layeni published an interesting relation for derivatives of the Arctangent Function Based on the arctangent function [1]: Enhanced Midpoint Integration. AppliedMath 2023, 3, 395–405. n n1 d (1) (n 1)! 1 arctan(x) = sin n arcsin p , n 2 N . (1) https://doi.org/10.3390/ 2 n/2 dx (1 + x ) 1 + x appliedmath3020020 Using this relation, they discovered a series expansion: Academic Editor: Valery Karachik n/2 Received: 3 February 2023 ¥ 1 x 1 arctan(x) = sin n arcsin p . (2) Revised: 1 March 2023 n 1 + x 1 + x n=1 Accepted: 31 March 2023 Published: 17 April 2023 Equations (1) and (2) have some restrictions. Specifically, when n is even, Equation (1) remains valid only at x 2 [0, ¥), while Equation (2) is valid only at x 2 [0, ¥) for 8n. To resolve this problem, Lampret applied the signum function Copyright: © 2023 by the authors. 1, x < 0, Licensee MDPI, Basel, Switzerland. sgn(x) = This article is an open access article 1, x  0, distributed under the terms and conditions of the Creative Commons and proved that for complete coverage x 2 (¥, ¥), the Equations (1) and (2) can be Attribution (CC BY) license (https:// modified as [2] creativecommons.org/licenses/by/ d (n 1)! 1 n1 4.0/). arctan(x) = sgn(x) sin n arcsin p (3) 2 n/2 dx (1 + x ) 1 + x AppliedMath 2023, 3, 395–405. https://doi.org/10.3390/appliedmath3020020 https://www.mdpi.com/journal/appliedmath AppliedMath 2023, 3 396 and n/2 1 x 1 arctan(x) = sgn(x) sin n arcsin p , (4) n 1 + x 1 + x n=1 respectively. Equations (3) and (4) represent a theoretical interest. In particular, Lampret noticed that, from Equation (3), it follows that [2] (n1)/2 p (1) (n 1)!, n odd, n1 sgn(0)  (n 1)! sin n = (5) 0, n even. Comparing the following relation (see [3] for detailed derivation procedure by induction), n n d (1) (n 1)! 1 1 arctan(x) = (6) n n n dx 2i (x + i) (x i) with Equation (3), we can find the following identity: (n 1)! 1 n1 sgn(x) sin n arcsin p = 2 n/2 (1 + x ) 1 + x (7) (1) (n 1)! 1 1 n n 2i (x + i) (x i) It is not difficult to see that the relation (5) immediately follows from the identity (7). Therefore, relation (5) is just a specific case of the identity (7) occurring at x = 0. Identity (7) can be rewritten in the form 2 n/2 1 (1 + x ) 1 1 n1 sin n arcsin = sgn(x) . n n 2i (x + i) (x i) 1 + x Therefore, from Equation (4), it follows that arctan(x) = " # n/2 2 2 n/2 1 x (1 + x ) 1 1 n1 sgn(x) sgn(x) 2 n n n 1 + x 2i (x + i) (x i) n=1 or ¥ n i x 1 1 arctan(x) = . n n 2 n (x + i) (x i) n=1 As we can see, this series expansion of the arctangent function is just a reformulation of Equation (4) and, since the relation (6) can be rearranged in the form 1 1 2i d = arctan(x), n n n n (x + i) (x i) (1) (n 1)! dx we can express the arctangent function in terms of its derivatives as given by the following equation: ¥ n1 n n (1) x d arctan(x) = arctan(x) n! dx n=1 that leads to ¥ n1 n n (1) x d arctan(x) = 0. n! dx n=0 In our previous publication [4], using the identity (6), we have derived the following series expansion of the arctangent function AppliedMath 2023, 3 397 arctan(x) = ¥ 2m1 2(2mn)1 (1) x 2m 1 2 , å å 2 2m1 (2m 1)(1 + x /4) 2 2n 1 m=1 n=1 from which, at x = 1, we obtain a formula for p expressed in terms of the binomial coefficients ¥ 2m1 n p (1) 2m 1 = 2 å å 2m1 2(2mn)1 4 2n 1 (2m 1)(1 + 1/4) 2 m=1 n=1 or ¥ 2m1 n1 p (4) 2m 1 = . å å 2m1 16 (2m 1)5 2n 1 m=1 n=1 Later, using the same identity (6), we have also derived the following series expansion (see [5,6]): 1 g (x) arctan(x) = 2 , (8) 2 2 2n 1 g (x) + h (x) n n n=1 where the expansion coefficients are computed by a two-step iteration: g (x) = g (x)(1 4/x ) + 4h (x)/x, n n1 n1 h (x) = h (x)(1 4/x ) 4g (x)/x, n n1 n1 such that g (x) = 2/x, h (x) = 1. The series expansion (8) requires no surd or complex numbers in computation and it is rapid in convergence. Many new identities and series expansions related to the arctangent function have been reported [7–15]. This shows that the discovery of new equations related to the arctangent function as well as their applications remains a very interesting topic. As a further development, in this work we derive a generalized series expansion of the arctangent function. Such an approach may be used to improve further convergence in the computation of the arctangent function. Due to rapid convergence without surd and complex numbers in computation, the generalized series expansion may be promising for applications with arbitrary precision floating points [16–23]. Furthermore, it may also be promising in computing digits of p by using the Machin-like formulas [5,6,24–30]. To the best of our knowledge, the generalized series expansion of the arctangent function is new and has never been reported. 2. Derivation The change of the variable x ! xt in Equation (6) results in n n n ¶ (1) (n 1)!x 1 1 arctan(xt) = n n n ¶t 2i (xt + i) (xt i) or n n+1 n+1 ¶ x (1) n!x 1 1 = (9) 2 2 n+1 n+1 ¶t 1 + x t 2i (xt + i) (xt i) since n n1 ¶ ¶ x arctan(xt) = . n n1 2 2 ¶t ¶t 1 + x t AppliedMath 2023, 3 398 The Enhanced Midpoint Integration (EMI) formula is given by (see [31] for derivation and [32] for application) M ¥ n n (1) + 1 d f (t) dt = f (t) , (10) å å n+1 n (2M) (n + 1)! dt m1/2 t= m=1 n=0 where integer M is associated with the subintervals of integration. It is interesting to note that if the upper summation bound associated with variable n is an integer N  0, then we can also use M N n n (1) + 1 d f (t) dt = lim f (t) . å å n+1 n dt m1/2 M!¥ (2M) (n + 1)! t= m=1 n=0 It is easy to show that, excluding all zero terms occurring at odd values of the variable n, Equation (10) can be rewritten in a more convenient form: M ¥ 2n 1 d f (t) dt = 2 f (t) . (11) å å 2n+1 2n (2M) (2n + 1)! dt m1/2 t= m=1 n=0 Equation (11) requires even derivatives of the integrand at the points t = (m 1/2)/M, where m = 1, 2, 3, . . . M. Taking these derivatives manually is extremely tedious. However, with the help of Computer Algebra Systems (CASs) such as Mathematica, Matlab or Maple supporting symbolic programming, the application of Equation (11) may be very efficient in numerical integration. Specifically, such an approach may be especially useful for the numerical integration of the highly oscillating functions. The EMI formula (11) can be used for numerical integration within any interval t 2 (a, b), since the following transformation formula b 1 Z Z f (t) dt = (b a) f ((b a)t + a) dt can be applied to recast the integration interval within t 2 (0, 1). The interested readers can download the MATLAB code based on the integration Formula (11) on the MATLAB Central website [33] (file ID #: 71037). The synopsis and brief instruction on how to use the MATLAB code for numerical integration is also provided in the supplementary readme.pdf file. If an integrand represents a function of two variables f (x, t), then the integration Formula (11) reads as M ¥ 2n 1 ¶ f (x, t) dt = 2 f (x, t) . (12) å å 2n+1 2n (2M) (2n + 1)! ¶t m1/2 t= m=1 n=0 The arctangent function can be given as an integral: arctan(x) = dt. (13) 2 2 1 + x t Consequently, substituting the integrand from Equation (13) x x 1 1 = + 2 2 1 + x t 2 1 + ixt 1 ixt AppliedMath 2023, 3 399 into Equation (12) and using Equation (9) for differentiation, we can find that arctan(x) = " # M ¥ 2n+1 (14) x 1 1 i . å å 2n+1 m1/2 m1/2 2n+1 2n+1 (2M) (2n + 1) (x + i) (x i) m=1 n=0 M M Series expansion (14) is rapid in convergence. However, it requires algebraic manipu- lations with complex numbers. Therefore, it is very desirable to exclude them. This can be achieved by induction based on a two-step iteration, a (x, t) = a (x, t)(1 1/(xt) ) + 2b (x, t)/(xt), n n1 n1 b x, t = b x, t 1 1/ xt 2a x, t / xt , ( ) ( ) ( ) ( ) ( ) n n1 n1 and a (x, t) = 1/(xt), b (x, t) = 1, that transforms Equation (14) into the following series expansion: M ¥ 1 a (x, g ) m,M arctan(x) = 2 , (15) å å 2n1 2 2 (2n 1)(2m 1) a (x, g ) + b (x, g ) n m,M n m,M m=1 n=1 where the argument is m 1/2 g = . m,M Equation (15) is a generalization of Equation (8). Consistency between these two equa- tions can be observed by taking M = 1. In particular, the substitution of M = 1 into series expansion (15) of the arctangent function implies that t = g = 1/2. Consequently, 1,1 from Equation (15) we obtain Equation (8), where the expansion coefficients are g (x) = a (x, g ), 1 1 1,1 h (x) = b (x, g ), 1 1 1,1 g (x) = a (x, g ), n n 1,1 h (x) = b (x, g ). n n 1,1 The following is a Mathematica code that generates the graphs shown in Figure 1 (this code can be copy-pasted directly to the Mathematica notebook): Clear[atan,\[Gamma],\[Alpha],\[Beta]]; (* Equation (15) *) atan[x_,nMax_,M_] := 2*Sum[(1/(2*n - 1))* (\[Alpha][x,\[Gamma][m,M],n]/((2*m - 1)^(2*n - 1)* (\[Alpha][x,\[Gamma][m, M],n]^2 + \[Beta][x, \[Gamma][m,M],n]^2))),{m,1,M},{n,1,nMax}]; (* Argument gamma *) \[Gamma][m_,M_] := \[Gamma][m,M] = N[(m - 1/2)/M,1000]; (* Expansion coefficients *) \[Alpha][x_,t_,1] := \[Alpha][x,t,1] = 1/(x*t); \[Beta][x_,t_,1] := \[Beta][x,t,1] = 1; \[Alpha][x_,t_,n_] := \[Alpha][x,t,n] = \[Alpha][x,t,n - 1]*(1 - 1/(x*t)^2) + 2*(\[Beta][x,t,n - 1]/(x*t)); \[Beta][x_,t_,n_] := \[Beta][x,t,n] = \[Beta][x,t,n - 1]*(1 - 1/(x*t)^2) - AppliedMath 2023, 3 400 2*(\[Alpha][x,t,n - 1]/(x*t)); (* Computing data points *) tabs := {Table[{x,atan[x,10,1]},{x,-20,20,Pi/20}], Table[{x,atan[x,10,2]},{x,-20,20,Pi/20}], Table[{x,atan[x,10,3]},{x,-20,20,Pi/20}]}; Print["Computing, please wait..."]; (* Plotting graphs *) ListPlot[tabs,Joined->True,FrameLabel->{"Parameter x", "Arctangent approximations"},PlotStyle->{Blue,Red,Green}, Frame->True,GridLines->Automatic] Figure 1. Arctangent approximations computed by using series expansion (15) truncated at n = 10. max Blue, red and green curves correspond to M taken to be 1, 2 and 3, respectively. The graphs in Figure 1 are generated by using series expansion (15) truncated at n = 10. Blue, red and green curves correspond to integer M taken to be 1, 2 and 3, max respectively. Consider Figure 2 showing approximation curves of the arctangent function arctan(x) by using Equations (15)–(17) truncated at n = 10. The blue curve corresponding to the max Maclaurin series expansion ¥ n 2n+1 (1) x arctan(x) = , jxj  1, (16) 2n + 1 n=0 diverges beyond 1 and 1 due to the finite radius of convergence. Although one can resolve this issue by using an elementary relation, p 1 arctan , x > 0, 2 x arctan(x) = 0, x = 0, > p 1 arctan , x < 0, 2 x our objective is just to visualize the convergence. The red curve shows the Euler series expansion [22,34,35]: ¥ 2 2n 2n+1 2 n! x ( ) arctan(x) = . (17) n+1 (2n + 1)! 2 (1 + x ) n=0 AppliedMath 2023, 3 401 The green curve illustrates the series expansion (15) at M = 1. The black dashed curve depicts the original arctangent function for comparison. As we can see from Figure 2, even at the smallest M the series expansion (15) provides more rapid convergence as compared to the Euler series expansion (17). Figure 2. Arctangent approximations computed by series expansions (16) (blue), (17) (red) and (15) (green) truncated at n = 10. Integer M in Equation (15) is taken to be equal to 1. The dashed black max curve shows the original artangent function. Figure 3 shows the logarithms of absolute difference log D between the arctangent function and its approximations provided by Equations (15)–(17). All curves are also computed with truncating integer n = 10 in all these equations. The blue and red max curves correspond to Equations (16) and (17) while the green, brown, gray, magenta and black curves correspond to Equation (15) when M is equal to 1, 2, 3, 4 and 5, respectively. As we can see from this figure, the increase of the integer M leads to a rapid decrease of the absolute difference D by many orders of the magnitude. These results indicate that the series expansion (15) provides increasing convergence with increasing M. Figure 3. Logarithms of absolute difference log D between original arctangent function and series expansions (16) (blue), (17) (red) and (15) (green-to-black) truncated at n = 10. Integer M in the max series expansion (15) is taken to be 1 (green), 2 (brown), 3 (gray), 4 (magenta) and 5 (black). AppliedMath 2023, 3 402 3. Applications There are two potentially possible applications of the series expansion (15). In partic- ular, the series expansion (15) can be implemented as a function file for computation of the arctangent for the libraries with arbitrary precision floating points that are required in many fields of mathematical/computational physics and astronomy [16–23]. According to [16,17,22,23], the Maclaurin and Euler series expansions (16) and (17) are used for the arctangent function to provide arbitrary precision in the programming languages. The Maclaurin series expansion (16) diverges at the points of argument 1 and1. This deteriorates the accuracy as argument x approaches 1 by the absolute value. Consequently, its algorithmic implementation requires additional algebraic manipulations to overcome this issue for computations with enhanced precision [16]. As Equation (15) is more rapid in convergence than Equations (16) and (17), its ap- plication may also be efficient to reduce the run-time in many tasks, where extensive computations (without surd or complex numbers) with largely extended precision in floating point numbers are necessary. Moreover, Equation (15) may also provide addi- tional flexibility for users, who can choose the parameter M according to their specific requirements for high-accuracy computation. Another application, where the series expansion (15) can also find its practical imple- mentation, is a computation of digits of the constant p by using the Machin-like formu- las [5,6,24–30]. Since computation of any irrational numbers is itself a big challenge, a rapid con- vergence of the arctangent terms in the Machin-like formulas without undesirable surd numbers can provide a significant advantage. Our empirical results show that even using already known Machin-like formulas with sufficiently large integers in actangent argu- ments, the expansion series (15) at any M  1 can provide more than 17 digits of p at each increment by 1 of the variable n. It is interesting to note that this convergence rate is faster than that provided by the Chudnovsky formula generating 14 to 16 digits of p per increment [24,27]. Currently, the Chudnovsky formula remains the most efficient for computing digits of p due to its rapid convergence and other advantages in algorithmic implementation. Historically, however, there were several records that appeared due to the application of the Machin-like formulas in computing p and, in 2002, an algorithm, developed by Kanada on the basis of a self-checking pair of the Machin-like formulas, beat the record, providing more than a trillion digits of p for the first time [25,27]. Therefore, the discovery of new Machin-like formulas and rapidly convergent series expansions of the arctangent function may be promising for computing digits of the constant p. Consider the following example. Previously, we developed a method and generated a two-term Machin-like formula for p by using a two-step iteration process [5]. 0 1 522,185,807 digits z }| { B C p 1 9732933578 . . . 4975692799 B C = 2 arctan arctan . (18) B C 4 85,445,659 @ 2368557598 . . . 9903554561A | {z } 522,185,816 digits Recently, the same identity has been generated by independent researchers, who developed a different method for generating the two-term Machin-like formulas for p [30]. The method we developed in [5] for generating two-terms Machin-like formulas for p is a complete alternative to the method described in [30] for the formulas of the kind p a c k1 = 2 arctan + arctan , a, b, c, d 2 Z. 4 b d Specifically, all Machin-like formulas for p, shown in the Tables 1 and 2 from [30], can also be generated by using the two-step iterative method that we proposed in our publica- tion [5]. The two-term Machin-like formula (18) for p that is listed in Table 2 in the recent publication [30], is just a specific case occurring at k 1 = 26, a = 1 and b = 85,445,659. AppliedMath 2023, 3 403 Due to the large number of digits in the numerator and denominator in the second arctangent term of Equation (18), we cannot perform computation to observe the corre- sponding convergence rate without a powerful computer. However, this problem can be handled on a typical laptop or desktop computer with the help of the following identity (see derivation in [5]): 0 1 2g k1 1 sin 2 arctan p 1 g 1 k1 @ A = 2 arctan + arctan , (19) 2g 4 g k1 cos 2 arctan g 1 where the constant g may be chosen such that k1 2 p . (20) g 4 Since [32] 2 a k1 k1 = 2 arctan , k  1, 4 a where a = 0 and a = 2 + a , it is convenient to choose g for equation as an integer k+1 k $ % g = p 2 a k1 that satisfies the condition (20). Consequently, at k = 27 we obtain the value 85,445,659 for g that is present in Equation (18) and the difference 2 p = 4.10922 . . . 10 85,445,659 4 is small. More generally, the value of g may be taken as a ratio rather than an integer. For example, we can use [6] $ % m k m g = 10 p 10 2 a k1 or & ' m m g = 10 10 , 2 a k1 where m 2 N . The identity (19) implies that if the argument of the first arctangent function is known, then the argument of the second arctangent function can be found. Thus, if we take g = 85,445,659, then the argument of the second arctangent function in Equation (18) can be calculated accordingly as 2g k1 1 sin 2 arctan g 1 = 4.10922393614549022091 . . . 10 . 2g k1 cos 2 arctan g 1 Once we obtain the argument of the second arctangent with, say, up to 1000 correct decimal digits, we can see that the substitution of both arctangent arguments into Equation (15) at M = 1 gives 15 to 17 correct digits of p per each increment of n. This example demonstrates a rapid convergence rate of the generalized series expansion (15). Therefore, its algorithmic implementation may be promising for rapid and highly accurate computation. AppliedMath 2023, 3 404 4. Conclusions We derived a generalized series expansion (15) of the arctangent function by using the EMI Formula (12). The algorithmic implementation of Equation (15) is based on a two- step iteration without surd or complex numbers. The computational test we performed reveals that such a generalization significantly improves the convergence in computation of the arctangent function with increasing integer M. The generalized series expansion (15) may be promising in practical applications; it may be used for extensive computations with arbitrary precision floating points and its algorithmic implementation shows a high convergence rate in the computation of digits of p in the Machin-like formulas. 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: Not applicable. Acknowledgments: This work is supported by National Research Council Canada, Thoth Technology Inc., York University and Epic College of Technology. Conflicts of Interest: The authors declare no conflict of interest. Abbreviations The following abbreviations are used in this manuscript: EMI Enhanced midpoint integration CAS Computer algebra system References 1. Adegoke K.; Layeni, O. The higher derivatives of the inverse tangent function and rapidly convergent BBP-type formulas for pi. Appl. Math. E-Notes 2010, 10, 70–75. Available online: https://www.math.nthu.edu.tw/~amen/2010/090408-2.pdf (accessed on 26 February 2023). 2. Lampret, V. The higher derivatives of the inverse tangent function revisited. Appl. Math. E-Notes 2011, 11, 224–231. Available online: https://www.math.nthu.edu.tw/~amen/2011/101020-2.pdf (accessed on 26 February 2023). 3. Abrarov, S.M.; Quine, B.M. A Simple Identity for Derivatives of the Arctangent Function. arXiv 2016, arXiv:1605.02843. 4. Abrarov, S.M.; Quine, B.M. A Reformulated Series Expansion of the Arctangent Function. arXiv 2017, arXiv:1701.05098. 5. 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. 6. Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A new form of the Machin-like formula for p by iteration with increasing integers. J. Integer. Seq. 2022, 25, 22.4.5 7. Milgram, M. A new series expansion for integral powers of arctangent. Integ. Trans. Spec. Func. 2006, 17, 531–538. [CrossRef] 8. Sofo, A.; Villacorta, J.C. New identities for the arctangent function. J. Math. Anal. 2012, 3, 1–10. 9. Zhang, W. New formulae of BBP-type with different moduli. J. Math. Anal. Appl. 2013, 398, 46–60. [CrossRef] 10. Qi, F.; Zheng, M.-M. Explicit expressions for a family of the Bell polynomials and applications. Appl. Math. Comput. 2015, 258, 597–607. [CrossRef] 11. Pilato, L.; Fanucci, L.; Saponara, S. Real-time and high-accuracy arctangent computation using CORDIC and fast magnitude estimation. Electronics 2017, 6, 22. [CrossRef] 12. Qiao, Q.-X.; Chen, C.-P. Approximations to inverse tangent function. J. Ineq. Appl. 2018, 141 . [CrossRef] [PubMed] 13. Benammar, M.; Alassi, A.; Gastli, A.; Ben-Brahim, L.; Touat, F. New fast arctangent approximation algorithm for generic real-time embedded applications. Sensors 2019, 19, 5148. [CrossRef] 14. Sofo, A.; Nimbran, A.S. Euler-like sums via powers of log, arctan and arctanh functions. Integ. Trans. Spec. Func. 2020, 31, 966–981. [CrossRef] 15. Kusaka, T.; Tanaka, T. Fast and accurate approximation methods for trigonometric and arctangent calculations for low- performance computers. Electronics 2022, 11, 2285. [CrossRef] 16. Brent, R.P. Fortran multiple-precision arithmetic. ACM Trans. Math. Soft. 1978, 4, 57–70. [CrossRef] AppliedMath 2023, 3 405 17. Brent, R.P. Fast Algorithms for High-Precision Computation of Elementary Functions. Available online: https://maths-people. anu.edu.au/brent/pd/RNC7t4.pdf (accessed on 26 February 2023). 18. de Dinechin, F.; Villard, G. High precision numerical accuracy in physics research. Nucl. Instrum. Methods Phys. Res. A 2006, 559, 207–210. [CrossRef] 19. Bailey, D.H.; Barrio, R.; Borwein, J.M. High-precision computation: Mathematical physics and dynamics. Appl. Math. Comput. 2012, 218, 10106–10121. [CrossRef] 20. Bailey, D.H.; Borwein, J.M. High-precision arithmetic in mathematical physics. Mathematics 2015, 3, 337–367. [CrossRef] 21. Kneusel, R.T. Numbers and Computers; Springer: Cham, Switzerland 2017. 22. Vestermark, H. Fast Trigonometric Functions for Arbitrary Precision Number. Available online: https://www.researchgate.net/ publication/361483599_Fast_Trigonometric_functions_for_Arbitrary_Precision_number?channel=doi&linkId=63fc7e0657495 05945498e6b&showFulltext=true (accessed on 26 February 2023). 23. Johansson, F. Computing Elementary Functions Using Multi-Prime Argument Reduction (LFANT). arXiv 2022, arXiv:2207.02501. 24. Berggren, J.L.; Borwein, J.M.; Borwein, J. Pi: A Source Book, 3rd ed.; Springer: New York, NY, USA, 2004. 25. Calcut, J.S. Gaussian integers and arctangent identities for p. Amer. Math. Mon. 2009, 116, 515–530. [CrossRef] 26. Nimbran, A.S. On the derivation of Machin-like arctangent identities for computing pi (p). Math. Stud. 2010, 79, 171–186. 27. Agarwal, R.P.; Agarwal, H.; Sen, K.S. Birth, growth and computation of pi to ten trillion digits. Adv. Differ. Equ. 2013, 100. [CrossRef] 28. 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 26 February 2023). 29. A Wolfram Notebook Playing with Machin-like Formulas. Available online: https://www.wolframcloud.com/obj/exploration/ MachinLike.nb (accessed on 26 February 2023). 30. Gasull, A.; Luca, F.; Varona, J.L. Three Essays on Machin’s Type Formulas. arXiv 2023, arXiv:2302.00154. 31. Abrarov, S.M.; Quine, B.M. Identities for the Arctangent Function by Enhanced Midpoint Integration and the High-Accuracy Computation of pi. arXiv 2016, arXiv:1604.03752. 32. Abrarov, S.M.; Quine, B.M. A formula for pi involving nested radicals. Ramanujan J. 2018, 46, 657–665. [CrossRef] 33. Abrarov, S.M. Array Numerical Integration by Enhanced Midpoint Rule (File ID: 71037). Available online: https://tinyurl.com/ bdf8pt2m (accessed on 26 February 2023). 34. Castellanos, D. The ubiquitous p. Math. Mag. 1988, 61, 67–98. [CrossRef] 35. Chien-Lih, H. An elementary derivation of Euler ’s series for the arctangent function. Math. Gaz. 2005, 89, 469–470. [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. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png AppliedMath Multidisciplinary Digital Publishing Institute

A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration

Loading next page...
 
/lp/multidisciplinary-digital-publishing-institute/a-generalized-series-expansion-of-the-arctangent-function-based-on-the-iwnWnUNXQM
Publisher
Multidisciplinary Digital Publishing Institute
Copyright
© 1996-2023 MDPI (Basel, Switzerland) unless otherwise stated Disclaimer 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. Terms and Conditions Privacy Policy
ISSN
2673-9909
DOI
10.3390/appliedmath3020020
Publisher site
See Article on Publisher Site

Abstract

Article A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration 1,2,3, 2,3,4 2,4 1,3,4 Sanjar M. Abrarov *, Rehan Siddiqui , Rajinder Kumar Jagpal and Brendan M. Quine Thoth Technology Inc., Algonquin Radio Observatory, Achray Rd., RR6, Pembroke, ON K8A 6W7, Canada Epic College of Technology, 5670 McAdam Rd., Mississauga, ON L4Z 1T2, Canada Department Earth and Space Science and Engineering, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada Department Physics and Astronomy, York University, 4700 Keele St., Toronto, ON M3J 1P3, Canada * Correspondence: sanjar@thothx.com Abstract: In this work, we derive a generalized series expansion of the acrtangent function by using the enhanced midpoint integration (EMI). Algorithmic implementation of the generalized series expansion utilizes a two-step iteration without surd or complex numbers. The computational test we performed reveals that such a generalization improves the accuracy in computation of the arctangent function by many orders of magnitude with increasing integer M, associated with subintervals in the EMI formula. The generalized series expansion may be promising for practical applications. It may be particularly useful in practical tasks, where extensive computations with arbitrary precision floating points are needed. The algorithmic implementation of the generalized series expansion of the arctangent function shows a rapid convergence rate in the computation of digits of p in the Machin-like formulas. Keywords: arctangent function; midpoint integration; iterative algorithm; constant pi MSC: 26A18; 41A10 Citation: Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A 1. Introduction Generalized Series Expansion of the In 2010, Adegoke and Layeni published an interesting relation for derivatives of the Arctangent Function Based on the arctangent function [1]: Enhanced Midpoint Integration. AppliedMath 2023, 3, 395–405. n n1 d (1) (n 1)! 1 arctan(x) = sin n arcsin p , n 2 N . (1) https://doi.org/10.3390/ 2 n/2 dx (1 + x ) 1 + x appliedmath3020020 Using this relation, they discovered a series expansion: Academic Editor: Valery Karachik n/2 Received: 3 February 2023 ¥ 1 x 1 arctan(x) = sin n arcsin p . (2) Revised: 1 March 2023 n 1 + x 1 + x n=1 Accepted: 31 March 2023 Published: 17 April 2023 Equations (1) and (2) have some restrictions. Specifically, when n is even, Equation (1) remains valid only at x 2 [0, ¥), while Equation (2) is valid only at x 2 [0, ¥) for 8n. To resolve this problem, Lampret applied the signum function Copyright: © 2023 by the authors. 1, x < 0, Licensee MDPI, Basel, Switzerland. sgn(x) = This article is an open access article 1, x  0, distributed under the terms and conditions of the Creative Commons and proved that for complete coverage x 2 (¥, ¥), the Equations (1) and (2) can be Attribution (CC BY) license (https:// modified as [2] creativecommons.org/licenses/by/ d (n 1)! 1 n1 4.0/). arctan(x) = sgn(x) sin n arcsin p (3) 2 n/2 dx (1 + x ) 1 + x AppliedMath 2023, 3, 395–405. https://doi.org/10.3390/appliedmath3020020 https://www.mdpi.com/journal/appliedmath AppliedMath 2023, 3 396 and n/2 1 x 1 arctan(x) = sgn(x) sin n arcsin p , (4) n 1 + x 1 + x n=1 respectively. Equations (3) and (4) represent a theoretical interest. In particular, Lampret noticed that, from Equation (3), it follows that [2] (n1)/2 p (1) (n 1)!, n odd, n1 sgn(0)  (n 1)! sin n = (5) 0, n even. Comparing the following relation (see [3] for detailed derivation procedure by induction), n n d (1) (n 1)! 1 1 arctan(x) = (6) n n n dx 2i (x + i) (x i) with Equation (3), we can find the following identity: (n 1)! 1 n1 sgn(x) sin n arcsin p = 2 n/2 (1 + x ) 1 + x (7) (1) (n 1)! 1 1 n n 2i (x + i) (x i) It is not difficult to see that the relation (5) immediately follows from the identity (7). Therefore, relation (5) is just a specific case of the identity (7) occurring at x = 0. Identity (7) can be rewritten in the form 2 n/2 1 (1 + x ) 1 1 n1 sin n arcsin = sgn(x) . n n 2i (x + i) (x i) 1 + x Therefore, from Equation (4), it follows that arctan(x) = " # n/2 2 2 n/2 1 x (1 + x ) 1 1 n1 sgn(x) sgn(x) 2 n n n 1 + x 2i (x + i) (x i) n=1 or ¥ n i x 1 1 arctan(x) = . n n 2 n (x + i) (x i) n=1 As we can see, this series expansion of the arctangent function is just a reformulation of Equation (4) and, since the relation (6) can be rearranged in the form 1 1 2i d = arctan(x), n n n n (x + i) (x i) (1) (n 1)! dx we can express the arctangent function in terms of its derivatives as given by the following equation: ¥ n1 n n (1) x d arctan(x) = arctan(x) n! dx n=1 that leads to ¥ n1 n n (1) x d arctan(x) = 0. n! dx n=0 In our previous publication [4], using the identity (6), we have derived the following series expansion of the arctangent function AppliedMath 2023, 3 397 arctan(x) = ¥ 2m1 2(2mn)1 (1) x 2m 1 2 , å å 2 2m1 (2m 1)(1 + x /4) 2 2n 1 m=1 n=1 from which, at x = 1, we obtain a formula for p expressed in terms of the binomial coefficients ¥ 2m1 n p (1) 2m 1 = 2 å å 2m1 2(2mn)1 4 2n 1 (2m 1)(1 + 1/4) 2 m=1 n=1 or ¥ 2m1 n1 p (4) 2m 1 = . å å 2m1 16 (2m 1)5 2n 1 m=1 n=1 Later, using the same identity (6), we have also derived the following series expansion (see [5,6]): 1 g (x) arctan(x) = 2 , (8) 2 2 2n 1 g (x) + h (x) n n n=1 where the expansion coefficients are computed by a two-step iteration: g (x) = g (x)(1 4/x ) + 4h (x)/x, n n1 n1 h (x) = h (x)(1 4/x ) 4g (x)/x, n n1 n1 such that g (x) = 2/x, h (x) = 1. The series expansion (8) requires no surd or complex numbers in computation and it is rapid in convergence. Many new identities and series expansions related to the arctangent function have been reported [7–15]. This shows that the discovery of new equations related to the arctangent function as well as their applications remains a very interesting topic. As a further development, in this work we derive a generalized series expansion of the arctangent function. Such an approach may be used to improve further convergence in the computation of the arctangent function. Due to rapid convergence without surd and complex numbers in computation, the generalized series expansion may be promising for applications with arbitrary precision floating points [16–23]. Furthermore, it may also be promising in computing digits of p by using the Machin-like formulas [5,6,24–30]. To the best of our knowledge, the generalized series expansion of the arctangent function is new and has never been reported. 2. Derivation The change of the variable x ! xt in Equation (6) results in n n n ¶ (1) (n 1)!x 1 1 arctan(xt) = n n n ¶t 2i (xt + i) (xt i) or n n+1 n+1 ¶ x (1) n!x 1 1 = (9) 2 2 n+1 n+1 ¶t 1 + x t 2i (xt + i) (xt i) since n n1 ¶ ¶ x arctan(xt) = . n n1 2 2 ¶t ¶t 1 + x t AppliedMath 2023, 3 398 The Enhanced Midpoint Integration (EMI) formula is given by (see [31] for derivation and [32] for application) M ¥ n n (1) + 1 d f (t) dt = f (t) , (10) å å n+1 n (2M) (n + 1)! dt m1/2 t= m=1 n=0 where integer M is associated with the subintervals of integration. It is interesting to note that if the upper summation bound associated with variable n is an integer N  0, then we can also use M N n n (1) + 1 d f (t) dt = lim f (t) . å å n+1 n dt m1/2 M!¥ (2M) (n + 1)! t= m=1 n=0 It is easy to show that, excluding all zero terms occurring at odd values of the variable n, Equation (10) can be rewritten in a more convenient form: M ¥ 2n 1 d f (t) dt = 2 f (t) . (11) å å 2n+1 2n (2M) (2n + 1)! dt m1/2 t= m=1 n=0 Equation (11) requires even derivatives of the integrand at the points t = (m 1/2)/M, where m = 1, 2, 3, . . . M. Taking these derivatives manually is extremely tedious. However, with the help of Computer Algebra Systems (CASs) such as Mathematica, Matlab or Maple supporting symbolic programming, the application of Equation (11) may be very efficient in numerical integration. Specifically, such an approach may be especially useful for the numerical integration of the highly oscillating functions. The EMI formula (11) can be used for numerical integration within any interval t 2 (a, b), since the following transformation formula b 1 Z Z f (t) dt = (b a) f ((b a)t + a) dt can be applied to recast the integration interval within t 2 (0, 1). The interested readers can download the MATLAB code based on the integration Formula (11) on the MATLAB Central website [33] (file ID #: 71037). The synopsis and brief instruction on how to use the MATLAB code for numerical integration is also provided in the supplementary readme.pdf file. If an integrand represents a function of two variables f (x, t), then the integration Formula (11) reads as M ¥ 2n 1 ¶ f (x, t) dt = 2 f (x, t) . (12) å å 2n+1 2n (2M) (2n + 1)! ¶t m1/2 t= m=1 n=0 The arctangent function can be given as an integral: arctan(x) = dt. (13) 2 2 1 + x t Consequently, substituting the integrand from Equation (13) x x 1 1 = + 2 2 1 + x t 2 1 + ixt 1 ixt AppliedMath 2023, 3 399 into Equation (12) and using Equation (9) for differentiation, we can find that arctan(x) = " # M ¥ 2n+1 (14) x 1 1 i . å å 2n+1 m1/2 m1/2 2n+1 2n+1 (2M) (2n + 1) (x + i) (x i) m=1 n=0 M M Series expansion (14) is rapid in convergence. However, it requires algebraic manipu- lations with complex numbers. Therefore, it is very desirable to exclude them. This can be achieved by induction based on a two-step iteration, a (x, t) = a (x, t)(1 1/(xt) ) + 2b (x, t)/(xt), n n1 n1 b x, t = b x, t 1 1/ xt 2a x, t / xt , ( ) ( ) ( ) ( ) ( ) n n1 n1 and a (x, t) = 1/(xt), b (x, t) = 1, that transforms Equation (14) into the following series expansion: M ¥ 1 a (x, g ) m,M arctan(x) = 2 , (15) å å 2n1 2 2 (2n 1)(2m 1) a (x, g ) + b (x, g ) n m,M n m,M m=1 n=1 where the argument is m 1/2 g = . m,M Equation (15) is a generalization of Equation (8). Consistency between these two equa- tions can be observed by taking M = 1. In particular, the substitution of M = 1 into series expansion (15) of the arctangent function implies that t = g = 1/2. Consequently, 1,1 from Equation (15) we obtain Equation (8), where the expansion coefficients are g (x) = a (x, g ), 1 1 1,1 h (x) = b (x, g ), 1 1 1,1 g (x) = a (x, g ), n n 1,1 h (x) = b (x, g ). n n 1,1 The following is a Mathematica code that generates the graphs shown in Figure 1 (this code can be copy-pasted directly to the Mathematica notebook): Clear[atan,\[Gamma],\[Alpha],\[Beta]]; (* Equation (15) *) atan[x_,nMax_,M_] := 2*Sum[(1/(2*n - 1))* (\[Alpha][x,\[Gamma][m,M],n]/((2*m - 1)^(2*n - 1)* (\[Alpha][x,\[Gamma][m, M],n]^2 + \[Beta][x, \[Gamma][m,M],n]^2))),{m,1,M},{n,1,nMax}]; (* Argument gamma *) \[Gamma][m_,M_] := \[Gamma][m,M] = N[(m - 1/2)/M,1000]; (* Expansion coefficients *) \[Alpha][x_,t_,1] := \[Alpha][x,t,1] = 1/(x*t); \[Beta][x_,t_,1] := \[Beta][x,t,1] = 1; \[Alpha][x_,t_,n_] := \[Alpha][x,t,n] = \[Alpha][x,t,n - 1]*(1 - 1/(x*t)^2) + 2*(\[Beta][x,t,n - 1]/(x*t)); \[Beta][x_,t_,n_] := \[Beta][x,t,n] = \[Beta][x,t,n - 1]*(1 - 1/(x*t)^2) - AppliedMath 2023, 3 400 2*(\[Alpha][x,t,n - 1]/(x*t)); (* Computing data points *) tabs := {Table[{x,atan[x,10,1]},{x,-20,20,Pi/20}], Table[{x,atan[x,10,2]},{x,-20,20,Pi/20}], Table[{x,atan[x,10,3]},{x,-20,20,Pi/20}]}; Print["Computing, please wait..."]; (* Plotting graphs *) ListPlot[tabs,Joined->True,FrameLabel->{"Parameter x", "Arctangent approximations"},PlotStyle->{Blue,Red,Green}, Frame->True,GridLines->Automatic] Figure 1. Arctangent approximations computed by using series expansion (15) truncated at n = 10. max Blue, red and green curves correspond to M taken to be 1, 2 and 3, respectively. The graphs in Figure 1 are generated by using series expansion (15) truncated at n = 10. Blue, red and green curves correspond to integer M taken to be 1, 2 and 3, max respectively. Consider Figure 2 showing approximation curves of the arctangent function arctan(x) by using Equations (15)–(17) truncated at n = 10. The blue curve corresponding to the max Maclaurin series expansion ¥ n 2n+1 (1) x arctan(x) = , jxj  1, (16) 2n + 1 n=0 diverges beyond 1 and 1 due to the finite radius of convergence. Although one can resolve this issue by using an elementary relation, p 1 arctan , x > 0, 2 x arctan(x) = 0, x = 0, > p 1 arctan , x < 0, 2 x our objective is just to visualize the convergence. The red curve shows the Euler series expansion [22,34,35]: ¥ 2 2n 2n+1 2 n! x ( ) arctan(x) = . (17) n+1 (2n + 1)! 2 (1 + x ) n=0 AppliedMath 2023, 3 401 The green curve illustrates the series expansion (15) at M = 1. The black dashed curve depicts the original arctangent function for comparison. As we can see from Figure 2, even at the smallest M the series expansion (15) provides more rapid convergence as compared to the Euler series expansion (17). Figure 2. Arctangent approximations computed by series expansions (16) (blue), (17) (red) and (15) (green) truncated at n = 10. Integer M in Equation (15) is taken to be equal to 1. The dashed black max curve shows the original artangent function. Figure 3 shows the logarithms of absolute difference log D between the arctangent function and its approximations provided by Equations (15)–(17). All curves are also computed with truncating integer n = 10 in all these equations. The blue and red max curves correspond to Equations (16) and (17) while the green, brown, gray, magenta and black curves correspond to Equation (15) when M is equal to 1, 2, 3, 4 and 5, respectively. As we can see from this figure, the increase of the integer M leads to a rapid decrease of the absolute difference D by many orders of the magnitude. These results indicate that the series expansion (15) provides increasing convergence with increasing M. Figure 3. Logarithms of absolute difference log D between original arctangent function and series expansions (16) (blue), (17) (red) and (15) (green-to-black) truncated at n = 10. Integer M in the max series expansion (15) is taken to be 1 (green), 2 (brown), 3 (gray), 4 (magenta) and 5 (black). AppliedMath 2023, 3 402 3. Applications There are two potentially possible applications of the series expansion (15). In partic- ular, the series expansion (15) can be implemented as a function file for computation of the arctangent for the libraries with arbitrary precision floating points that are required in many fields of mathematical/computational physics and astronomy [16–23]. According to [16,17,22,23], the Maclaurin and Euler series expansions (16) and (17) are used for the arctangent function to provide arbitrary precision in the programming languages. The Maclaurin series expansion (16) diverges at the points of argument 1 and1. This deteriorates the accuracy as argument x approaches 1 by the absolute value. Consequently, its algorithmic implementation requires additional algebraic manipulations to overcome this issue for computations with enhanced precision [16]. As Equation (15) is more rapid in convergence than Equations (16) and (17), its ap- plication may also be efficient to reduce the run-time in many tasks, where extensive computations (without surd or complex numbers) with largely extended precision in floating point numbers are necessary. Moreover, Equation (15) may also provide addi- tional flexibility for users, who can choose the parameter M according to their specific requirements for high-accuracy computation. Another application, where the series expansion (15) can also find its practical imple- mentation, is a computation of digits of the constant p by using the Machin-like formu- las [5,6,24–30]. Since computation of any irrational numbers is itself a big challenge, a rapid con- vergence of the arctangent terms in the Machin-like formulas without undesirable surd numbers can provide a significant advantage. Our empirical results show that even using already known Machin-like formulas with sufficiently large integers in actangent argu- ments, the expansion series (15) at any M  1 can provide more than 17 digits of p at each increment by 1 of the variable n. It is interesting to note that this convergence rate is faster than that provided by the Chudnovsky formula generating 14 to 16 digits of p per increment [24,27]. Currently, the Chudnovsky formula remains the most efficient for computing digits of p due to its rapid convergence and other advantages in algorithmic implementation. Historically, however, there were several records that appeared due to the application of the Machin-like formulas in computing p and, in 2002, an algorithm, developed by Kanada on the basis of a self-checking pair of the Machin-like formulas, beat the record, providing more than a trillion digits of p for the first time [25,27]. Therefore, the discovery of new Machin-like formulas and rapidly convergent series expansions of the arctangent function may be promising for computing digits of the constant p. Consider the following example. Previously, we developed a method and generated a two-term Machin-like formula for p by using a two-step iteration process [5]. 0 1 522,185,807 digits z }| { B C p 1 9732933578 . . . 4975692799 B C = 2 arctan arctan . (18) B C 4 85,445,659 @ 2368557598 . . . 9903554561A | {z } 522,185,816 digits Recently, the same identity has been generated by independent researchers, who developed a different method for generating the two-term Machin-like formulas for p [30]. The method we developed in [5] for generating two-terms Machin-like formulas for p is a complete alternative to the method described in [30] for the formulas of the kind p a c k1 = 2 arctan + arctan , a, b, c, d 2 Z. 4 b d Specifically, all Machin-like formulas for p, shown in the Tables 1 and 2 from [30], can also be generated by using the two-step iterative method that we proposed in our publica- tion [5]. The two-term Machin-like formula (18) for p that is listed in Table 2 in the recent publication [30], is just a specific case occurring at k 1 = 26, a = 1 and b = 85,445,659. AppliedMath 2023, 3 403 Due to the large number of digits in the numerator and denominator in the second arctangent term of Equation (18), we cannot perform computation to observe the corre- sponding convergence rate without a powerful computer. However, this problem can be handled on a typical laptop or desktop computer with the help of the following identity (see derivation in [5]): 0 1 2g k1 1 sin 2 arctan p 1 g 1 k1 @ A = 2 arctan + arctan , (19) 2g 4 g k1 cos 2 arctan g 1 where the constant g may be chosen such that k1 2 p . (20) g 4 Since [32] 2 a k1 k1 = 2 arctan , k  1, 4 a where a = 0 and a = 2 + a , it is convenient to choose g for equation as an integer k+1 k $ % g = p 2 a k1 that satisfies the condition (20). Consequently, at k = 27 we obtain the value 85,445,659 for g that is present in Equation (18) and the difference 2 p = 4.10922 . . . 10 85,445,659 4 is small. More generally, the value of g may be taken as a ratio rather than an integer. For example, we can use [6] $ % m k m g = 10 p 10 2 a k1 or & ' m m g = 10 10 , 2 a k1 where m 2 N . The identity (19) implies that if the argument of the first arctangent function is known, then the argument of the second arctangent function can be found. Thus, if we take g = 85,445,659, then the argument of the second arctangent function in Equation (18) can be calculated accordingly as 2g k1 1 sin 2 arctan g 1 = 4.10922393614549022091 . . . 10 . 2g k1 cos 2 arctan g 1 Once we obtain the argument of the second arctangent with, say, up to 1000 correct decimal digits, we can see that the substitution of both arctangent arguments into Equation (15) at M = 1 gives 15 to 17 correct digits of p per each increment of n. This example demonstrates a rapid convergence rate of the generalized series expansion (15). Therefore, its algorithmic implementation may be promising for rapid and highly accurate computation. AppliedMath 2023, 3 404 4. Conclusions We derived a generalized series expansion (15) of the arctangent function by using the EMI Formula (12). The algorithmic implementation of Equation (15) is based on a two- step iteration without surd or complex numbers. The computational test we performed reveals that such a generalization significantly improves the convergence in computation of the arctangent function with increasing integer M. The generalized series expansion (15) may be promising in practical applications; it may be used for extensive computations with arbitrary precision floating points and its algorithmic implementation shows a high convergence rate in the computation of digits of p in the Machin-like formulas. 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: Not applicable. Acknowledgments: This work is supported by National Research Council Canada, Thoth Technology Inc., York University and Epic College of Technology. Conflicts of Interest: The authors declare no conflict of interest. Abbreviations The following abbreviations are used in this manuscript: EMI Enhanced midpoint integration CAS Computer algebra system References 1. Adegoke K.; Layeni, O. The higher derivatives of the inverse tangent function and rapidly convergent BBP-type formulas for pi. Appl. Math. E-Notes 2010, 10, 70–75. Available online: https://www.math.nthu.edu.tw/~amen/2010/090408-2.pdf (accessed on 26 February 2023). 2. Lampret, V. The higher derivatives of the inverse tangent function revisited. Appl. Math. E-Notes 2011, 11, 224–231. Available online: https://www.math.nthu.edu.tw/~amen/2011/101020-2.pdf (accessed on 26 February 2023). 3. Abrarov, S.M.; Quine, B.M. A Simple Identity for Derivatives of the Arctangent Function. arXiv 2016, arXiv:1605.02843. 4. Abrarov, S.M.; Quine, B.M. A Reformulated Series Expansion of the Arctangent Function. arXiv 2017, arXiv:1701.05098. 5. 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. 6. Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A new form of the Machin-like formula for p by iteration with increasing integers. J. Integer. Seq. 2022, 25, 22.4.5 7. Milgram, M. A new series expansion for integral powers of arctangent. Integ. Trans. Spec. Func. 2006, 17, 531–538. [CrossRef] 8. Sofo, A.; Villacorta, J.C. New identities for the arctangent function. J. Math. Anal. 2012, 3, 1–10. 9. Zhang, W. New formulae of BBP-type with different moduli. J. Math. Anal. Appl. 2013, 398, 46–60. [CrossRef] 10. Qi, F.; Zheng, M.-M. Explicit expressions for a family of the Bell polynomials and applications. Appl. Math. Comput. 2015, 258, 597–607. [CrossRef] 11. Pilato, L.; Fanucci, L.; Saponara, S. Real-time and high-accuracy arctangent computation using CORDIC and fast magnitude estimation. Electronics 2017, 6, 22. [CrossRef] 12. Qiao, Q.-X.; Chen, C.-P. Approximations to inverse tangent function. J. Ineq. Appl. 2018, 141 . [CrossRef] [PubMed] 13. Benammar, M.; Alassi, A.; Gastli, A.; Ben-Brahim, L.; Touat, F. New fast arctangent approximation algorithm for generic real-time embedded applications. Sensors 2019, 19, 5148. [CrossRef] 14. Sofo, A.; Nimbran, A.S. Euler-like sums via powers of log, arctan and arctanh functions. Integ. Trans. Spec. Func. 2020, 31, 966–981. [CrossRef] 15. Kusaka, T.; Tanaka, T. Fast and accurate approximation methods for trigonometric and arctangent calculations for low- performance computers. Electronics 2022, 11, 2285. [CrossRef] 16. Brent, R.P. Fortran multiple-precision arithmetic. ACM Trans. Math. Soft. 1978, 4, 57–70. [CrossRef] AppliedMath 2023, 3 405 17. Brent, R.P. Fast Algorithms for High-Precision Computation of Elementary Functions. Available online: https://maths-people. anu.edu.au/brent/pd/RNC7t4.pdf (accessed on 26 February 2023). 18. de Dinechin, F.; Villard, G. High precision numerical accuracy in physics research. Nucl. Instrum. Methods Phys. Res. A 2006, 559, 207–210. [CrossRef] 19. Bailey, D.H.; Barrio, R.; Borwein, J.M. High-precision computation: Mathematical physics and dynamics. Appl. Math. Comput. 2012, 218, 10106–10121. [CrossRef] 20. Bailey, D.H.; Borwein, J.M. High-precision arithmetic in mathematical physics. Mathematics 2015, 3, 337–367. [CrossRef] 21. Kneusel, R.T. Numbers and Computers; Springer: Cham, Switzerland 2017. 22. Vestermark, H. Fast Trigonometric Functions for Arbitrary Precision Number. Available online: https://www.researchgate.net/ publication/361483599_Fast_Trigonometric_functions_for_Arbitrary_Precision_number?channel=doi&linkId=63fc7e0657495 05945498e6b&showFulltext=true (accessed on 26 February 2023). 23. Johansson, F. Computing Elementary Functions Using Multi-Prime Argument Reduction (LFANT). arXiv 2022, arXiv:2207.02501. 24. Berggren, J.L.; Borwein, J.M.; Borwein, J. Pi: A Source Book, 3rd ed.; Springer: New York, NY, USA, 2004. 25. Calcut, J.S. Gaussian integers and arctangent identities for p. Amer. Math. Mon. 2009, 116, 515–530. [CrossRef] 26. Nimbran, A.S. On the derivation of Machin-like arctangent identities for computing pi (p). Math. Stud. 2010, 79, 171–186. 27. Agarwal, R.P.; Agarwal, H.; Sen, K.S. Birth, growth and computation of pi to ten trillion digits. Adv. Differ. Equ. 2013, 100. [CrossRef] 28. 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 26 February 2023). 29. A Wolfram Notebook Playing with Machin-like Formulas. Available online: https://www.wolframcloud.com/obj/exploration/ MachinLike.nb (accessed on 26 February 2023). 30. Gasull, A.; Luca, F.; Varona, J.L. Three Essays on Machin’s Type Formulas. arXiv 2023, arXiv:2302.00154. 31. Abrarov, S.M.; Quine, B.M. Identities for the Arctangent Function by Enhanced Midpoint Integration and the High-Accuracy Computation of pi. arXiv 2016, arXiv:1604.03752. 32. Abrarov, S.M.; Quine, B.M. A formula for pi involving nested radicals. Ramanujan J. 2018, 46, 657–665. [CrossRef] 33. Abrarov, S.M. Array Numerical Integration by Enhanced Midpoint Rule (File ID: 71037). Available online: https://tinyurl.com/ bdf8pt2m (accessed on 26 February 2023). 34. Castellanos, D. The ubiquitous p. Math. Mag. 1988, 61, 67–98. [CrossRef] 35. Chien-Lih, H. An elementary derivation of Euler ’s series for the arctangent function. Math. Gaz. 2005, 89, 469–470. [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.

Journal

AppliedMathMultidisciplinary Digital Publishing Institute

Published: Apr 17, 2023

Keywords: arctangent function; midpoint integration; iterative algorithm; constant pi

There are no references for this article.