2 SUBROUTINE ZBUNI
(ZR
, ZI
, FNU
, KODE
, N
, YR
, YI
, NZ
, NUI
, NLAST
,
3 + FNUL
, TOL
, ELIM
, ALIM
)
4 C***BEGIN PROLOGUE ZBUNI
6 C***PURPOSE Subsidiary to ZBESI and ZBESK
8 C***TYPE ALL (CBUNI-A, ZBUNI-A)
9 C***AUTHOR Amos, D. E., (SNL)
12 C ZBUNI COMPUTES THE I BESSEL FUNCTION FOR LARGE ABS(Z).GT.
13 C FNUL AND FNU+N-1.LT.FNUL. THE ORDER IS INCREASED FROM
14 C FNU+N-1 GREATER THAN FNUL BY ADDING NUI AND COMPUTING
15 C ACCORDING TO THE UNIFORM ASYMPTOTIC EXPANSION FOR I(FNU,Z)
16 C ON IFORM=1 AND THE EXPANSION FOR J(FNU,Z) ON IFORM=2
18 C***SEE ALSO ZBESI, ZBESK
19 C***ROUTINES CALLED D1MACH, ZABS, ZUNI1, ZUNI2
20 C***REVISION HISTORY (YYMMDD)
22 C 910415 Prologue converted to Version 4.0 format. (BAB)
23 C***END PROLOGUE ZBUNI
24 C COMPLEX CSCL,CSCR,CY,RZ,ST,S1,S2,Y,Z
25 DOUBLE PRECISION ALIM
, AX
, AY
, CSCLR
, CSCRR
, CYI
, CYR
, DFNU
,
26 * ELIM
, FNU
, FNUI
, FNUL
, GNU
, RAZ
, RZI
, RZR
, STI
, STR
, S1I
, S1R
,
27 * S2I
, S2R
, TOL
, YI
, YR
, ZI
, ZR
, ZABS
, ASCLE
, BRY
, C1R
, C1I
, C1M
,
29 INTEGER I
, IFLAG
, IFORM
, K
, KODE
, N
, NL
, NLAST
, NUI
, NW
, NZ
30 DIMENSION YR
(N
), YI
(N
), CYR
(2), CYI
(2), BRY
(3)
32 C***FIRST EXECUTABLE STATEMENT ZBUNI
37 IF (AY
.GT
.AX
) IFORM
= 2
38 IF (NUI
.EQ
.0) GO TO 60
42 IF (IFORM
.EQ
.2) GO TO 10
43 C-----------------------------------------------------------------------
44 C ASYMPTOTIC EXPANSION FOR I(FNU,Z) FOR LARGE FNU APPLIED IN
45 C -PI/3.LE.ARG(Z).LE.PI/3
46 C-----------------------------------------------------------------------
47 CALL ZUNI1
(ZR
, ZI
, GNU
, KODE
, 2, CYR
, CYI
, NW
, NLAST
, FNUL
, TOL
,
51 C-----------------------------------------------------------------------
52 C ASYMPTOTIC EXPANSION FOR J(FNU,Z*EXP(M*HPI)) FOR LARGE FNU
53 C APPLIED IN PI/3.LT.ABS(ARG(Z)).LE.PI/2 WHERE M=+I OR -I
55 C-----------------------------------------------------------------------
56 CALL ZUNI2
(ZR
, ZI
, GNU
, KODE
, 2, CYR
, CYI
, NW
, NLAST
, FNUL
, TOL
,
61 STR
= ZABS
(CYR
(1),CYI
(1))
62 C----------------------------------------------------------------------
63 C SCALE BACKWARD RECURRENCE, BRY(3) IS DEFINED BUT NEVER USED
64 C----------------------------------------------------------------------
65 BRY
(1)=1.0D
+3*D1MACH
(1)/TOL
71 IF (STR
.GT
.BRY
(1)) GO TO 21
77 IF (STR
.LT
.BRY
(2)) GO TO 25
87 RAZ
= 1.0D0
/ZABS
(ZR
,ZI
)
95 S2R
= (DFNU
+FNUI
)*(RZR*STR
-RZI*STI
) + S1R
96 S2I
= (DFNU
+FNUI
)*(RZR*STI
+RZI*STR
) + S1I
100 IF (IFLAG
.GE
.3) GO TO 30
106 IF (C1M
.LE
.ASCLE
) GO TO 30
129 S2R
= (FNU
+FNUI
)*(RZR*STR
-RZI*STI
) + S1R
130 S2I
= (FNU
+FNUI
)*(RZR*STI
+RZI*STR
) + S1I
139 IF (IFLAG
.GE
.3) GO TO 40
143 IF (C1M
.LE
.ASCLE
) GO TO 40
163 IF (IFORM
.EQ
.2) GO TO 70
164 C-----------------------------------------------------------------------
165 C ASYMPTOTIC EXPANSION FOR I(FNU,Z) FOR LARGE FNU APPLIED IN
166 C -PI/3.LE.ARG(Z).LE.PI/3
167 C-----------------------------------------------------------------------
168 CALL ZUNI1
(ZR
, ZI
, FNU
, KODE
, N
, YR
, YI
, NW
, NLAST
, FNUL
, TOL
,
172 C-----------------------------------------------------------------------
173 C ASYMPTOTIC EXPANSION FOR J(FNU,Z*EXP(M*HPI)) FOR LARGE FNU
174 C APPLIED IN PI/3.LT.ABS(ARG(Z)).LE.PI/2 WHERE M=+I OR -I
176 C-----------------------------------------------------------------------
177 CALL ZUNI2
(ZR
, ZI
, FNU
, KODE
, N
, YR
, YI
, NW
, NLAST
, FNUL
, TOL
,
180 IF (NW
.LT
.0) GO TO 50