Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : NAMULL.FOR

 
Output of file : NAMULL.FOR contained in archive : FORTRN77.ZIP
SUBROUTINE NAMULL(ROOT,N,EPS,MAX)
C
C THIS SUBROUTINE FINDS N COMPLEX ROOTS OF THE EQUATION F(X) =
C 0 USING MULLER'S METHOD. F(X) MAY BE TRANSCENDENTAL AND
C COMPLEX.
C
DIMENSION ROOT(1), RT(2), F1(2), F2(2), F3(2), FPRT(2), TEMP(2),
&XN(2), H(2), ALAM(2), DELTA(2), B1(2), B2(2), B3(2), G(2), D(2),
&ONE(2), TWO(2), FOUR(2)
DATA I1,I2,I3,I4,ONE,TWO,FOUR/1,2,3,4,1.0,0.0,-2.0,0.0,4.0,0.0/
K = 0
8 K = K + 1
MM = 0
K2 = K + K
K1 = K2 - 1
IF(ROOT(K1).NE.0.0.OR.ROOT(K2).NE.0.0) GO TO 7
RT(1) = -1.0
RT(2) = 0.0
H(1) = -1.0
H(2) = 0.0
ALAM(1) = -0.5
ALAM(2) = 0.0
M = 3
GO TO 10
7 RT(1) = 0.9*ROOT(K1)
RT(2) = 0.9*ROOT(K2)
M = 1
GO TO 10
1 F1(1) = FPRT(1)
F1(2) = FPRT(2)
RT(1) = 1.1*ROOT(K1)
RT(2) = 1.1*ROOT(K2)
M = 2
GO TO 10
2 F2(1) = FPRT(1)
F2(2) = FPRT(2)
H(1) = ROOT(K1) - RT(1)
H(2) = ROOT(K2) - RT(2)
ALAM(1) = .2*ROOT(K1)
ALAM(2) = .2*ROOT(K2)
RT(1) = ROOT(K1)
RT(2) = ROOT(K2)
M = 5
GO TO 10
3 F1(1) = FPRT(1)
F1(2) = FPRT(2)
RT(1) = 1.0
RT(2) = 0.0
M = 4
GO TO 10
4 F2(1) = FPRT(1)
F2(2) = FPRT(2)
RT(1) = 0.0
RT(2) = 0.0
M = 5
GO TO 10
5 F3(1) = FPRT(1)
F3(2) = FPRT(2)
GO TO 11
6 F1(1) = F2(1)
F1(2) = F2(2)
F2(1) = F3(1)
F2(2) = F3(2)
F3(1) = FPRT(1)
F3(2) = FPRT(2)
11 CALL CXARTH(ONE,ALAM,DELTA,I1)
CALL CXARTH(F1,ALAM,B1,I3)
CALL CXARTH(B1,ALAM,B1,I3)
CALL CXARTH (DELTA,DELTA,B2,I3)
CALL CXARTH(B2,F2,B2,I3)
CALL CXARTH(ALAM,DELTA,B3,I1)
CALL CXARTH(B3,F3,B3,I3)
CALL CXARTH(B1,B2,G,I2)
CALL CXARTH(G,B3,G,I1)
CALL CXARTH(F1,ALAM,B1,I3)
CALL CXARTH(F2,DELTA,B2,I3)
CALL CXARTH(B1,B2,B2,I2)
CALL CXARTH(B2,F3,B2,I1)
CALL CXARTH(B2,ALAM,B2,I3)
CALL CXARTH(B2,DELTA,B2,I3)
CALL CXARTH(B2,F3,B2,I3)
CALL CXARTH(B2,FOUR,B2,I3)
CALL CXARTH(G,G,B1,I3)
CALL CXARTH(B1,B2,D,I2)
CALL CXSQRT(D,D)
CALL CXARTH(G,D,B1,I1)
CALL CXARTH(G,D,B2,I2)
D(1) = (B1(1) - B1(2))*(B1(1) + B1(2))
D(2) = (B2(1) - B2(2))*(B2(1) + B2(2))
IF(D(1).GE.D(2)) GO TO 13
D(1) = B2(1)
D(2) = B2(2)
GO TO 14
13 D(1) = B1(1)
D(2) = B1(2)
14 CALL CXARTH(F3,DELTA,B1,I3)
CALL CXARTH(B1,TWO,B1,I3)
CALL CXARTH(B1,D,ALAM,I4)
CALL CXARTH(H,ALAM,H,I3)
CALL CXARTH(RT,H,XN,I1)
RT(1) = XN(1)
RT(2) = XN(2)
M = 6
10 CALL VALUE(RT,FPRT)
S = SQRT(FPRT(1)*FPRT(1) + FPRT(2)*FPRT(2))
IF(S.LT.EPS) GO TO 15
MM = MM + 1
IF(MM.LT.MAX) GO TO 18
N = K - 1
RETURN
18 IF(K.EQ.1) GO TO 16
J = 0
17 J = J + 1
J2 = J + J
J1 = J2 - 1
TEMP(1) = RT(1) - ROOT(J1)
TEMP(2) = RT(2) - ROOT(J2)
CALL CXARTH(FPRT,TEMP,FPRT,I4)
IF(J.LT.K - 1) GO TO 17
16 GO TO (1,2,3,4,5,6),M
15 ROOT(K1) = XN(1)
ROOT(K2) = XN(2)
IF(K.NE.N) GO TO 8
RETURN
END


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : FORTRN77.ZIP
Filename : NAMULL.FOR

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

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

  3. 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/