naginterfaces.library.quad.dim1_​gauss_​recm

naginterfaces.library.quad.dim1_gauss_recm(n, mu)[source]

Given the moments of the weight function, dim1_gauss_recm generates the recursion coefficients needed by dim1_gauss_wrec() to calculate a Gaussian quadrature rule.

For full information please refer to the NAG Library document for d01te

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/d01/d01tef.html

Parameters
nint

, the number of weights and abscissae required.

mufloat, array-like, shape

must contain the value of the moment with respect to i.e., , for .

Returns
afloat, ndarray, shape

Values helping define the three term recurrence used by dim1_gauss_wrec().

bfloat, ndarray, shape

Values helping define the three term recurrence used by dim1_gauss_wrec().

cfloat, ndarray, shape

Values helping define the three term recurrence used by dim1_gauss_wrec().

Raises
NagValueError
(errno )

The number of weights and abscissae requested () is less than : .

(errno )

The problem is too ill conditioned, it breaks down at row .

Notes

dim1_gauss_recm should only be used if the three-term recurrence cannot be determined analytically. A system of equations are formed, using the moments provided. This set of equations becomes ill-conditioned for moderate values of , the number of abscissae and weights required. In most implementations quadruple precision calculation is used to maintain as much accuracy as possible.

References

Golub, G H and Welsch, J H, 1969, Calculation of Gauss quadrature rules, Math. Comput. (23), 221–230