Post Reply 
Calculating e^x-1 on classic HPs
01-14-2016, 06:42 PM (This post was last modified: 01-14-2016 07:10 PM by Dieter.)
Post: #18
RE: Calculating e^x-1 on classic HPs
(01-14-2016 03:55 PM)emece67 Wrote:  
(01-14-2016 01:48 PM)Dieter Wrote:  I did a few test runs on a 34s in SP mode with 100000 random numbers each. (...)

I'm really curious, how do you do such tests?

Simple. Write a short test program on the 34s emulator (the "real thing" is quite fast, but too slow for tasks like this). Evaluate ex–1 for a random argument within the desired domain, using the method you want to test. Then determine the difference to the exact result provided by the internal function. The result is an integer (the number of ULPs the approximation is off). Increment one of, say, 11 registers that count the number of occurences for ≤–5, –4, –3, ... , +4, ≥+5 ULP. Do this 100.000 times. ;-)

Using the same seed for the random number generator, this is what I got for the Kahan method resp. the one suggested in this thread. The results of the two different runs are quite similar.

Code:
seed = 4711  n = 100000        seed = 0,815 n = 100000

ULP   Kahan   alternate        ULP   Kahan   alternate
-----------------------        -----------------------
≤-5      54           4        ≤-5      57           2
 -4      58          86         -4      60         101
 -3     316          80         -3     331          58
 -2    4568          77         -2    4580          74
 -1   22176       16796         -1   22325       16788
 ±0   45522       66011         ±0   45193       65769
 +1   22215       16691         +1   22323       16935
 +2    4617          71         +2    4667          69
 +3     333          70         +3     326          78
 +4      71         113         +4      64         126
≥+5      70           1        ≥+5      74           0

Re. the meaning of the two seed values, cf. this thread. ;-)

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 06:42 PM



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