Multidimensional Quadrature Rule Creation

PRODUCT_RULE is a C++ program which creates a multidimensional quadrature rule by using a product of distinct one-dimensional quadrature rules.

The program reads a single input file, which contains a list that defines the 1D rules to be used as factors.

Each 1D rule is stored in three files, an "X", "W", and "R" file, which are assumed to share a common filename prefix, so that the files defined by a given prefix have the form:

For instance, let us suppose we want to compute a 2D product rule formed from a 3 point Clenshaw Curtis rule and a 2 point Gauss-Legendre rule. If the prefixes for these files were "cc_d1_o003" and "gl_d1_o002" respectively, then the input file to the program would read as follows:

When the program read the first 1D rule, it would be searching for three files: and similarly for the second file.

Once the program has computed the multidimensional product rule, it again writes out three files describing the product rule, with a common filename prefix specified by the user, which might be, for instance, product, in which case the files would be:

For information on the form of these files, see the QUADRATURE_RULES directory listed below.


product_rule ( list_file, product_prefix )

If the arguments are not supplied on the command line, the program will prompt for them.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


PRODUCT_RULE is available in a C version and 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 C++ program which can test a quadrature rule for polynomial exactness.

NINT_EXACTNESS_MIXED, a C++ program which measures the polynomial exactness of a multidimensional quadrature rule based on a mixture of 1D quadrature rule factors.

NINTLIB, a C++ library which numerically estimates integrals in multiple dimensions.

POWER_RULE, a C++ program which constructs a power rule, that is, a product quadrature rule from identical 1D factor rules.

QUADRATURE_RULES, a dataset directory which contains sets of files that define quadrature rules over various 1D intervals or multidimensional hypercubes.

QUADRULE, a C++ library which defines quadrature rules on a variety of intervals with different weight functions.

SPARSE_GRID_MIXED, a C++ library which creates a sparse grid dataset based on a mixed set of 1D factor rules.

STROUD, a C++ library which contains quadrature rules for a variety of unusual areas, surfaces and volumes in 2D, 3D and N-dimensions.

TEST_NINT, a C++ library which defines integrand functions for testing multidimensional quadrature routines.

TESTPACK, a C++ library which defines a set of integrands used to test multidimensional quadrature.

TRUNCATED_NORMAL_RULE, a C++ program which computes a quadrature rule for a normal probability density function (PDF), also called a Gaussian distribution, that has been truncated to [A,+oo), (-oo,B] or [A,B].


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

Source Code:

Examples and Tests:

As an example, we make a 2D product rule.

The first factor is a 1D Clenshaw Curtis rule of order 3:

The second factor is a 1D Gauss Legendre rule of order 2:

We give the command

product_rule factors.txt

The resulting product rule files:

List of Routines:

You can go up one level to the C++ source codes.

Last revised on 21 April 2012.