Post Reply 
Accurate Normal Distribution for the HP67/97
12-09-2018, 08:17 PM (This post was last modified: 12-10-2018 10:25 AM by Albert Chan.)
Post: #26
RE: Accurate Normal Distribution for the HP67/97
Above 1 Exp method, if done on the computer, is almost as fast as direct method.
In other words, the extra precision almost without cost. Smile

PHP Code:
double pdf(double z)            // 1 Exp method
{
    
double x = (float) z;       // clear low bits
    
double y z;           // y = -h
    
double y2 y;
    
0.3989422804014327 exp(-0.5 x);
    
*= y;                     // correction 1
    
0.5 * (x+y) * (x-y);    // correction 2
    
+= + (1./3) * x*(y-y2); // correction 3
    
return z;


Updated: fix typo in constant 1/√(2 Pi)
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 - Albert Chan - 12-09-2018 08:17 PM



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