QUADRATURE_TEST
Quadrature Rule Applied to Test Integrals
QUADRATURE_TEST
is a FORTRAN90 program which
reads three files that define
a quadrature rule, applies the quadrature rule to a set of
test integrals, and reports the results.
The quadrature rule is defined by three text files:

the "X" file lists the abscissas (N rows, M columns);

the "W" file lists the weights (N rows);

the "R" file lists the integration region corners
(2 rows, M columns);
For more on quadrature rules, see the QUADRATURE_RULES
listing below.
The test integrals come from the TEST_NINT library.
The list of integrand functions includes:

f(x) = ( sum ( x(1:m) ) )**2;

f(x) = ( sum ( 2 * x(1:m)  1 ) )**4;

f(x) = ( sum ( x(1:m) ) )**5;

f(x) = ( sum ( 2 * x(1:m)  1 ) )**6;

f(x) = 1 / ( 1 + sum ( 2 * x(1:m) ) );

f(x) = product ( 2 * abs ( 2 * x(1:m)  1 ) );

f(x) = product ( pi / 2 ) * sin ( pi * x(1:m) );

f(x) = ( sin ( (pi/4) * sum ( x(1:m) ) ) )**2;

f(x) = exp ( sum ( c(1:m) * x(1:m) ) );

f(x) = sum ( abs ( x(1:m)  0.5 ) );

f(x) = exp ( sum ( abs ( 2 * x(1:m)  1 ) ) );

f(x) = product ( 1 <= i <= m ) ( i * cos ( i * x(i) ) );

f(x) = product ( 1 <= i <= m ) t(n(i))(x(i)), t(n(i))
is a Chebyshev polynomial;

f(x) = sum ( 1 <= i <= m ) (1)**i * product ( 1 <= j <= i ) x(j);

f(x) = product ( 1 <= i <= order ) x(mod(i1,m)+1);

f(x) = sum ( abs ( x(1:m)  x0(1:m) ) );

f(x) = sum ( ( x(1:m)  x0(1:m) )**2 );

f(x) = 1 inside an mdimensional sphere around x0(1:m), 0 outside;

f(x) = product ( sqrt ( abs ( x(1:m)  x0(1:m) ) ) );

f(x) = ( sum ( x(1:m) ) )**power;

f(x) = c * product ( x(1:m)^e(1:m) ) on the surface of
an mdimensional unit sphere;

f(x) = c * product ( x(1:m)^e(1:m) ) in an mdimensional ball;

f(x) = c * product ( x(1:m)^e(1:m) ) in the unit mdimensional simplex;

f(x) = product ( abs ( 4 * x(1:m)  2 ) + c(1:m) )
/ ( 1 + c(1:m) ) );

f(x) = exp ( c * product ( x(1:m) ) );

f(x) = product ( c(1:m) * exp (  c(1:m) * x(1:m) ) );

f(x) = cos ( 2 * pi * r + sum ( c(1:m) * x(1:m) ) ),
Genz "Oscillatory";

f(x) = 1 / product ( c(1:m)**2 + (x(1:m)  x0(1:m))**2),
Genz "Product Peak";

f(x) = 1 / ( 1 + sum ( c(1:m) * x(1:m) ) )**(m+r),
Genz "Corner Peak";

f(x) = exp(sum(c(1:m)**2 * ( x(1:m)  x0(1:m))**2 ) ),
Genz "Gaussian";

f(x) = exp (  sum ( c(1:m) * abs ( x(1:m)  x0(1:m) ) ) ),
Genz "Continuous";

