How to calculate $e^\pi$ by hand?

473 Views Asked by At

There are some ways to find the values of the form "rational power of rational number" what about nonrecurring numbers? Is there any way to calculate that?

2

There are 2 best solutions below

0
On

There are many ways you could compute such a number. One way could be to take a close rational approximation: $\pi=\frac{a}{b}$. Your goal would then be to find the number $x$, such that $x=e^{a/b}$. This equation could be rearranged to $x^b-e^a=0$, which you could tackle with root-finding algorithms and an appropriate approximation for $e$.

For example, you could use $\pi\approx\frac{22}{7}$, to get $x^{7}-e^{22}=0$, and then use a sequence such as $x_{n+1}=x_n-\frac{x_n^7-e^{22}}{7x_n^{6}}$. With a perfect approximation for $e^{22}$, this sequence gives you an answer with just $0.13\%$ relative error. Using more precise rational approximations would improve your result but would be harder to compute.

0
On

Just to make user190080's point explicit, if $k_0:=\frac{1}{\sqrt{2}},\,k_{n+1}:=\frac{1-\sqrt{1-k_n^2}}{1+\sqrt{1-k_n^2}}$ then $(4/k_{n+1})^{2^{-n}}\to e^\pi$ as $n\to\infty$. The square-rooting can be done with a famous method that's a special case of Newton-Raphson; if $y\approx\sqrt{z}$, a better approximation of $\sqrt{z}$ is $(y+z/y)/2$.

But what is you wanted something other than literally the example of $e^\pi$? You can use the Taylor series of $\exp x$, ensuring the argument is small enough for rapid convergence by using $\exp x = (\exp x/2)^2$ repeatedly.

What if you don't want $\exp x$ but $a^x=\exp (x\ln a)$? You can compute logarithms in a similar way; $\ln (1+x)$ has a Taylor series for $|x|<1$, so use $\ln x=2\ln\sqrt{x}$ if need be. (I discussed square-rooting above.)