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.
Background information to multithreading can be found in the
Multithreading documentation.
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.