Post Reply 
Accurate Normal Distribution for the HP67/97
12-16-2018, 07:53 PM
Post: #43
RE: Accurate Normal Distribution for the HP67/97
(12-15-2018 06:38 PM)Dieter Wrote:  Then you have found your best way to round the input. And indeed rounding to 6 significant digits may be the best choice here. The square of such a number is exact, and the division by 2 will still be exact if the mantissa of x² does not exceed 2. This is true if the mantissa of x does not exceed √20, i.e. up to 4,47213. Which accounts for 44,72% of all possible x. The remaining 55,28% are also exact if the final digit of x² is even. Otherwise the value of x²/2 may be 1/2 ULP high. So an error only occurs in only 27,64% of all cases, and even if this happens the result if only half an ULP off. I have not analyzed what this means for the final Z(z) result, but a slight error in the last digit may always remain in such calculations.

After all there is no guarantee that the ex function is accurate to half an ULP. Take a look at the 15C Advanced Functions Handbook where the possible errors of different functions are explained in detail. Here an error of slightly more than 1 ULP (but less than 3 ULP) is possible.

Please correct me if I'm wrong here. ;-)

Dieter

I certainly did not make that detailed of an analysis but it seemed to me intuitively that Albert's method double x = (float) z discards exactly half of the significant bits. Similarly -6 RND discards half of the significant (BCD) digits in a 12-digit calculator.

Nonetheless, the 1-Exp method implemented as above had errors as large as 34 ULPs with some inputs, whereas the 2-Exp method never had more than 1 ULP of error in all of the inputs I tried. I certainly may have made some errors in my implementation but the 2-Exp method works better for me even though the program is larger and slower.

I also noticed that Albert made a couple of new posts in the HP 50 thread which I will have to check out.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Accurate Normal Distribution for the HP67/97 - John Keith - 12-16-2018 07:53 PM



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