    PROGRAM x02ajfe

!      X02AJF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : nag_wp, x02ahf, x02ajf, x02akf, x02alf, x02amf, &
                               x02anf, x02bbf, x02bef, x02bhf, x02bjf, x02bkf, &
                               x02blf, x02daf, x02djf
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nout = 6
!      .. Local Scalars ..
       REAL (KIND=nag_wp)              :: largest_arg, largest_pos, machpr,    &
                                          safe_complex, safe_real, smallest_pos
       INTEGER                         :: largest_pos_int, model_b,            &
                                          model_emax, model_emin, model_p, prec
       LOGICAL                         :: model_r, underflow
!      .. Executable Statements ..
       WRITE (nout,*) 'X02AJF Example Program Results'
       WRITE (nout,*)
       WRITE (nout,*) '(results are machine-dependent)'
       WRITE (nout,*)
       WRITE (nout,*) 'The basic parameters of the model'
       WRITE (nout,*)
       model_b = x02bhf()
       WRITE (nout,99999) ' X02BHF = ', model_b, '  (the model parameter B)'
       model_p = x02bjf()
       WRITE (nout,99999) ' X02BJF = ', model_p, '  (the model parameter P)'
       model_emin = x02bkf()
       WRITE (nout,99999) ' X02BKF = ', model_emin, &
          '  (the model parameter EMIN)'
       model_emax = x02blf()
       WRITE (nout,99999) ' X02BLF = ', model_emax, &
          '  (the model parameter EMAX)'
       model_r = x02djf()
       WRITE (nout,99998) ' X02DJF = ', model_r, &
          '  (the model parameter ROUNDS)'
       WRITE (nout,*)
       WRITE (nout,*) 'Derived parameters of floating-point arithmetic'
       WRITE (nout,*)
       machpr = x02ajf()
       WRITE (nout,99997) ' X02AJF = ', machpr, '  (the machine precision)'
       smallest_pos = x02akf()
       WRITE (nout,99997) ' X02AKF = ', smallest_pos, &
          '  (the smallest positive model number)'
       largest_pos = x02alf()
       WRITE (nout,99997) ' X02ALF = ', largest_pos, &
          '  (the largest positive model number)'
       safe_real = x02amf()
       WRITE (nout,99997) ' X02AMF = ', safe_real, &
          '  (the real safe range parameter)'
       safe_complex = x02anf()
       WRITE (nout,99997) ' X02ANF = ', safe_complex, &
          '  (the complex safe range parameter)'
       WRITE (nout,*)
       WRITE (nout,*) &
          'Parameters of other aspects of the computing environment'
       WRITE (nout,*)
       largest_arg = x02ahf(0.0E0_nag_wp)
       WRITE (nout,99994) ' X02AHF = ', largest_arg, &
          '  (largest argument for SIN and COS)'
       largest_pos_int = x02bbf(0.0E0_nag_wp)
       WRITE (nout,99996) ' X02BBF = ', largest_pos_int, &
          '  (largest positive integer)'
       prec = x02bef(0.0E0_nag_wp)
       WRITE (nout,99996) ' X02BEF = ', prec, &
          '  (precision in decimal digits)'
       underflow = x02daf(0.0E0_nag_wp)
       WRITE (nout,99995) ' X02DAF = ', underflow, &
          '  (indicates how underflow is handled)'

99999  FORMAT (1X,A,I7,1X,A)
99998  FORMAT (1X,A,L7,1X,A)
99997  FORMAT (1X,A,1P,E26.18E3,1X,A)
99996  FORMAT (1X,A,I20,1X,A)
99995  FORMAT (1X,A,L20,1X,A)
99994  FORMAT (1X,A,1P,E20.8E3,1X,A)
    END PROGRAM x02ajfe
