Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So if the following function is evaluated with the floating-point arithmetic, we get poor results for certain range of values of $x$. Therefore, I need to provide an alternate function that can be used for those values of $x$. The function is: $$f(x)=e^x-1$$ So how would I make an alternate expression or function for this. The range of this function is $y\gt -1$, $y\in\mathbb{R}$. So would I use the Taylor series for this....?

share|cite|improve this question
Have you learned anything from the comments and answers to your other question that would help you with this?… – Gerry Myerson Feb 13 '12 at 3:21
i do understand that...but this is a slightly different function....and Conjugate would not work for this...So I am thinking Taylor series would work. – A_1_615 Feb 13 '12 at 3:28
When you say does not work for certain values of $x$, you should also tell which ones and what exactly you mean by 'does not work'! Also, you write $f$, but talk about $y$. – Aryabhata Feb 13 '12 at 3:32
The advanced HP calculators (48, 49, 50) have built in functions for exp(x)-1 and ln(1+x) for exactly this reason: improved accuracy around x = 0. – marty cohen Feb 13 '12 at 5:28
Yes, I read the post, and I also read your comment: "...and Conjugate would not work for this..." so, yes, you sure as heck did mention "Conjugate" here. – Gerry Myerson Feb 14 '12 at 4:50

$$\begin{align*} \exp\,x-1&=\left(\exp\frac{x}{2}\right)^2-1\\ &=\left(\exp\frac{x}{2}\right)\left(\exp\frac{x}{2}-\exp\left(-\frac{x}{2}\right)\right)\\ &=2\left(\exp\frac{x}{2}\right)\left(\frac12\left(\exp\frac{x}{2}-\exp\left(-\frac{x}{2}\right)\right)\right)\\ &=2\left(\exp\frac{x}{2}\right)\left(\sinh\frac{x}{2}\right) \end{align*}$$

If your computing environment supports the hyperbolic sine, the expression derived here should be sufficiently stable for numerical evaluation...

share|cite|improve this answer
The numerical stability in evaluating the function derived here is left for the OP to explain. – J. M. Feb 13 '12 at 3:38
how would i find the taylor series..... for the e^x-1.... I know how to find it for e^x...just not sure about e^x-1 and in the fucntion above basically for x=0....this represents a problem.... – A_1_615 Feb 14 '12 at 0:52
@A_1_615: if as you claim you know how to find the series expansion of $\exp\,x$, then it's just as simple as subtracting $1$ from your series... – J. M. Feb 14 '12 at 1:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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