toms655, a FORTRAN90 code which computes weights for interpolatory quadrature schemes, by Sylvan Elhay and Jaroslav Kautsky.
The FORTRAN90 version is a "translation" of the original FORTRAN77 code. Aside from some standard FORTRAN90 changes, a major change to the code was the elimination of the work vectors WF and IWF, which have been replaced by the use of allocatable arrays and automatic arrays. This frees the user from having to declare and pass workspace arrays of the appropriate size. It also means it is easier to translate the FORTRAN90 code into MATLAB or C.
The typical use of this library is for the user to specify a quadrature interval, a weight function, and a sequence of abscissas (which may be repeated), and to request the corresponding weight vector so that an interpolatory quadrature rule is produced.
Note that when an abscissa is repeated, this indicates that, at this point, not only the function value but one or more derivatives are to be used in the quadrature formula.
The library is also suitable for the simpler task of computing both the abscissas and weights for a variety of classical Gaussian quadrature rules, including
Index | Name | Interval | Weight function |
---|---|---|---|
1 | Legendre | (a,b) | 1.0 |
2 | Chebyshev Type 1 | (a,b) | ((b-x)*(x-a))^(-0.5) |
3 | Gegenbauer | (a,b) | ((b-x)*(x-a))^alpha |
4 | Jacobi | (a,b) | (b-x)^alpha*(x-a)^beta |
5 | Laguerre and Generalized Laguerre | (a,+oo) | (x-a)^alpha*exp(-b*(x-a)) |
6 | Hermite and Generalized Hermite | (-oo,+oo) | |x-a|^alpha*exp(-b*(x-a)^2) |
7 | Exponential | (a,b) | |x-(a+b)/2.0|^alpha |
8 | Rational | (a,+oo) | (x-a)^alpha*(x+b)^beta |
9 | Chebyshev Type 2 | (a,b) | ((b-x)*(x-a))^(+0.5) |
The text of many ACM TOMS algorithms is available online through ACM: https://calgo.acm.org/ or NETLIB: https://www.netlib.org/toms/index.html.
The computer code and data files described and made available on this web page are distributed under the MIT license
toms655 is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
CHEBYSHEV1_RULE, a FORTRAN90 code which can compute and print a Gauss-Chebyshev type 1 quadrature rule.
CHEBYSHEV2_RULE, a FORTRAN90 code which can compute and print a Gauss-Chebyshev type 2 quadrature rule.
GEGENBAUER_RULE, a FORTRAN90 code which can compute and print a Gauss-Gegenbauer quadrature rule.
GEN_HERMITE_RULE, a FORTRAN90 code which can compute and print a generalized Gauss-Hermite quadrature rule.
GEN_LAGUERRE_RULE, a FORTRAN90 code which can compute and print a generalized Gauss-Laguerre quadrature rule.
HERMITE_RULE, a FORTRAN90 code which computes a Gauss-Hermite quadrature rule.
JACOBI_RULE, a FORTRAN90 code which can compute and print a Gauss-Jacobi quadrature rule.
LAGUERRE_RULE, a FORTRAN90 code which can compute and print a Gauss-Laguerre quadrature rule.
LEGENDRE_RULE, a FORTRAN90 code which computes a Gauss-Legendre quadrature rule.
QUADMOM, a FORTRAN90 code which computes a Gaussian quadrature rule for a weight function rho(x) based on the Golub-Welsch procedure that only requires knowledge of the moments of rho(x).
QUADRATURE_WEIGHTS, a FORTRAN90 code which illustrates techniques for computing the weights of a quadrature rule, assuming that the points have been specified.
QUADRULE, a FORTRAN90 code which contains information about quadrature rules, both as tabulated values, and as computational procedures.