2
$\begingroup$

I design an educational program to demonstrate convergence rate in computation of $\pi$ by using the Machin like formula. According to Weisstein, the Hwang’s equation (see eq. (32) in http://mathworld.wolfram.com/Machin-LikeFormulas.html): $$\begin{align} \frac{1}{4}\pi = & 183{{\cot }^{-1}}239+32{{\cot }^{-1}}1023-68{{\cot }^{-1}}5832 \\ & +12{{\cot }^{-1}}110443-12{{\cot }^{-1}}4841182-100{{\cot }^{-1}}6826318 \\ \end{align}$$ is the most efficient Machin like formula to compute pi. I used three series for the inverse tangent ($\cot^{-1}x = \tan^{-1}\frac{1}{x}$): $$\tag{1}\tan^{-1}x=\sum\limits_{n=1}^{\infty }{\frac{{{\left( -1 \right)}^{n}}{{x}^{2n+1}}}{2n+1}},$$

$$\tag{2}\tan^{-1}x=\sum\limits_{n=1}^{\infty }{\frac{{{2}^{2n}}{{\left( n! \right)}^{2}}}{\left( 2n+1 \right)!}\frac{{{x}^{2n+1}}}{{{\left( 1+{{x}^{2}} \right)}^{n+1}}}},$$

$$\tag{3}\tan^{-1}x=2\sum\limits_{n=1}^{\infty }{\frac{1}{2n-1}\frac{{{a}_{n}}\left( x \right)}{a_{n}^{2}\left( x \right)+b_{n}^{2}\left( x \right)}}, $$ where $$\begin{align} & {{a}_{1}}\left( x \right)=2/x, \\ & {{b}_{1}}\left( x \right)=1, \\ & {{a}_{n}}\left( x \right)={{a}_{n-1}}\left( x \right)\left( 1-4/{{x}^{2}} \right)+4{{b}_{n-1}}\left( x \right)/x, \\ & {{b}_{n}}\left( x \right)={{b}_{n-1}}\left( x \right)\left( 1-4/{{x}^{2}} \right)-4{{a}_{n-1}}\left( x \right)/x. \\ \end{align}$$

Eq. (1) is the Maclaurin series, eq. (2) is the Euler’s series, eq. (3) is from the paper Abrarov & Quine arXiv:1706.08835. It appears to be that eqs. (2) and (3) are more rapid than eq. (1). I want to ask you two questions. Is eq. (3) more efficient than eq. (2)? Are there other series for the inverse tangent with rapid convergence?

$\endgroup$
4
  • $\begingroup$ Which of several methods is the most efficient generally depends on how clever the coder is and what software and hardware the coder is using, and what the range of the computation is. It's not just a matter of which formula. $\endgroup$ Commented Sep 29, 2017 at 3:12
  • $\begingroup$ @ Gerry Myerson. Hardware is the desktop computer. My main soft is Maple (or any other). Our goal is to show the best convergence rate by taking appropriate series for $tan^{-1} x$. If the convergence rate is 5 - 10 digits per term, the range of 30 - 50 decimals is enough. One may expect that the Hwang's equation (32) can produce up to 10 new digits of pi per increment. $\endgroup$ Commented Sep 29, 2017 at 12:46
  • $\begingroup$ The software doesn't let you ping two people in one comment. I think that if you want coudy to see your comment, you have to have it as a comment to coudy's answer, not a comment to your question. Also, I think you have to not have a space between the at-sign and the username. $\endgroup$ Commented May 4, 2018 at 1:02
  • $\begingroup$ @Gerry Myerson. In this paper ijmcs.future-in-tech.net/13.2/R-Abrarov.pdf page 167 shows a Mathematica program that generates 17 digits of pi per term. This proves rapid convergence. $\endgroup$ Commented May 13, 2018 at 23:43

4 Answers 4

4
$\begingroup$

The Hwang equation is not the most efficient Machin like formula to compute $\pi$. The following formula

$${\pi \over 4} = 32 \, \hbox{arctan}({1\over 40}) - \hbox{arctan}\biggl( {38035138859000075702655846657186322249216830232319 \over 2634699316100146880926635665506082395762836079845121}\biggr) $$ has a Lehmer's measure around $1.16751$ thus beating Hwang's formula (with Lehmer's measure $1.51240$).

Abrarov and Quine gave a formula with Lehmer's measure $0.245319$ last summer, together with the relevant algorithms, in their paper An iteration procedure for a two-term Machin-like formula for pi with small Lehmer’s measure. That formula provides 16 new digits of $\pi$ per term increment thus beating the famous Chudnovsky formula.

At $k=27$ the Abrarov-Quine formula gives a fraction that has a numerator with $522\,185\,807$ digits and a denominator with $522\,185\,816$ digits. This type of fractions with huge numbers can also be obtained from the Borwein’s integral as shown in the preprint by Uwe Bäsel and Robert Baillie Sinc integrals and tiny numbers such that a formula for $\pi$ can be written with $453\,130\,145$ and $453\,237\,170$ digits in numerator and denominator, respectively.

$\endgroup$
5
  • $\begingroup$ @ coudy. A fraction where a numerator with 522185807 digits and a denominator with 522185816 digits requires a specific FFT method dealing with long numbers for more efficient computation. As I know this FFT method were used for the Chudnovsky formula for beating the last record. However, this is beyond of my current scope. Thank you anyway! $\endgroup$ Commented Sep 28, 2017 at 20:34
  • $\begingroup$ The aforementioned paper gives numerous Machin formulas together with efficient series to compute the arctangent. You should find something there to your liking. $\endgroup$
    – coudy
    Commented Sep 28, 2017 at 20:39
  • $\begingroup$ @ coudy. This method is unconventional although it (perhaps) beats the Chudnovsky formula for $\pi$ in convergence as claimed. I did not verify this claim. However, I verified series (3) from the same paper and confirm that it converges fast. This probably is what I need right now. $\endgroup$ Commented Sep 28, 2017 at 20:51
  • $\begingroup$ @coudy I wish I would also show another formula for $\pi$ derived by using the Borwein integrals involving sinc function as shown in the paper by Uwe Bäsel and Robert Baillie: arxiv.org/pdf/1510.03200.pdf (published in ELEMENTE DER MATHEMATIK, Volume 71, Issue 1, 2016, pp. 7–20 doi.org/10.4171/EM/295). Unfortunately the window is a bit narrow here to fit a Bäsel–Baillie formula for $\pi$ requiring a ratio with $453\,130\,145$ and $453\,237\,170$ digits in numerator and denominator. $\endgroup$ Commented Sep 29, 2020 at 21:48
  • $\begingroup$ Not quite so good. It's trivial to write it in the form $a * arctan (b) +arctan (c)$ and just let c be some huge fractional expression. The harder and more interesting problem is $a_1 arctan (b) +a_2 arctan (c)$ in which $a_2, a_1$ is $>1$ and all the values are rational. This allows for a smaller fractional value of $c$ and a more compact expression overall. $\endgroup$
    – CarP24
    Commented Jan 27, 2023 at 6:59
0
$\begingroup$

This is not exactly an answer, but R. P. Brent has an excellent survey of computing everything under the Sun (including $\arctan.$)

$\endgroup$
1
  • $\begingroup$ @ Igor Rivin. Many thanks I will read this paper by R. P. Brent. $\endgroup$ Commented Sep 28, 2017 at 21:17
0
$\begingroup$

The efficiency of such series depends not just on the rate of convergence but on the bit size of the terms.

If $\sum_{k=0}^{\infty} T(k)$ converges linearly, you can always rewrite it as $\sum_{k=0}^{\infty} U(k)$ where $U(k) = \sum_{j=0}^{N-1} T(N k + j)$ to get a series that converges $N$ times faster. But nothing has really been gained since the terms now cost $N$ times more to compute.

$\endgroup$
1
  • $\begingroup$ @ Fredrik Johansson. This formula is accurate. However it adds many new terms while k increases. Therefore efficiency of computation may be questionable. I will verify it. Thank you for suggestion! $\endgroup$ Commented Sep 28, 2017 at 21:11
0
$\begingroup$

Arctangent formula (3) that can also be written as $$\tan^{-1}\left(x\right)=i\sum\limits_{n=1}^{\infty}{\frac{1}{2n-1}}\left(\frac{1}{\left(1+2i/x\right)^{2n-1}}-\frac{1}{\left(1-2i/x\right)^{2n-1}}\right)$$ is more rapid in convergence than the equation (2). Therefore, it is more efficient in computation. Here is a link: How to compare convergence of two equations for the arctangent function?

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .