next up previous index
Next: C331 Conical Functions Up: CERNLIB Previous: C328 Whittaker Function

C330 Legendre and Associated Legendre Functions

Routine ID: C330
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.05.1987
Language: FortranRevised: 01.12.1994

Subroutine subprograms RASLGF and DASLGF calculate, for a given real argument x,(-1 ≤x ≤1) , and a given integer value of the order m, a sequence of either unnormalized or normalized Legendre (m=0) or Associated Legendre (m ≠0) functions of degree n = 0,1,2,...,N , defined by

Pnm(x) (1-x2)m/2{dmdxm}Pn(x) (m ≥0) (1a)

Pnm(x) {(n+m)!(n-m)!} Pn-m(x) (m<0) (1b)

Pnm(x) {2n+12}{(n-m)!(n+m)!} Pnm(x), (2)

respectively, where

Pn(x) ≡ Pn0(x) = {12nn!} {dndxn}(x2-1)n

is the Legendre polynominal of degree n. Note that some authors use an additional factor (-1)m in the definition (1).

On CDC and Cray computers, the double-precision version DASLGF is not available.

Structure:

SUBROUTINE subprograms
User Entry Names: RASLGF, DASLGF
Obsolete User Entry Names: ASLGF RASLGF
Files Referenced: Unit 6
External References: MTLMTR (N002), ABEND (Z035)

Usage:

For t=R (type REAL), t=D (type DOUBLE PRECISION),

    CALL tASLGF(MODE,X,M,NL,P)
MODE
( INTEGER) = 1: Unnormalized functions (1),
( INTEGER) = 2: Normalized functions (2).
X
(type according to t) The argument x.
M
( INTEGER) The order m (upper index) of all functions in the computed sequence. It is permissible for M to be negative.
NL
( INTEGER) Specifies the degree N of the last function in the computed sequences.
P
(type according to t) One-dimensional array of dimension ( 0:d) where dNL .
On exit, P(n),(n=0,1,...,NL) , contains Pnm(X) or Pnm(X) as specified by MODE. (See Notes).

Method:

The functions Pnm(x) are for m>0 calculated by means of the standard recurrence relation.

Restrictions:

  1. -1 ≤X ≤1 .
  2. MODE = 1 or 2.
  3. If M = 0: 0 ≤NL ≤100 :
    if M ≠0: |M| ≤27

    and 0 ≤NL ≤55 - |M| ; (0 ≤NL ≤33 - |M| on VAX/VMS).

Accuracy:

RASLGF (except on CDC and Cray computers) has full single-precision accuracy. For most values of the argument X, DASLGF (and RASLGF on CDC and Cray computers) has an accuracy of approximately two significant digits less than the machine precision.

Notes:

In accordance with the definitions, P(n) = 0 for n = 0,1,...,|M|-1 .

Error handling:

Error C330.1: |X|>1 .
Error C330.2: MODE ≠1 and MODE ≠2 .
Error C330.3: M and NL incompatible.
In all cases, a message is written on Unit 6, unless subroutine MTLSET (N002) has been called. The initial contents of array P(n) is left unchanged.

C331



next up previous index
Next: C331 Conical Functions Up: CERNLIB Previous: C328 Whittaker Function


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995