home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / maths / progs / programs / Maths2 / Brian / erfc < prev    next >
Encoding:
Text File  |  1990-04-08  |  409 b   |  9 lines

  1. DEF FNerfc(X)
  2. REM Returns the complementary error function erfc(X) with
  3. REM fractional error everywhere less than 1.2E-7.
  4. REM From Numerical Recipes (Fortran) p 164.
  5. Z = ABS (X)
  6. LOCAL ANS: LOCAL T: T=1/(1+0.5*Z)
  7. ANS=T*EXP(-Z*Z-1.26551223+T*(1.00002368+T*(0.37409196+T*(0.09678418+T*(-0.18628806+T*(0.27886807+T*(-1.13520398+T*(1.48851587+T*(-0.82215223+T*0.17087277)))))))))
  8. IF X >= 0 THEN = ANS ELSE = 2-ANS
  9.