DAVINT(3)

SYNOPSIS
SUBROUTINE DAVINT (X, Y, N, XLO, XUP, ANS, IERR)

NAME
davint - Integrate a function tabulated at arbitrarily spaced abscissas using overlapping parabolas.

LIBRARY
SLATEC

CATEGORY
H2A1B2

TYPE
DOUBLE PRECISION (AVINT-S, DAVINT-D)

KEYWORDS
INTEGRATION, QUADRATURE, TABULATED DATA

AUTHOR
Jones, R. E., (SNLA)

DESCRIPTION
Abstract DAVINT integrates a function tabulated at arbitrarily spaced abscissas. The limits of integration need not coincide with the tabulated abscissas. A method of overlapping parabolas fitted to the data is used provided that there are at least 3 abscissas between the limits of integration. DAVINT also handles two special cases. If the limits of integration are equal, DAVINT returns a result of zero regardless of the number of tabulated values. If there are only two function values, DAVINT uses the trapezoid rule. Description of Parameters The user must dimension all arrays appearing in the call list X(N), Y(N) Input-- X - DOUBLE PRECISION array of abscissas, which must be in increasing order. Y - DOUBLE PRECISION array of function values. i.e., Y(I)=FUNC(X(I)) N - The integer number of function values supplied. N .GE. 2 unless XLO = XUP. XLO - DOUBLE PRECISION lower limit of integration XUP - DOUBLE PRECISION upper limit of integration. Must have XLO.LE.XUP Output-- ANS - Double Precision computed approximate value of integral IERR - A status code --Normal Code =1 Means the requested integration was performed. --Abnormal Codes =2 Means XUP was less than XLO. =3 Means the number of X(I) between XLO and XUP (inclusive) was less than 3 and neither of the two special cases described in the abstract occurred. No integration was performed. =4 Means the restriction X(I+1).GT.X(I) was violated. =5 Means the number N of function values was .lt. 2. ANS is set to zero if IERR=2,3,4,or 5. DAVINT is documented completely in SC-M-69-335 Original program from *Numerical Integration* by Davis & Rabinowitz Adaptation and modifications by Rondall E Jones.

REFERENCES
R. E. Jones, Approximate integrator of functions tabulated at arbitrarily spaced abscissas, Report SC-M-69-335, Sandia Laboratories, 1969.

ROUTINES CALLED
XERMSG

REVISION HISTORY (YYMMDD)
690901 DATE WRITTEN
890831 Modified array declarations. (WRB)
890831 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
920501 Reformatted the REFERENCES section. (WRB)