If we define the following function $$agm(1,x) =y$$ and its inverse, $$agm^{-1}(y)=(1,x)$$ is it possible to calculate $agm^-1(y)$. Where $agm(x)$ is the sequence $$a_{n+1}=\frac{a_n+b_n}{2}$$ and $$b_{n+1}=\sqrt(a_nb_n)$$I know how to reverse the iterations of $agm(x)$ using $$a_{n-1}=a_n-\sqrt(a_n^2-b_n^2)$$ and that $$b_{n-1}=a_n+\sqrt(a_n^2-b_n^2)$$ However for those to work I would need two values, how can I calculate $x$ or $(1,x)$ using $y$.
How to calculate the inverse agm(1,x)?
221 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
From standard facts, such as in the Wikipedia article Arithmetic-geometric mean, $\, \textrm{agm}(1,k) = \frac{\pi/2}{K(k')}\,$ where $\,k\,$ is the modulus, $\,k'=\sqrt{1-k^2}\,$ is the complementary modulus, and $\,K(k)\,$ is the complete elliptic integral of the first kind. In order to find $\,\textrm{agm}^{-1}\,$ you need to find the inverse of $\,K().\,$ This involves the Jacobi amplitude function described in the Jacobi elliptic functions article.
As a practical matter, I suggest restricting to $\,0<k<1\,$ although there is analytic continuation, but you may run into branch cuts or worse.
On
We have $$\text{agm}(1,x)=\frac{\pi (1+x)}{4 K\left(\left(\frac{1-x}{1+x}\right)^2\right)}$$ Suing series expansions for large values of $x$, we have $$\frac{\pi (1+x)}{4 K\left(\left(\frac{1-x}{1+x}\right)^2\right)}=\frac{\pi x}{4\log (2)+2 \log \left({x}\right)}+\frac{1-\pi \log \left({4 x}\right)}{8 x \log ^2\left({4 x}\right)}+O\left(\frac{1}{x^3}\right)$$ So, if we consider the first term only and solve for $x$ we have, as an approximation, $$x=-\frac{2\,k }{\pi }\,W_{-1}\left(-\frac{\pi }{8\,k}\right)\qquad \text{where} \qquad k=\text{agm}(1,x)\tag 1$$ where appears the second branch of Lambert function.
To check how good or bad is this approximation, give $x$ a value, compute $\text{agm}(1,x)$ and apply $(1)$ $$\left( \begin{array}{ccc} x_{given} & \text{agm}(1,x) & x_{calc} \\ 5 & 2.60401 & 4.94933 \\ 10 & 4.25041 & 9.97492 \\ 15 & 5.74991 & 14.9833 \\ 20 & 7.16581 & 19.9875 \\ 25 & 8.52468 & 24.9900 \\ 30 & 9.84096 & 29.9917 \\ 35 & 11.1236 & 34.9929 \\ 40 & 12.3787 & 39.9937 \\ 45 & 13.6105 & 44.9944 \\ 50 & 14.8223 & 49.9950 \\ 55 & 16.0167 & 54.9955 \\ 60 & 17.1955 & 59.9958 \\ 65 & 18.3605 & 64.9962 \\ 70 & 19.5129 & 69.9964 \\ 75 & 20.6539 & 74.9967 \\ 80 & 21.7844 & 79.9969 \\ 85 & 22.9053 & 84.9971 \\ 90 & 24.0173 & 89.9972 \\ 95 & 25.1209 & 94.9974 \\ 100 & 26.2167 & 99.9975 \end{array} \right)$$
If $x$ is mall, using simple Padé approximants, we have $$\frac{\pi (1+x)}{4 K\left(\left(\frac{1-x}{1+x}\right)^2\right)}=\frac{1+\frac{29 }{24}(x-1)+\frac{61}{192} (x-1)^2}{1+\frac{17 }{24} (x-1)+\frac{5}{192} (x-1)^2}$$ leading to $$x=\frac{55-63k-4 \sqrt{229 k^2-194 k+109}}{5 k-61}\qquad \text{where} \qquad k=\text{agm}(1,x)\tag 2$$ $$\left( \begin{array}{ccc} x_{given} & \text{agm}(1,x) & x_{calc} \\ 1.0 & 1.00000 & 1.00000 \\ 1.5 & 1.23734 & 1.50004 \\ 2.0 & 1.45679 & 2.00079 \\ 2.5 & 1.66450 & 2.50377 \\ 3.0 & 1.86362 & 3.01071 \\ 3.5 & 2.05604 & 3.52325 \\ 4.0 & 2.24303 & 4.04282 \\ 4.5 & 2.42546 & 4.57073 \\ 5.0 & 2.60401 & 5.10818 \end{array} \right)$$
$$x_{n+1}=x_n-\frac{2x_n(1+x_n)(agm(1,x_n)-y)}{agm(1,x_n)(1+x_n)(1-\frac{4}{(1+x_n)^2}\sum_{k=0}^{\infty}2^{k-1}c_k^2)-x_n}$$ and $c_k^2=a_{k+1}^2-b_{k+1}^2$ using the AGM iteration, $\lim_{n\to \infty}$ $x_n=agm^{-1}(y)$. For $x_0$ use $\frac{\pi}{2\ln(\frac{4}{x})}$ for $0<y<1$ and for larger values use $2x$ as $x_0$. Its also convergent for complex numbers.