# best approximation of $\sqrt{2}$

The approximation \begin{align} \sqrt{2} &\approx \frac{1}{8} \operatorname{csch}\left(\frac{3\pi}{2}\right) \operatorname{sech}^3(\pi) \, \left[2+3 \, \sinh\left(\frac{\pi}{2}\right)-\sinh\left(\frac{3\pi}{2}\right) \right. \\ & \hspace{10mm} \left. +3 \, \sinh\left(\frac{5\pi}{2}\right)+\sinh\left(\frac{9\pi}{2}\right)-2 \,\cosh(\pi)+2 \,\cosh(2\pi)+2 \,\cosh(4\pi)\right] \end{align} gives the first $8$ correct digits of $\sqrt{2}$. Is this the best approximation of square root 2 in terms of hyperbolic functions? If not,then please find more examples of this type.

• $10^{10} \sinh \frac{\sqrt{2}}{10^{10}}$? (That's a bit cheating, I know -- but what exactly are the "primitives" you allow in the formula? $\pi$, what else?) – Clement C. Aug 6 '15 at 16:31
• @ClementC. Isn't that somehow circular? – Hasan Saad Aug 6 '15 at 16:33
• @HasanSaad Oh, completely. But using $\pi$ already looks quite permissive to me, and unless you have restrictions ("only use small integers," etc), cheating in such a way (maybe a bit more cleverly) is possible... – Clement C. Aug 6 '15 at 16:33
• Yes there should be pi – Nicco Aug 6 '15 at 16:34
• But you need to have both $e$ and $pi$ very accurate. Errors in $e$ and $\pi$ give errors in the result. If you want to have $\sqrt{2}$ up to 8 decimals, you would need to have both $e$ and $\pi$ up to... what? – johannesvalks Aug 6 '15 at 17:19

By exploiting the elliptic lambda function, we have: $$\sqrt{2} = 2\cdot \frac{\theta_2^2(0,e^{-\pi})}{\theta_3^2(0,e^{-\pi})}$$ and by exploting the expansions of the Jacobi theta functions we have: $$\sqrt{2} \approx 2\,\left(\frac{2-2e^{5\pi}+2e^{8\pi}-e^{9\pi}}{2+2 e^{5 \pi }+2 e^{8 \pi }+e^{9 \pi }}\right)^2$$ that looks way better and is right up to $14$ digits.

• It's lovely,moreover the elliptic lambda function is related to the continued fraction from which I derived the approximation I asked about, – Nicco Aug 6 '15 at 18:03

First, replace $\operatorname{csch}$ and $\operatorname{sech}$ with $1 / \sinh$, $1 / \cosh$. Approximation in terms of hyperbolic functions ($\cosh x = \frac{e^x + e^{-x}}{2}, \sinh x = \frac{e^x - e^{-x}}{2}$), is then equivalent to approximation by powers of $e$, since \begin{align*} e^x &= \cosh x + \sinh x \\ e^{-x} &= \cosh x - \sinh x \end{align*} Moreover, you appear to be only considering $\sinh$ and $\cosh r\pi$, where $r$ is rational. This will correspond to $e^{r\pi}$, with $r$ rational. So what you are really asking is: How well can we approximate $\boldsymbol{\sqrt{2}}$ by combining (through addition, multiplication, and division) rational multiples of rational powers of $\boldsymbol{e^{\pi}}$? (If you weren't allowing $\operatorname{csch}$ and $\operatorname{sech}$, it would just be addition and multiplication.)

Answer: $e^\pi$ is known as Gelfond's constant, and is transcendental. Because of this, there is no way to get $\sqrt{2}$ exactly as a sum/product/quotient of powers of it; this would imply that it was algebraic, since $\sqrt{2}$ is algebraic.

However, it is certainly possible to get arbitrarily close to $\sqrt{2}$. In fact, you can get arbitrarily close just by using $r \left(e^\pi\right)^0 = r$, i.e. just with rational numbers. See Diophantine approximation and the continued fraction for $\sqrt{2}$. Since it is possible to get arbitrarily close and impossible to get exactly to $\sqrt{2}$, the approximation you list (nor any other approximation) will be the best approximation for $\sqrt{2}$ using hyperbolic functions.

• The approximation is actually the third convergent of a certain ramanujan-type continued fraction,see math.stackexchange.com/questions/1381070/… your answer does make a lot of sense.But I would be happy to see more examples of this type. – Nicco Aug 6 '15 at 17:04

$$\frac35+\frac{\pi}{7-\pi}-\sqrt2=10^{-6}\times6.495680826...$$

This is also interesting:

$$\frac{131836323}{93222358}-\sqrt2=4\times10^{-17}$$

• Love it because it is so simple! – FundThmCalculus Aug 6 '15 at 17:54
• I like it a lot too :-) one could play around and find such approximations for $\sqrt 3$, $\sqrt 5$ and probably other roots ... – Math-fun Aug 6 '15 at 17:55

$$\sqrt {2}=-5\,\tanh \left( 1/2 \right) -{\frac {23\,\tanh \left( 3/2 \right) }{5}}+{\frac {21\,\tanh \left( 5/2 \right) }{5}}+{\frac {42\, \tanh \left( 7/2 \right) }{5}}-6\,\tanh \left( 1/3 \right) -{\frac {23 \,\tanh \left( 4/3 \right) }{5}}+\frac{4\,\tanh \left( 5/3 \right)}5 -3\, \tanh \left( 7/3 \right) -\dfrac{3\,\tanh \left( 1/4 \right)}{5} +\frac{9\,\tanh \left( 3/4 \right)}{5} +{\frac {28\,\tanh \left( 5/4 \right) }{5}}-{ \frac {13\,\tanh \left( 7/4 \right) }{5}}+\dfrac{\tanh \left( 1/5 \right)}5 +\dfrac{2\,\tanh \left( 2/5 \right)}{5}$$ with error about $5 \times 10^{-30}$.

• wow, where does that come from? +1 – Math-fun Aug 6 '15 at 19:38
• Maple's IntegerRelations package. – Robert Israel Aug 6 '15 at 23:48
• That seems like cheating, but I still love it. Wow. +1 for awesomeness. – FundThmCalculus Aug 7 '15 at 15:29

$$\sqrt{2}$$ has such a simple continued fraction that it's so boring to state one defining property of the number, its continued fraction, so I will instead show how to compute another property of that number, its binary notation in time O($$n^2)$$. I know an easy way to compute the binary notation of $$\sqrt{2}$$. Start with the ordered pair (1, 2). Compute the square of its average, 1.5. If it's more than 2, make the first coordinate of the next ordered pair be the first coordinate of that ordered pair and the second coordinate of the next ordered pair be the average of the first ordered pair. If it's less than 2, make the first coordinate of the next ordered pair be the average of that ordered pair and the second coordinate of the next ordered pair be the second coordinate of that ordered pair. Repeat the same process again and again. Each time you do it again, it's straight forward to determine another binary digit of $$\sqrt{2}$$.

Not only that but each of those operations can be done in linear time enabling you to compute the binary digits of $$\sqrt{2}$$ in only time O($$n^2$$). That's because for each positive integer $$n$$, once you have already computed the square of each of the coordinates in the $$n^{th}$$ ordered pair, you can recognize that the square of their average is just the average of their squares minus $$2^{-2n}$$ so you can just compute the square of their average in linear time.

• This does not answer the question. Nothing here addresses approximations in terms of hyperbolic functions. – Andrés E. Caicedo Oct 19 '18 at 14:46

The continued fraction for $\sqrt{2}$ is a fast rational approximation. Where $\sqrt{2}=1+ \frac{1}{2+ \frac{1}{2+ \frac{1}{\ddots}}}$. The eighth convergent according to wiki is 577/408, read more here.

• thanks for the link but I'm more interested in transcendental approximations – Nicco Aug 6 '15 at 17:24