Routine ID: D108 | |
---|---|
Author(s): K.S. Kölbig | Library: MATHLIB |
Submitter: | Submitted: 01.03.1968 |
Language: Fortran | Revised: |
Let a function $f(x)$ be given by its values at certain discrete points $x$_{ν}(ν=1,2,...,n) . Let the function values $y$_{ν} be accompanied by an estimated standard deviation $\epsilon $_{ν} (square root of the variance). Subroutine subprogram TRAPER then approximates the integral
$I\; =\; \int $_{A}^{B}f(x)dx ∑_{ν}w_{ν}y_{ν}
by a linear combination of the $y$_{ν} using the trapezoidal rule. It calculates the standard deviation $\sigma $ of I by
$\sigma \; =\sum $_{ν}w_{ν}^{2}ε_{ν}^{2}.
The function values $f(A)$ and $f(B)$ are calculated by linear interpolation.
Structure:
SUBROUTINE subprogram
User Entry Names: TRAPER
Usage:
CALL TRAPER(X,Y,E,N,A,B,RE,SD)
Restrictions:
Although there are no restrictions on A and B ( B may be less than A), care must be taken if one or both of them is either smaller than X(1) or bigger than X(N). In these cases $f(A)$ or $f(B)$ are extrapolated linearly from Y(1) and Y(2) or Y(N-1) and Y(N) respectively, which may lead to unreasonable results. If $A\; =\; B$ or $N\; <\; 2$ , RE and SD will be set to zero. It is assumed that all the $x$_{ν} are distinct. No test is made for this.
Notes:
This program should only be used for the problem
described above. For general-purpose numerical integration to a
preassigned accuracy use GAUSS (D103).
$\u2022$