    PROGRAM nag_err_fun_ex01

      ! Example Program Text for nag_err_fun
      ! NAG fl90, Release 4. NAG Copyright 2000.

      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_out
      USE nag_err_fun, ONLY : nag_erf, nag_erfc, nag_dawson
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND
      ! .. Parameters ..
      INTEGER, PARAMETER :: n = 11
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      ! .. Local Scalars ..
      INTEGER :: i
      REAL (wp) :: dawson_x, erfc_x, erf_x
      ! .. Local Arrays ..
      REAL (wp) :: x(n)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_err_fun_ex01'

      WRITE (nag_std_out,*)
      WRITE (nag_std_out,*) '      x         erf(x)      erfc(x)      F(x)'
      x = (/ -10.0_wp, -6.0_wp, -4.5_wp, -1.0_wp, -0.5_wp, 0.0_wp, 1.0_wp, &
       2.5_wp, 4.0_wp, 6.0_wp, 10.0_wp/)

      DO i = 1, n

        erf_x = nag_erf(x(i))
        erfc_x = nag_erfc(x(i))
        dawson_x = nag_dawson(x(i))

        WRITE (nag_std_out,fmt='(1X,1P,4E12.3)') x(i), erf_x, erfc_x, dawson_x
      END DO

    END PROGRAM nag_err_fun_ex01
