Post Reply 
Calculating e^x-1 on classic HPs
02-03-2019, 06:46 PM
Post: #38
RE: Calculating e^x-1 on classic HPs
(02-02-2019 07:32 PM)Albert Chan Wrote:  
(01-13-2016 03:46 PM)Gerson W. Barbosa Wrote:  \[e^{x}-1=\frac{2}{\coth \frac{x}{2}-1}\]
... this will require two additional steps to handle x=0

Is there any reason to use a possible divide-by-0 coth(x/2) ?

If t = tanh(x/2), we have exp(x) - 1 = 2 t / (1 - t), avoided the singularity.

Both methods suffer from digit cancellation for large x where coth and tanh both tend towards 1. That's why I prefer the original method in the first post. But maybe this can also cause numeric problems – did you find any?

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calculating e^x-1 on classic HPs - Dieter - 01-11-2016, 10:20 PM
RE: Calculating e^x-1 on classic HPs - Dieter - 02-03-2019 06:46 PM



User(s) browsing this thread: 13 Guest(s)