Computing nested functions to arbitrary precision

51 Views Asked by At

Let's say I want to compute $e^\pi$ to arbitrary precision. I have a function $pi()$ which computes $\pi$ to arbitrary precision and $exp(x)$ which computes $e^x$ to arbitrary precision. Now, how can I combine the two? Let's say I want to compute $e^\pi$ to 50 decimal places. How do I know to which precision I first need to compute $pi()$ such that the result of $exp()$ is accurate?

1

There are 1 best solutions below

0
On

The error in $f(x)$ when computing with an approximate $x^*$ is (mean value theorem):

$\begin{align*} f(x) - f(x^*) &\approx f'(x) (x - x^*) \end{align*}$

You know the approximate value of $f(x)$, and thus the allowable error to get 50 digits, that gives an idea of the $x - x^*$ allowable (digits in $x$).