C  ERROR FUNCTION (HASTINGS APPROXIMATION)
      FUNCTION ERFF (A)
      DATA A1/0.070523078/,A2/0.042282012/,A3/0.0092705272/
      DATA A4/0.0001520143/,A5/0.0002765672/,A6/.0000430638/
      DATA C/1./
      C=SIGN(C,A)
      Z=ABS(A)
      IF (Z.LT..000001) GO TO 1
      IF (Z.GT.4.) GO TO 2
      ERR=((((((A6*Z+A5)*Z+A4)*Z+A3)*Z+A2)*Z+A1)*Z+1.)**16
      ERR=ABS(1.-(1./ERR))
      ERFF=ERR*C
      RETURN
 1    ERFF=0.
      RETURN
 2    ERFF=C
      RETURN
      END
