numeric::gldata
-- weights and
abscissae of Gauss-Legendre quadraturenumeric::gldata
(n, ..)
returns the weights
and the abscissae of the Gauss-Legendre quadrature rule with
n nodes.
numeric::gldata(n, digits)
n |
- | the number of nodes: a positive integer |
digits |
- | the number of decimal digits: a positive integer |
A list [b,c]
is returned. The lists
b=[b[1],..,b[n]]
and c=[c[1],..,c[n]]
are
numerical approximations of the weights and abscissae with
digits
significant digits.
The function uses option
remember
. It is not sensitive to the environment variable
DIGITS
, because the
numerical working precision is specified by the second argument
digits
.
numeric::gtdata
,
numeric::ncdata
,
numeric::quadrature
digits
. The resulting floating point numbers are correct
to digits
decimal places.digits
should coincide with
the actual value of DIGITS
.n=20,40,80,160
with
digits
<=200 are stored internally. They are
returned immediately without any computational costs.numeric::gldata
leads to computational costs. For any
further call with the same arguments the data are returned
immediately.The following call computes the Gaussian data with the
default precision of DIGITS=10
decimal digits:
>> numeric::gldata(4, DIGITS)
[[0.1739274226, 0.3260725774, 0.3260725774, 0.1739274226], [0.0694318442, 0.3300094782, 0.6699905218, 0.9305681558]]
For odd n exact rational data for c[(n+1)/2] and b[(n-1)/2] are returned:
>> DIGITS := 4: numeric::gldata(5, DIGITS)
[[0.1185, 0.2393, 64/225, 0.2393, 0.1185], [0.04691, 0.2308, 1/2, 0.7692, 0.9531]]
>> delete DIGITS:
numeric::quadrature
calls
numeric::gldata
to provide the data for Gaussian
quadrature.