      REAL*8 function erfc(x)
c
c     define complementary error function in terms of series
c     expansion for the error function:erf
c
c     formula number 7.1.26 from abramowitz and stegen
c     error less than 1.5e-7
c
c
      IMPLICIT REAL*8(A-H,O-Z)
      IMPLICIT INTEGER*4(I-N)
C
      p = .3275911
      a1 = .254829592
      a2 = -.284496736
      a3 = 1.421413741
      a4 = -1.453152027
      a5 = 1.061405429
c
      t = 1.0 / (1.0 + p*x)
c
      erf = 1.0 - (a1*t + a2*t**2 + a3*t**3 + a4*t**4
     1          +  a5*t**5) * exp(-x**2)
      erfc = 1.0 - erf
      return
      end

