EXACTNESS is a FORTRAN77 library which investigates the exactness of quadrature rules that estimate the integral of a function with a density, such as 1, exp(-x) or exp(-x^2), over an interval such as [-1,+1], [0,+oo) or (-oo,+oo).
A 1D quadrature rule estimates I(f), the integral of a function f(x) over an interval [a,b] with density rho(x):
I(f) = integral ( a < x < b ) f(x) rho(x) dxby a n-point quadrature rule of weights w and points x:
Q(f) = sum ( 1 <= i <= n ) w(i) f(x(i))
Most quadrature rules come in a family of various sizes. A quadrature rule of size n is said to have exactness p if it is true that the quadrature estimate is exactly equal to the exact integral for every monomial (and hence, polynomial) whose degree is p or less.
This program allows the user to specify a quadrature rule, a size n, and a degree p_max. It then computes and compares the exact integral and quadrature estimate for monomials of degree 0 through p_max, so that the user can analyze the results.
Common densities include:
Common quadrature rules include:
The computer code and data files made available on this web page are distributed under the GNU LGPL license.
EXACTNESS is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.
EXACTNESS_2D, a FORTRAN77 library which investigates the exactness of 2D quadrature rules that estimate the integral of a function f(x,y) over a 2D domain.
HERMITE_EXACTNESS, a FORTRAN77 program which tests the monomial exactness of Gauss-Hermite quadrature rules for estimating the integral of a function with density exp(-x^2) over the interval (-oo,+oo).
LAGUERRE_EXACTNESS, a FORTRAN77 program which tests the monomial exactness of Gauss-Laguerre quadrature rules for estimating the integral of a function with density exp(-x) over the interval [0,+oo).
LEGENDRE_EXACTNESS, a FORTRAN77 program which tests the monomial exactness of Gauss-Legendre quadrature rules for estimating the integral of a function with density 1 over the interval [-1,+1].
PYRAMID_EXACTNESS, a FORTRAN77 program which investigates the monomial exactness of a quadrature rule over the interior of a pyramid in 3D.
SPHERE_EXACTNESS, a FORTRAN77 program which tests the monomial exactness of a quadrature rule over the surface of the unit sphere in 3D.
You can go up one level to the FORTRAN77 source codes.