$$ T_k (x) = \sum_{n=0}^K \frac{x^n }{n!}$$

is the Taylor expansion for the exponent function around zero.

"The Taylor polynomial TK is a good approximation to the exponent function when x is rather small in magnitude. When x is large in magnitude, $exp(x)$ can still be approximated by picking a sufficiently large integer m in such a way that $x/2^m $ is sufficiently small in magnitude and approximating $$exp(x) = exp(x/2^m)^{2^m}$$ by $$exp(x) = T_k(x/2^m)^{2^m}$$"

I do not understand the last two equations. Why do we raise the first one to the power of ($x/2^m$) and then that is approximated by $$exp(x) = T_k(x/2^m)^{2^m}$$

Can someone please explain it to me?

  • 1
    $\begingroup$ Looks as if the power should have been $2^m$ rather than $2m$. The power $2^m$ is numerically cheaper to use. $\endgroup$ – H. H. Rugh Oct 28 '16 at 9:07
  • $\begingroup$ Can you be more precise? Is it that you don't actually understand why the equations are true, or you don't understand the motivation for considering those equations, or you don't understand what you will do with those equations, or something else? $\endgroup$ – user14972 Oct 28 '16 at 9:09
  • $\begingroup$ Yes it is $2^m$ Thanks for pointing that out! $\endgroup$ – Samu Oct 28 '16 at 9:10
  • $\begingroup$ I don't understand the logic with using $2^m$ to start with, but pretty much all of the above you mentioned :/ $\endgroup$ – Samu Oct 28 '16 at 9:11
  • $\begingroup$ Suppose you want to calculate $a^{16}$: $a \times a \times a \times a \times a \times a \times a \times a \times a \times a \times a \times a \times a \times a \times a$ involves $15$ multiplications while $(((a^2)^2)^2)^2$ involves $4$ multiplications $\endgroup$ – Henry Oct 28 '16 at 9:20

Possibly not the simplest answer but here are some estimates: You have $$\left(\exp\left(\frac{x}{2^m}\right)\right)^{2^m}=\exp\left(\frac{x}{2^m} 2^m\right)=\exp(x)$$ Then $$\left(T_k\left(\frac{x}{2^m}\right)\right)^{2^m} = \left(T_k\left(\frac{x}{2^m}\right)/\exp\left(\frac{x}{2^m}\right)\right)^{2^m}\exp(x)$$ When $x/2^m$ is much smaller than one then $T_k\left(\frac{x}{2^m}\right)/\exp\left(\frac{x}{2^m}\right)\approx 1- \frac{(x/2^m)^{k+1}}{(k+1)!}$ and then $$\left(T_k\left(\frac{x}{2^m}\right)/\exp\left(\frac{x}{2^m}\right)\right)^{2^m}\approx 1 -\frac{x^{k+1}}{2^{mk}}{(k+1)!} $$ so choosing $m$ large the relative error becomes very small. As an example calculating $\exp(10)$ to 5 decimal places you need in a direct Taylor expansion around 36 terms. But suppose you set $a=\frac{10}{1024}= \frac{10}{2^{10}}$. Then $$\exp(10)= \exp\left(a\right)^{1024} = (1+a+a^2/2+a^3/6+a^4/24)^{1024} $$ is also correct to around 5 decimal places. Calculating powers of 1024 is relatively cheap because it amounts to taking 10 times a square: $x^{1024}=((..(x^2)^2)^2)^2)^2)^2)^2)^2)^2)^2$.

  • $\begingroup$ Thank you for your answer. Could you please explain the second equation (after "Then..."). and why you divide with the $exp(x/2^m)$ and multiply with $exp(x)$? $\endgroup$ – Samu Oct 28 '16 at 9:40
  • $\begingroup$ If you expand the RHS, using $(u/v)^p=u^p/v^p$, and use the first equation you arrive at the stated identity. Why doing this? Because we hereby separate into the factor $\exp(x)$ (which is what we wanted) and a factor which we need to show is close to one [and that's what I do afterwards]. $\endgroup$ – H. H. Rugh Oct 28 '16 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.