Post Reply 
Calculating e^x-1 on classic HPs
01-14-2016, 03:30 PM
Post: #16
RE: Calculating e^x-1 on classic HPs
(01-14-2016 01:44 PM)Dieter Wrote:  
(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. ;-)

You are quite right! Anyway, that was not supposed to be a valid method. I just liked the series, despite its uselessness :-)

(01-14-2016 01:44 PM)Dieter Wrote:  
(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?

I'd made a mistake. Fixed. Thanks!

Gerson.
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 - Gerson W. Barbosa - 01-14-2016 03:30 PM



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