Post Reply 
(50g) Normal Distribution
12-06-2018, 08:30 PM (This post was last modified: 12-07-2018 11:52 PM by Albert Chan.)
Post: #13
RE: (50g) Normal Distribution
Hi, John Keith

You are right. On a calculator, 3 Exp method maybe faster.

I did the test on the computer. Cost of PDF function is dominated by Exp.
2 Exp method take 2X as long, 3 Exp method take 2.83X (using C language)

"Splitting" factor 1/√(2 pi) inside Exp reduce error somewhat:

PHP Code:
def pdf(xk=0.08106146679532726exp=math.expfloor=math.floor):
    
0.5 floor(x# k = 1 - ln(√(2 pi))
    
xi floor(x)          # same k for binary or decimal float
    
xf xi
    
return exp(-1.) * exp(0.5*xi*xi xi*xf 0.5*xf*xf k
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(50g) Normal Distribution - John Keith - 12-03-2018, 04:20 PM
RE: (50g) Normal Distribution - Dieter - 12-03-2018, 07:05 PM
RE: (50g) Normal Distribution - John Keith - 12-03-2018, 08:45 PM
RE: (50g) Normal Distribution - Dieter - 12-03-2018, 10:18 PM
RE: (50g) Normal Distribution - John Keith - 12-03-2018, 10:59 PM
RE: (50g) Normal Distribution - John Keith - 12-04-2018, 08:54 PM
RE: (50g) Normal Distribution - Dieter - 12-04-2018, 09:48 PM
RE: (50g) Normal Distribution - Dieter - 12-05-2018, 08:49 PM
RE: (50g) Normal Distribution - John Keith - 12-06-2018, 02:58 PM
RE: (50g) Normal Distribution - Dieter - 12-06-2018, 11:08 PM
RE: (50g) Normal Distribution - John Keith - 12-07-2018, 11:21 PM
RE: (50g) Normal Distribution - Albert Chan - 12-06-2018 08:30 PM
RE: (50g) Normal Distribution - Dieter - 12-06-2018, 10:54 PM
RE: (50g) Normal Distribution - John Keith - 12-08-2018, 07:13 PM
RE: (50g) Normal Distribution - Dieter - 12-08-2018, 09:18 PM
RE: (50g) Normal Distribution - John Keith - 12-08-2018, 09:28 PM
RE: (50g) Normal Distribution - John Keith - 01-26-2019, 10:01 PM
RE: (50g) Normal Distribution - pier4r - 01-26-2019, 10:12 PM



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