nag_legendre_p (s22aac) returns a sequence of values for either the unnormalized or normalized Legendre functions of the first kind or for real of a given order and degree .
nag_legendre_p (s22aac) evaluates a sequence of values for either the unnormalized or normalized Legendre (
) or associated Legendre (
) functions of the first kind
or
, where
is real with
, of order
and degree
defined by
respectively;
is the (unassociated) Legendre polynomial of degree
given by
(the
Rodrigues formula). Note that some authors (e.g.,
Abramowitz and Stegun (1972)) include an additional factor of
(the
Condon–Shortley Phase) in the definitions of
and
. They use the notation
in order to distinguish between the two cases.
nag_legendre_p (s22aac) is based on a standard recurrence relation described in Section 8.5.3 of
Abramowitz and Stegun (1972). Constraints are placed on the values of
and
in order to avoid the possibility of machine overflow. It also sets the appropriate elements of the array
p (see
Section 5) to zero whenever the required function is not defined for certain values of
and
(e.g.,
and
).
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
On entry, .
Constraint: when .
- NE_INTERNAL_ERROR
-
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.
- NE_REAL
-
On entry, .
Constraint: .
The computed function values should be accurate to within a small multiple of the machine precision except when underflow (or overflow) occurs, in which case the true function values are within a small multiple of the underflow (or overflow) threshold of the machine.
Not applicable.
None.