    PROGRAM g01kffe

!      G01KFF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : g01kff, nag_wp
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nin = 5, nout = 6
!      .. Local Scalars ..
       REAL (KIND=nag_wp)              :: a, b, f, x
       INTEGER                         :: ifail
!      .. Executable Statements ..
       WRITE (nout,*) 'G01KFF Example Program Results'
       WRITE (nout,*)

!      Skip heading in data file
       READ (nin,*)

!      Display titles
       WRITE (nout,*) '      X            A            B          RESULT'
       WRITE (nout,*)

D_LP:  DO
          READ (nin,*,IOSTAT=ifail) x, a, b
          IF (ifail/=0) THEN
             EXIT D_LP
          END IF

          ifail = 0
          f = g01kff(x,a,b,ifail)

!         Display results
          WRITE (nout,99999) x, a, b, f
       END DO D_LP

99999  FORMAT (1X,1P,4(1X,E12.4))
    END PROGRAM g01kffe
