Guest User

Untitled

a guest
Jul 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public double pdf_norm(double x)
  2. {
  3. return (1 / Math.Sqrt(Math.PI)) * Math.Exp(-1 * (Math.Pow(x, 2) / 2));
  4. }
  5.  
  6. public double cdf_norm(double x)
  7. {
  8. double[] bValues = [0.2316419, 0.319381530, −0.356563782, 1.781477937, −1.821255978, 1.330274429];
  9.  
  10. double t = 1 / (1 + bValues[0]*x);
  11.  
  12. return 1 - pdf_norm(x)*(bValues[1]*t + bValues[2]*Math.Pow(t,2) + bValues[3]*Math.Pow(t,3) + bValues[4]*Math.Pow(t,4) + bValues[5]*Math.Pow(t,5));
  13. }
Add Comment
Please, Sign In to add comment