I recognize this isn't a straight forward sports related question, but it came out of another thread. It involves the use of the NORMSDIST in Excel. I need to replicate this function in a PowerBasic program. From Excel, the following formula returns the correct value;
f(z)= (1/sqrt(2*pi)) * e^(-z^2/2)
I used the function in a spreadsheet and got the following correct answer;
Test Value 1.3333
normsdist results 0.9087833
To use it in a program I attempted to replicate the function by dividing it into two factors and multiplying them as follows;
2*pi 6.28318
square root 2.5066272
fac1 0.3989424
value squared 1.7776889
divide by 2 0.8888444
negative -0.8888444
fac2 (EXP) 0.4111306
product fac1*fac2 0.1640174
This does not match the correct answer.
OK someone with sharp eyes tell me where I've gone wrong. I've looked at this for 3 hours and can't see it.
f(z)= (1/sqrt(2*pi)) * e^(-z^2/2)
I used the function in a spreadsheet and got the following correct answer;
Test Value 1.3333
normsdist results 0.9087833
To use it in a program I attempted to replicate the function by dividing it into two factors and multiplying them as follows;
2*pi 6.28318
square root 2.5066272
fac1 0.3989424
value squared 1.7776889
divide by 2 0.8888444
negative -0.8888444
fac2 (EXP) 0.4111306
product fac1*fac2 0.1640174
This does not match the correct answer.
OK someone with sharp eyes tell me where I've gone wrong. I've looked at this for 3 hours and can't see it.