Given the
moments of the weight function,
d01tec generates the recursion coefficients needed by
d01tdc to calculate a Gaussian quadrature rule.
Internally quadruple precision is used to minimize loss of accuracy as much as possible.
Because the function cannot check the validity of all the data presented, you are advised to independently check the result, perhaps by integrating a function whose integral is known, using
d01tec and subsequently
d01tdc, to compare answers.
This example program uses
d01tec and moments to calculate a three-term recurrence relationship appropriate for Gauss–Legendre quadrature. It then uses the recurrence relationship to derive the weights and abscissae by calling
d01tdc.
None.