f(x) = exp(sum(c(1:m)*x(1:m)) for x(1:m) <= x0(1:m), 0 otherwise,
Genz "Discontinuous";
Usage:
quadrature_test prefix
where

prefix is the common prefix for the files containing the abscissa (X),
weight (W) and region (R) information of the quadrature rule;
If the arguments are not supplied on the command line, the
program will prompt for them.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
QUADRATURE_TEST is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
INTEGRAL_TEST,
a FORTRAN90 program which
uses test integrals to evaluate sets of quadrature points.
NINT_EXACTNESS,
a FORTRAN90 program which
demonstrates how to measure the
polynomial exactness of a multidimensional quadrature rule.
NINTLIB,
a FORTRAN90 library which
numerically estimates integrals
in multiple dimensions.
QUADRATURE_RULES,
a dataset directory which
contains a description and examples of quadrature rules defined
by a set of "X", "W" and "R" files.
QUADRATURE_TEST_GENZ,
a FORTRAN90 program which
reads files defining a quadrature rule,
and applies it to the Genz test integrands.
STROUD,
a FORTRAN90 library which
contains quadrature
rules for a variety of unusual areas, surfaces and volumes in 2D,
3D and Ndimensions.
TEST_NINT,
a FORTRAN90 library which
defines a set of integrand functions to be used for testing
multidimensional quadrature rules and routines.
TESTPACK,
a FORTRAN90 library which
defines a set of integrands used to test multidimensional quadrature.
Reference:

JD Beasley, SG Springer,
Algorithm AS 111:
The Percentage Points of the Normal Distribution,
Applied Statistics,
Volume 26, 1977, pages 118121.

Paul Bratley, Bennett Fox, Harald Niederreiter,
Implementation and Tests of LowDiscrepancy Sequences,
ACM Transactions on Modeling and Computer Simulation,
Volume 2, Number 3, July 1992, pages 195213.

Roger Broucke,
Algorithm 446:
Ten Subroutines for the Manipulation of Chebyshev Series,
Communications of the ACM,
Volume 16, 1973, pages 254256.

William Cody, Kenneth Hillstrom,
Chebyshev Approximations for the Natural Logarithm of the
Gamma Function,
Mathematics of Computation,
Volume 21, Number 98, April 1967, pages 198203.

Richard Crandall,
Projects in Scientific Computing,
Springer, 2005,
ISBN: 0387950095,
LC: Q183.9.C733.

Philip Davis, Philip Rabinowitz,
Methods of Numerical Integration,
Second Edition,
Dover, 2007,
ISBN: 0486453391,
LC: QA299.3.D28.

Gerald Folland,
How to Integrate a Polynomial Over a Sphere,
American Mathematical Monthly,
Volume 108, Number 5, May 2001, pages 446448.

Leslie Fox, Ian Parker,
Chebyshev Polynomials in Numerical Analysis,
Oxford Press, 1968,
LC: QA297.F65.

Alan Genz,
Testing Multidimensional Integration Routines,
in Tools, Methods, and Languages for Scientific and
Engineering Computation,
edited by B Ford, JC Rault, F Thomasset,
NorthHolland, 1984, pages 8194,
ISBN: 0444875700,
LC: Q183.9.I53.

Alan Genz,
A Package for Testing Multiple Integration Subroutines,
in Numerical Integration:
Recent Developments, Software and Applications,
edited by Patrick Keast, Graeme Fairweather,
Reidel, 1987, pages 337340,
ISBN: 9027725144,
LC: QA299.3.N38.

Kenneth Hanson,
QuasiMonte Carlo: halftoning in high dimensions?
in Computatinal Imaging,
Edited by CA Bouman, RL Stevenson,
Proceedings SPIE,
Volume 5016, 2003, pages 161172.

John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
Charles Mesztenyi, John Rice, Henry Thatcher,
Christoph Witzgall,
Computer Approximations,
Wiley, 1968,
LC: QA297.C64.

Stephen Joe, Frances Kuo
Remark on Algorithm 659:
Implementing Sobol's Quasirandom Sequence Generator,
ACM Transactions on Mathematical Software,
Volume 29, Number 1, March 2003, pages 4957.

David Kahaner, Cleve Moler, Steven Nash,
Numerical Methods and Software,
Prentice Hall, 1989,
ISBN: 0136272584,
LC: TA345.K34.

Bradley Keister,
Multidimensional Quadrature Algorithms,
Computers in Physics,
Volume 10, Number 2, March/April, 1996, pages 119122.

Arnold Krommer, Christoph Ueberhuber,
Numerical Integration on Advanced Compuer Systems,
Springer, 1994,
ISBN: 3540584102,
LC: QA299.3.K76.

Anargyros Papageorgiou, Joseph Traub,
Faster Evaluation of Multidimensional Integrals,
Computers in Physics,
Volume 11, Number 6, November/December 1997, pages 574578.

Thomas Patterson,
On the Construction of a Practical ErmakovZolotukhin
Multiple Integrator,
in Numerical Integration:
Recent Developments, Software and Applications,
edited by Patrick Keast and Graeme Fairweather,
D. Reidel, 1987, pages 269290.

Arthur Stroud,
Approximate Calculation of Multiple Integrals,
Prentice Hall, 1971,
ISBN: 0130438936,
LC: QA311.S85.

Arthur Stroud, Don Secrest,
Gaussian Quadrature Formulas,
Prentice Hall, 1966,
LC: QA299.4G3S7.

Xiaoqun Wang, KaiTai Fang,
The Effective Dimension and quasiMonte Carlo Integration,
Journal of Complexity,
Volume 19, pages 101124, 2003.
Source Code:
Examples and Tests:
CC_D2_LEVEL4 is a ClenshawCurtis sparse grid quadrature
rule in dimension 2 of level 4, 65 points.
CC_D2_LEVEL5 is a ClenshawCurtis sparse grid quadrature
rule in dimension 2 of level 5, 145 points.
CC_D6_LEVEL0 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 0, 1 point.
CC_D6_LEVEL1 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 1, 13 points.
CC_D6_LEVEL2 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 2, 85 points.
CC_D6_LEVEL3 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 3, 389 points.
CC_D6_LEVEL4 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 4, 1457 points.
CC_D6_LEVEL5 is a ClenshawCurtis sparse grid quadrature
rule in dimension 6 of level 5, 4865 points.
List of Routines:

MAIN is the main program for QUADRATURE_TEST.

CH_CAP capitalizes a single character.

CH_EQI is a case insensitive comparison of two characters for equality.

CH_TO_DIGIT returns the integer value of a base 10 digit.

DTABLE_DATA_READ reads data from a DTABLE file.

DTABLE_HEADER_READ reads the header from a DTABLE file.

FILE_COLUMN_COUNT counts the number of columns in the first line of a file.

FILE_ROW_COUNT counts the number of row records in a file.

GET_UNIT returns a free FORTRAN unit number.

S_TO_I4 reads an I4 from a string.

S_TO_R8 reads an R8 from a string.

S_TO_R8VEC reads an R8VEC from a string.

S_WORD_COUNT counts the number of "words" in a string.

TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 17 October 2007.