1 SUBROUTINE ZRATI
(ZR
, ZI
, FNU
, N
, CYR
, CYI
, TOL
)
2 C***BEGIN PROLOGUE ZRATI
3 C***REFER TO ZBESI,ZBESK,ZBESH
5 C ZRATI COMPUTES RATIOS OF I BESSEL FUNCTIONS BY BACKWARD
6 C RECURRENCE. THE STARTING INDEX IS DETERMINED BY FORWARD
7 C RECURRENCE AS DESCRIBED IN J. RES. OF NAT. BUR. OF STANDARDS-B,
8 C MATHEMATICAL SCIENCES, VOL 77B, P111-114, SEPTEMBER, 1973,
9 C BESSEL FUNCTIONS I AND J OF COMPLEX ARGUMENT AND INTEGER ORDER,
12 C***ROUTINES CALLED AZABS,ZDIV
13 C***END PROLOGUE ZRATI
14 C COMPLEX Z,CY(1),CONE,CZERO,P1,P2,T1,RZ,PT,CDFNU
15 DOUBLE PRECISION AK
, AMAGZ
, AP1
, AP2
, ARG
, AZ
, CDFNUI
, CDFNUR
,
16 * CONEI
, CONER
, CYI
, CYR
, CZEROI
, CZEROR
, DFNU
, FDNU
, FLAM
, FNU
,
17 * FNUP
, PTI
, PTR
, P1I
, P1R
, P2I
, P2R
, RAK
, RAP1
, RHO
, RT2
, RZI
,
18 * RZR
, TEST
, TEST1
, TOL
, TTI
, TTR
, T1I
, T1R
, ZI
, ZR
, AZABS
19 INTEGER I
, ID
, IDNU
, INU
, ITIME
, K
, KK
, MAGZ
, N
20 DIMENSION CYR
(N
), CYI
(N
)
21 DATA CZEROR
,CZEROI
,CONER
,CONEI
,RT2
/
22 1 0.0D0
, 0.0D0
, 1.0D0
, 0.0D0
, 1.41421356237309505D0
/
27 AMAGZ
= DBLE
(FLOAT
(MAGZ
+1))
28 FDNU
= DBLE
(FLOAT
(IDNU
))
29 FNUP
= DMAX1
(AMAGZ
,FDNU
)
35 RZI
= -PTR*
(ZI
+ZI
)*PTR
47 C-----------------------------------------------------------------------
48 C THE OVERFLOW TEST ON K(FNU+I-1,Z) BEFORE THE CALL TO CBKNU
49 C GUARANTEES THAT P2 IS ON SCALE. SCALE TEST1 AND ALL SUBSEQUENT
50 C P2 VALUES BY AP1 TO ENSURE THAT AN OVERFLOW DOES NOT OCCUR
52 C-----------------------------------------------------------------------
53 ARG
= (AP2
+AP2
)/(AP1*TOL
)
67 P2R
= P1R
- (T1R*PTR
-T1I*PTI
)
68 P2I
= P1I
- (T1R*PTI
+T1I*PTR
)
74 IF (AP1
.LE
.TEST
) GO TO 10
75 IF (ITIME
.EQ
.2) GO TO 20
76 AK
= AZABS
(T1R
,T1I
)*0.5D0
77 FLAM
= AK
+ DSQRT
(AK*AK
-1.0D0
)
78 RHO
= DMIN1
(AP2
/AP1
,FLAM
)
79 TEST
= TEST1*DSQRT
(RHO
/(RHO*RHO
-1.0D0
))
87 DFNU
= FNU
+ DBLE
(FLOAT
(N
-1))
98 P1R
= (PTR*TTR
-PTI*TTI
) + P2R
99 P1I
= (PTR*TTI
+PTI*TTR
) + P2I
104 IF (P1R
.NE
.CZEROR
.OR
. P1I
.NE
.CZEROI
) GO TO 40
108 CALL ZDIV
(P2R
, P2I
, P1R
, P1I
, CYR
(N
), CYI
(N
))
117 PTR
= CDFNUR
+ (T1R*RZR
-T1I*RZI
) + CYR
(K
+1)
118 PTI
= CDFNUI
+ (T1R*RZI
+T1I*RZR
) + CYI
(K
+1)
120 IF (AK
.NE
.CZEROR
) GO TO 50
127 CYI
(K
) = -RAK*PTI*RAK