* C05AXF Example Program Text * Mark 14 Revised. NAG Copyright 1989. * .. Parameters .. INTEGER NOUT PARAMETER (NOUT=6) * .. Local Scalars .. DOUBLE PRECISION FX, SCAL, TOL, X INTEGER I, IFAIL, IND, IR * .. Local Arrays .. DOUBLE PRECISION C(26) * .. External Functions .. DOUBLE PRECISION X02AJF EXTERNAL X02AJF * .. External Subroutines .. EXTERNAL C05AXF * .. Intrinsic Functions .. INTRINSIC EXP, SQRT * .. Executable Statements .. WRITE (NOUT,*) 'C05AXF Example Program Results' SCAL = SQRT(X02AJF()) IR = 0 DO 40 I = 3, 4 TOL = 10.0D0**(-I) WRITE (NOUT,*) WRITE (NOUT,99999) 'TOL = ', TOL WRITE (NOUT,*) X = 1.0D0 IFAIL = 1 IND = 1 * 20 CALL C05AXF(X,FX,TOL,IR,SCAL,C,IND,IFAIL) * IF (IND.NE.0) THEN FX = X - EXP(-X) GO TO 20 ELSE IF (IFAIL.LT.0) THEN WRITE (NOUT,*) WRITE (NOUT,99998) ' ** C05AXF returned with IFAIL = ', + IFAIL GO TO 60 ELSE IF (IFAIL.GT.0) THEN WRITE (NOUT,99998) 'Error exit, IFAIL =', IFAIL IF (IFAIL.EQ.4 .OR. IFAIL.EQ.6) THEN WRITE (NOUT,99997) 'Final value = ', X, ' THETA = ', + C(5), ' LAMBDA = ', C(7) END IF ELSE WRITE (NOUT,99997) 'Root is ', X END IF END IF 40 CONTINUE 60 CONTINUE * 99999 FORMAT (1X,A,E10.4) 99998 FORMAT (1X,A,I5) 99997 FORMAT (1X,A,F14.5,A,F10.2,A,F10.2) END