Post Reply 
Accurate Normal Distribution for the HP67/97
06-29-2016, 10:04 PM (This post was last modified: 07-03-2016 02:42 PM by Dieter.)
Post: #5
RE: Accurate Normal Distribution for the HP67/97
(06-27-2016 07:10 AM)Paul Dale Wrote:  Big Grin

Yes, I really like the 34s for its sheer accuracy. Too bad the number of available registers does not allow anything larger than 9x9 matrices. Maybe I have to switch to Free42 for this. ;-)

FWIW, after some more calculations (again on the 34s) I finally got something that should be close to the optimum under the given restrictions. Using sufficient precision, the relative error drops to ±1,7 E–10. To give you a visual impression, the error graph looks like this (click to view full size graphics).

   

Blue: rational approximation, red: continued fraction with offset. The thin white lines define the 1,7 E–10 error interval.

This result is achieved by changing the following values in the program listed in the initial post:
  • Use the following set of coefficients for the rational approximation:
    Code:
    a1 = 7,913810547 E-01
    a2 = 3,066963490 E-01
    a3 = 6,190166490 E-02
    a4 = 5,536871364 E-03
    b1 = 3,178531251
    b2 = 2,149493336
    b3 = 7,815107111 E-01
    b4 = 1,552413763 E-01
    b5 = 1,387643665 E-02
     
  • Change the threshold for the switch between rational approximation and continued fraction from 5 to 4,679.
     
  • Change the offset of the first continued fraction term from 1,38 to 1,422.

Due to the limited precision there is not much improvement in the 67/97 program, but maybe the values can be useful for an implementation on a different calculator.

Dieter

Edit: tweaked some coefficients in their last digit
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 - Dieter - 06-29-2016 10:04 PM



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