Post Reply 
Calculating e^x-1 on classic HPs
01-14-2016, 07:20 AM
Post: #13
RE: Calculating e^x-1 on classic HPs
A nice identity using hyperbolics is: ex-1 = tanh(x/2) (ex+1)

The 34S uses:

Code:

    u = e^x
    v = u - 1
    if v = 0, return x
    if v = -1, return -1
    return v * x / ln(u)

As William Kahan said of this: nearly full working relative accuracy despite cancellation no matter how tiny x may be.

Dieter's method avoids the conditionals which is a plus for some machines.


- Pauli
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 - Paul Dale - 01-14-2016 07:20 AM



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