Post Reply 
Calculating e^x-1 on classic HPs
01-14-2016, 01:44 PM
Post: #14
RE: Calculating e^x-1 on classic HPs
(01-14-2016 02:47 AM)Gerson W. Barbosa Wrote:  Still not elegant, but I decided to try a series approach. Starting with an empirical approximation (I noticed e^x - 1 ~ e^(ln(x) + x/2) for small x), I came up with a new Taylor series -- Well, at least apparently W|A missed it... Smile

Bernoulli numbers? Waaaayyyy to complicated. ;-)

(01-14-2016 02:47 AM)Gerson W. Barbosa Wrote:  Only four terms of the summand would suffice for 10-digit calculators in the specified range (five terms for 12-digit calculators).

Maybe you can take a look at the CF method in post #4. No transcendetal functions (except when e^x–1 is calculated the trivial way outside of the critical domain) and four loops will do for 10 digits as well.

(01-14-2016 02:47 AM)Gerson W. Barbosa Wrote:  2 LN EXM1 -> 1.
1.23E-8 EXM1 -> 1.23000000759E-8
-0.1 EXM1 RE -> -9.51625819644E-2
-0.1 EXPM -> -.095162581964 ; built-in EXPM function
1.23E-8 EXPM -> 1.2300000076E-8

For the record: the exact 12-digit results are
 1
 1,23000000756 E-8
-9,51625819640 E-2


The method I suggested happens to return exactly these results. I did some further tests with several runs of 100.000 random numbers in [ln 0,9, ln 2] on a 34s in SP mode (16 digits) which showed that about 2/3 of the results were dead on an 99,5% within 1 ULP. However, there are rare cases where the result may be off by several ULP.

BTW, does the built-in EXPM function really return 1.2300000076 E-8, i.e. +4 ULP compared to the true result?

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 - 01-14-2016 01:44 PM



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