Calculating e^x-1 on classic HPs
|
01-16-2016, 01:32 PM
(This post was last modified: 01-16-2016 02:02 PM by Dieter.)
Post: #35
|
|||
|
|||
RE: Calculating e^x-1 on classic HPs
(01-16-2016 12:40 PM)Gerson W. Barbosa Wrote: This appeared to work, but some cancellation occurs at a critical region: Or a few hundred, or a few thousand... ;-) (01-16-2016 12:40 PM)Gerson W. Barbosa Wrote: (...) It works better after replacing ex – e–x with 2 sinh(x) – provided an accurate sinh function is available. I tried this on the 34s and in 100.000 random samples there were no errors beyond ±7 ULP. About 75% of the results were within ±1 ULP. Finally I did a test run with one million random values in [ln 0.9, ln 2] with the method I suggested, and the results are essentially the same as before: Code: seed = 47,11 n = 1000000 Again, there are two peaks at +4 and –4 ULP that also showed up in earlier tests. I wonder where these come from. Any idea? As already mentioned, for arguments in [ln10, ln11[ or [ln100, ln101[ etc. the last digit is lost, which leads to an interesting error distribution. Here are some results for x in [ln10, ln11]: Code: seed = 47,11 n = 100000 As expected, the errors are evenly distributed in this interval. Again, they do not exceed ±5 ULP. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)