home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / NMDT.C < prev    next >
Encoding:
Text File  |  1984-08-29  |  414 b   |  17 lines

  1.    nmdt(x,p)
  2.  
  3.       /* accumulative normal distribution function.  */
  4.  
  5.       float x,*p;
  6.  
  7.    {
  8.       static float a[3]={.4361836,-.120676,.9372980};
  9.       float r = .33267, e = .367879, f = .3989423;
  10.       float t;
  11.       extern double fabs(),pow();
  12.  
  13.       t = 1.0 / (1.0 + r * fabs(x));
  14.       *p = (f * pow(e,(x*x*0.5))) * t *(a[0] + t * (a[1] + t * a[2]));
  15.       if (x >= 0.0) *p = 1. - *p;
  16.    }
  17.