nag_quad_1d_gauss_wgen (d01tcc) returns the weights (normal or adjusted) and abscissae for a Gaussian integration rule with a specified number of abscissae. Six different types of Gauss rule are allowed.
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).
Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 188.8.131.52 in How to Use the NAG Library and its Documentation for further information.
On entry, argument had an illegal value.
On entry, a, b, c, or d is not in the allowed range: , , and .
The algorithm for computing eigenvalues of a tridiagonal matrix has failed to converge.
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.
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
One or more of the weights are larger than , the largest floating point number on this computer (see nag_real_largest_number (X02ALC)): . 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.
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 .
Parallelism and Performance
nag_quad_1d_gauss_wgen (d01tcc) 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 function. 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.