nag_quad_1d_gauss_wset (d01tbc) returns the weights and abscissae appropriate to a Gaussian quadrature formula with a specified number of abscissae. The formulae provided are Gauss–Legendre, rational Gauss, Gauss–Laguerre and Gauss–Hermite.
nag_quad_1d_gauss_wset (d01tbc) returns the weights and abscissae for use in the Gaussian quadrature of a function
. The quadrature takes the form
where
are the weights and
are the abscissae (see
Davis and Rabinowitz (1975),
Fröberg (1970),
Ralston (1965) or
Stroud and Secrest (1966)).
Weights and abscissae are available for Gauss–Legendre, rational Gauss, Gauss–Laguerre and Gauss–Hermite quadrature, and for a selection of values of
(see
Section 5).
| (a) |
Gauss–Legendre Quadrature:
where and are finite and it will be exact for any function of the form
|
| (b) |
Rational Gauss quadrature, adjusted weights:
and will be exact for any function of the form
|
| (c) |
Gauss–Laguerre quadrature, adjusted weights:
and will be exact for any function of the form
|
| (d) |
Gauss–Hermite quadrature, adjusted weights:
and will be exact for any function of the form
|
| (e) |
Gauss–Laguerre quadrature, normal weights:
and will be exact for any function of the form
|
| (f) |
Gauss–Hermite quadrature, normal weights:
and will be exact for any function of the form
|
Note: the Gauss–Legendre abscissae, with
,
, are the zeros of the Legendre polynomials; the Gauss–Laguerre abscissae, with
,
, are the zeros of the Laguerre polynomials; and the Gauss–Hermite abscissae, with
,
, are the zeros of the Hermite polynomials.
- 1:
quad_type – Nag_QuadTypeInput
On entry: indicates the quadrature formula.
- Gauss–Legendre quadrature on a finite interval, using normal weights.
- Rational Gauss quadrature on a semi-infinite interval, using adjusted weights.
- Gauss–Laguerre quadrature on a semi-infinite interval, using adjusted weights.
- Gauss–Hermite quadrature on an infinite interval, using adjusted weights.
- Gauss–Laguerre quadrature on a semi-infinite interval, using normal weights.
- Gauss–Hermite quadrature on an infinite interval, using normal weights.
Constraint:
, , , , or .
- 2:
a – doubleInput
- 3:
b – doubleInput
On entry: the quantities
and
as described in the appropriate sub-section of
Section 3.
Constraints:
- if , ;
- if or , ;
- if or , .
- 4:
n – IntegerInput
On entry:
, the number of weights and abscissae to be returned.
Constraint:
, , , , , , , , , , , , , , or .
- 5:
weight[n] – doubleOutput
- 6:
abscis[n] – doubleOutput
On exit: the
n abscissae.
- 7:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
The weights and abscissae are stored for standard values of
a and
b to full machine accuracy.
Timing is negligible.
This example returns the abscissae and (adjusted) weights for the six-point Gauss–Laguerre formula.