# Category : Miscellaneous Language Source Code

Archive : FORTRN77.ZIP

Filename : LGPOL.FOR

C

C THIS SUBROUTINE COMPUTES THE COEFFICIENTS FOR LEGENDRE

C POLYNOMIALS OF DEGREE N.

C

DIMENSION D(1)

DOUBLE PRECISION D,P,B,V,S

P = N

N2 = N - 1

IF (N2) 10,11,12

10 D(1) = 1D0

RETURN

11 D(1) = 1.

D(2) = 0D0

RETURN

12 N1 = N + 1

NT = N + N2

BN = FLOAT(N1)/2D0

IM = BN

V = 2D0

DO 4 I = 3,N

4 V = V*FLOAT(I)

S = 3D0

DO 5 I = 5,NT,2

5 S = S*FLOAT(I)

D(1) = S/V

NU = N1

NK = N

DO 6 I = 1,IM

NU = NU - 2

IF(NU.LE.0) GO TO 16

J = N1 - NU

D(J) = 0D0

16 M = NK

V = M

NK = NK - 2

IF(NK.LE.0) GO TO 17

J = N1 - M

DT = D(J)

DT = (V*(V-1D0)*DT)/((P-V +2D0)*(P+V-1D0))

J = N1 - NK

6 D(J) = -DT

17 D(N1) = - D(N2)/(P*BN)

RETURN

END

Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/