gaus8.f
SUBROUTINE GAUS8 (FUN, A, B, ERR, ANS, IERR)
C***BEGIN PROLOGUE GAUS8
C***PURPOSE Integrate a real function of one variable over a finite
C interval using an adaptive 8-point Legendre-Gauss
C algorithm. Intended primarily for high accuracy
C integration or integration of smooth functions.
C***LIBRARY SLATEC
C***CATEGORY H2A1A1
C***TYPE SINGLE PRECISION (GAUS8-S, DGAUS8-D)
C***KEYWORDS ADAPTIVE QUADRATURE, AUTOMATIC INTEGRATOR,
C GAUSS QUADRATURE, NUMERICAL INTEGRATION
C***AUTHOR Jones, R. E., (SNLA)
C***DESCRIPTION
C
C Abstract
C GAUS8 integrates real functions of one variable over finite
C intervals using an adaptive 8-point Legendre-Gauss algorithm.
C GAUS8 is intended primarily for high accuracy integration
C or integration of smooth functions.
C
C Description of Arguments
C
C Input--
C FUN - name of external function to be integrated. This name
C must be in an EXTERNAL statement in the calling program.
C FUN must be a REAL function of one REAL argument. The
C value of the argument to FUN is the variable of
C integration which ranges from A to B.
C A - lower limit of integration
C B - upper limit of integration (may be less than A)
C ERR - is a requested pseudorelative error tolerance. Normally
C pick a value of ABS(ERR) so that STOL .LT. ABS(ERR) .LE.
C 1.0E-3 where STOL is the single precision unit roundoff
C R1MACH(4). ANS will normally have no more error than
C ABS(ERR) times the integral of the absolute value of
C FUN(X). Usually, smaller values for ERR yield more
C accuracy and require more function evaluations.
C
C A negative value for ERR causes an estimate of the
C absolute error in ANS to be returned in ERR. Note that
C ERR must be a variable (not a constant) in this case.
C Note also that the user must reset the value of ERR
C before making any more calls that use the variable ERR.
C
C Output--
C ERR - will be an estimate of the absolute error in ANS if the
C input value of ERR was negative. (ERR is unchanged if
C the input value of ERR was non-negative.) The estimated
C error is solely for information to the user and should
C not be used as a correction to the computed integral.
C ANS - computed value of integral
C IERR- a status code
C --Normal codes
C 1 ANS most likely meets requested error tolerance,
C or A=B.
C -1 A and B are too nearly equal to allow normal
C integration. ANS is set to zero.
C --Abnormal code
C 2 ANS probably does not meet requested error tolerance.
C
C***REFERENCES (NONE)
C***ROUTINES CALLED I1MACH, R1MACH, XERMSG
C***REVISION HISTORY (YYMMDD)
C 810223 DATE WRITTEN
C 890531 Changed all specific intrinsics to generic. (WRB)
C 890531 REVISION DATE from Version 3.2
C 891214 Prologue converted to Version 4.0 format. (BAB)
C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
C 900326 Removed duplicate information from DESCRIPTION section.
C (WRB)
C***END PROLOGUE GAUS8