In the above formulae, stands for any polynomial of degree or less in .
The method used to calculate the abscissae involves finding the eigenvalues of the appropriate tridiagonal matrix (see Golub and Welsch (1969)). The weights are then determined by the formula
where is the th orthogonal polynomial with respect to the weight function over the appropriate interval.
The weights and abscissae produced by d01tcf may be passed to d01fbf, which will evaluate the summations in one or more dimensions.
Davis P J and Rabinowitz P (1975) Methods of Numerical Integration Academic Press
Golub G H and Welsch J H (1969) Calculation of Gauss quadrature rules Math. Comput.23 221–230
Stroud A H and Secrest D (1966) Gaussian Quadrature Formulas Prentice–Hall
1: – IntegerInput
On entry: indicates the type of quadrature rule.
Gauss–Legendre, with normal weights.
Gauss–Jacobi, with normal weights.
Gauss–Jacobi, with adjusted weights.
Exponential Gauss, with normal weights.
Exponential Gauss, with adjusted weights.
Gauss–Laguerre, with normal weights.
Gauss–Laguerre, with adjusted weights.
Gauss–Hermite, with normal weights.
Gauss–Hermite, with adjusted weights.
Rational Gauss, with normal weights.
Rational Gauss, with adjusted weights.
, , , , , , , , , or .
2: – Real (Kind=nag_wp)Input
3: – Real (Kind=nag_wp)Input
4: – Real (Kind=nag_wp)Input
5: – Real (Kind=nag_wp)Input
On entry: the parameters , , and which occur in the quadrature formulae described in Section 3. c is not used if ; d is not used unless , , or . For some rules c and d must not be too large (see Section 6).
6: – IntegerInput
On entry: , the number of weights and abscissae to be returned. If or and , an odd value of n may raise problems (see ).
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
The algorithm for computing eigenvalues of a tridiagonal matrix has failed to converge.
On entry, .
On entry, .
On entry, a, b, c, or d is not in the allowed range: , , and .
One or more of the weights are larger than , the largest floating point number on this computer (see x02alf): . Possible solutions are to use a smaller value of ; or, if using adjusted weights to change to normal weights.
One or more of the weights are too small to be distinguished from zero on this machine. The underflowing weights are returned as zero, which may be a usable approximation. Possible solutions are to use a smaller value of ; or, if using normal weights, to change to adjusted weights.
Exponential Gauss or Gauss–Hermite adjusted weights with n odd and .
Theoretically, in these cases:
for , the central adjusted weight is infinite, and the exact function is zero at the central abscissa;
for , the central adjusted weight is zero, and the exact function is infinite at the central abscissa.
In either case, the contribution of the central abscissa to the summation is indeterminate.
In practice, the central weight may not have overflowed or underflowed, if there is sufficient rounding error in the value of the central abscissa.
The weights and abscissa returned may be usable; you must be particularly careful not to ‘round’ the central abscissa to its true value without simultaneously ‘rounding’ the central weight to zero or as appropriate, or the summation will suffer. It would be preferable to use normal weights, if possible.
Note: remember that, when switching from normal weights to adjusted weights or vice versa, redefinition of is involved.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
The accuracy depends mainly on , with increasing loss of accuracy for larger values of . Typically, one or two decimal digits may be lost from machine accuracy with , and three or four decimal digits may be lost for .
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
d01tcf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
The major portion of the time is taken up during the calculation of the eigenvalues of the appropriate tridiagonal matrix, where the time is roughly proportional to .
This example returns the abscissae and (adjusted) weights for the seven-point Gauss–Laguerre formula.