Floating Point Arithmetic dealing with a Taylor expansion for e^-x Suppose we want to compute $e^{-a}$ for $a>>1$. Which of the following techniques should I use? 
(a) Taylor expansion for $e^{-x}$ about $x=0$ or
(b) Taylor expansion for $e^x$ about $x=0$, then take its reciprocal.
Would a Taylor expansion about $e^{-x}$ give cancellation? Is that what this question is getting at? 
 A: As a rule of thumb, the direct, naive evaluation of a sum $a_1+...+a_n$ will have accumulated floating point errors of a size $(|a_1|+...+|a_n|)\mu$ where $\mu$ is the floating point machine constant. In your case this means that the series evaluation of $e^x$ has a floating point error, additional to the truncation error, of $e^{|x|}\mu$. 


*

*This means that variant (a) computes $e^{-x}$, $x>0$, as $e^{-x}+e^{x}\delta$ with $|δ|\le μ$. For medium sized $x$ the error will surpass the value, making the result meaningless.

*In variant (b) the result is computed as $e^{-x}/(1+δ)$, which is acceptable for a floating point operation.

*Most actual algorithms implement variant (c), or a further refinement, where in $e^{-x}=2^n(1+m)$ the exponent $n$ is first computed as integer part of $x/\ln2$ and then an optimized interpolation polynomial over the interval $[0,1]$ is used for the exponential of the remainder  $x-n\ln2$.

*Another possibility is (d) to use the floating point form of $x=2^n(1+m)$ to compute $e^{-x}=(e^{-(1+m)/2})^{2^{n+1}}$ for $n>0$ via repeated squaring of the inner exponential.
