On Mar 9, 2006, at 11:38 PM, Paul Rehill wrote:

Is there a known MBS or realbasic function for the standard normal
cumulative distribution function?
Thanks in advance

Function StdCumNormDist(x as double) As double
  Const a1 = 0.31938153
  Const a2 = -0.356563782
  Const a3 = 1.781477937
  Const a4 = -1.821255978
  Const a5 = 1.330274429
  Const pi = 3.1415926535897932384626433832795

  Dim L , K, w As double

  L = Abs(x)
  K = 1.0 / (1.0 + 0.2316419 * L)
w= 1.0 - 1.0 / Sqrt(2.0 * Pi) * Exp(-L * L / 2.0) * (a1 * K + a2 * K*K + a3 * Pow(K, 3) + a4 * Pow(K , 4) + a5 * Pow(K, 5))

  If x < 0.0 Then w= 1.0  - w

  return w
End Function

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to