1 SUBROUTINE ZASYI
(ZR
, ZI
, FNU
, KODE
, N
, YR
, YI
, NZ
, RL
, TOL
, ELIM
,
3 C***BEGIN PROLOGUE ZASYI
4 C***REFER TO ZBESI,ZBESK
6 C ZASYI COMPUTES THE I BESSEL FUNCTION FOR REAL(Z).GE.0.0 BY
7 C MEANS OF THE ASYMPTOTIC EXPANSION FOR LARGE CABS(Z) IN THE
8 C REGION CABS(Z).GT.MAX(RL,FNU*FNU/2). NZ=0 IS A NORMAL RETURN.
9 C NZ.LT.0 INDICATES AN OVERFLOW ON KODE=1.
11 C***ROUTINES CALLED D1MACH,AZABS,ZDIV,AZEXP,ZMLT,AZSQRT
12 C***END PROLOGUE ZASYI
13 C COMPLEX AK1,CK,CONE,CS1,CS2,CZ,CZERO,DK,EZ,P1,RZ,S2,Y,Z
14 DOUBLE PRECISION AA
, AEZ
, AK
, AK1I
, AK1R
, ALIM
, ARG
, ARM
, ATOL
,
15 * AZ
, BB
, BK
, CKI
, CKR
, CONEI
, CONER
, CS1I
, CS1R
, CS2I
, CS2R
, CZI
,
16 * CZR
, DFNU
, DKI
, DKR
, DNU2
, ELIM
, EZI
, EZR
, FDN
, FNU
, PI
, P1I
,
17 * P1R
, RAZ
, RL
, RTPI
, RTR1
, RZI
, RZR
, S
, SGN
, SQK
, STI
, STR
, S2I
,
18 * S2R
, TOL
, TZI
, TZR
, YI
, YR
, ZEROI
, ZEROR
, ZI
, ZR
, D1MACH
, AZABS
19 INTEGER I
, IB
, IL
, INU
, J
, JL
, K
, KODE
, KODED
, M
, N
, NN
, NZ
20 DIMENSION YR
(N
), YI
(N
)
21 DATA PI
, RTPI
/3.14159265358979324D0
, 0.159154943091895336D0
/
22 DATA ZEROR
,ZEROI
,CONER
,CONEI
/ 0.0D0
, 0.0D0
, 1.0D0
, 0.0D0
/
26 ARM
= 1.0D
+3*D1MACH
(1)
29 DFNU
= FNU
+ DBLE
(FLOAT
(N
-IL
))
30 C-----------------------------------------------------------------------
32 C-----------------------------------------------------------------------
38 CALL AZSQRT
(AK1R
, AK1I
, AK1R
, AK1I
)
41 IF (KODE
.NE
.2) GO TO 10
45 IF (DABS
(CZR
).GT
.ELIM
) GO TO 100
48 IF ((DABS
(CZR
).GT
.ALIM
) .AND
. (N
.GT
.2)) GO TO 20
50 CALL AZEXP
(CZR
, CZI
, STR
, STI
)
51 CALL ZMLT
(AK1R
, AK1I
, STR
, STI
, AK1R
, AK1I
)
54 IF (DNU2
.GT
.RTR1
) FDN
= DNU2*DNU2
57 C-----------------------------------------------------------------------
58 C WHEN Z IS IMAGINARY, THE ERROR TEST MUST BE MADE RELATIVE TO THE
59 C FIRST RECIPROCAL POWER SINCE THIS IS THE LEADING TERM OF THE
60 C EXPANSION FOR THE IMAGINARY PART.
61 C-----------------------------------------------------------------------
64 JL
= INT
(SNGL
(RL
+RL
)) + 2
67 IF (ZI
.EQ
.0.0D0
) GO TO 30
68 C-----------------------------------------------------------------------
69 C CALCULATE EXP(PI*(0.5+FNU+N-IL)*I) TO MINIMIZE LOSSES OF
70 C SIGNIFICANCE WHEN FNU OR N IS LARGE
71 C-----------------------------------------------------------------------
73 ARG
= (FNU
-DBLE
(FLOAT
(INU
)))*PI
77 IF (ZI
.LT
.0.0D0
) BK
= -BK
80 IF (MOD
(INU
,2).EQ
.0) GO TO 30
100 CALL ZDIV
(CKR
, CKI
, DKR
, DKI
, STR
, STI
)
106 CS1R
= CS1R
+ CKR*SGN
107 CS1I
= CS1I
+ CKI*SGN
114 IF (AA
.LE
.ATOL
) GO TO 50
120 IF (ZR
+ZR
.GE
.ELIM
) GO TO 60
123 CALL AZEXP
(-TZR
, -TZI
, STR
, STI
)
124 CALL ZMLT
(STR
, STI
, P1R
, P1I
, STR
, STI
)
125 CALL ZMLT
(STR
, STI
, CS2R
, CS2I
, STR
, STI
)
129 FDN
= FDN
+ 8.0D0*DFNU
+ 4.0D0
133 YR
(M
) = S2R*AK1R
- S2I*AK1I
134 YI
(M
) = S2R*AK1I
+ S2I*AK1R
146 YR
(K
) = (AK
+FNU
)*(RZR*YR
(K
+1)-RZI*YI
(K
+1)) + YR
(K
+2)
147 YI
(K
) = (AK
+FNU
)*(RZR*YI
(K
+1)+RZI*YR
(K
+1)) + YI
(K
+2)
151 IF (KODED
.EQ
.0) RETURN
152 CALL AZEXP
(CZR
, CZI
, CKR
, CKI
)
154 STR
= YR
(I
)*CKR
- YI
(I
)*CKI
155 YI
(I
) = YR
(I
)*CKI
+ YI
(I
)*CKR