Accurate Normal Distribution for the HP67/97
|
12-11-2018, 02:33 PM
(This post was last modified: 12-12-2018 02:52 PM by Albert Chan.)
Post: #28
|
|||
|
|||
RE: Accurate Normal Distribution for the HP67/97
Discovered a simpler and faster 1 Exp method.
Instead of correcting Z(x) to Z(x+h) via Taylor expansion of Z(x+h), do this: Z(x+h) / Z(x) = exp(-½(x+h)² + ½(x²)) = exp(-x h - h²/2) = exp(y) exp(y) = 1 + y + y²/2 + y³/6 + ... |y| ~ |x h|, a very small number, above ... can be ignored. PHP Code: double pdf(double z) // 1 Exp method, revised Note: for calculator program, return z * (1. + y) instead Calculator might underflow the correction term. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)