Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
    
Have you learned anything from the comments and answers to your other question that would help you with this? math.stackexchange.com/questions/108678/… –  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
1  
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
1  
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
show 3 more comments

1 Answer

$$\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|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
add comment

Your Answer

 
discard

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.