mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2025-01-01 06:23:39 +01:00
c977aa998f
Replace amos with slatec
83 lines
2.3 KiB
Fortran
83 lines
2.3 KiB
Fortran
*DECK XQMU
|
|
SUBROUTINE XQMU (NU1, NU2, MU1, MU2, THETA, X, SX, ID, PQA, IPQA,
|
|
1 IERROR)
|
|
C***BEGIN PROLOGUE XQMU
|
|
C***SUBSIDIARY
|
|
C***PURPOSE To compute the values of Legendre functions for XLEGF.
|
|
C Method: forward mu-wise recurrence for Q(MU,NU,X) for fixed
|
|
C nu to obtain Q(MU1,NU,X), Q(MU1+1,NU,X), ..., Q(MU2,NU,X).
|
|
C***LIBRARY SLATEC
|
|
C***CATEGORY C3A2, C9
|
|
C***TYPE SINGLE PRECISION (XQMU-S, DXQMU-D)
|
|
C***KEYWORDS LEGENDRE FUNCTIONS
|
|
C***AUTHOR Smith, John M., (NBS and George Mason University)
|
|
C***ROUTINES CALLED XADD, XADJ, XPQNU
|
|
C***REVISION HISTORY (YYMMDD)
|
|
C 820728 DATE WRITTEN
|
|
C 890126 Revised to meet SLATEC CML recommendations. (DWL and JMS)
|
|
C 901019 Revisions to prologue. (DWL and WRB)
|
|
C 901106 Corrected order of sections in prologue and added TYPE
|
|
C section. (WRB)
|
|
C 920127 Revised PURPOSE section of prologue. (DWL)
|
|
C***END PROLOGUE XQMU
|
|
DIMENSION PQA(*),IPQA(*)
|
|
REAL DMU,NU,NU1,NU2,PQ,PQA,PQ1,PQ2,SX,X,X1,X2
|
|
REAL THETA
|
|
C***FIRST EXECUTABLE STATEMENT XQMU
|
|
IERROR=0
|
|
MU=0
|
|
C
|
|
C CALL XPQNU TO OBTAIN Q(0.,NU1,X)
|
|
C
|
|
CALL XPQNU(NU1,NU2,MU,THETA,ID,PQA,IPQA,IERROR)
|
|
IF (IERROR.NE.0) RETURN
|
|
PQ2=PQA(1)
|
|
IPQ2=IPQA(1)
|
|
MU=1
|
|
C
|
|
C CALL XPQNU TO OB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