1 SUBROUTINE ZUNI1
(ZR
, ZI
, FNU
, KODE
, N
, YR
, YI
, NZ
, NLAST
, FNUL
,
3 C***BEGIN PROLOGUE ZUNI1
4 C***REFER TO ZBESI,ZBESK
6 C ZUNI1 COMPUTES I(FNU,Z) BY MEANS OF THE UNIFORM ASYMPTOTIC
7 C EXPANSION FOR I(FNU,Z) IN -PI/3.LE.ARG Z.LE.PI/3.
9 C FNUL IS THE SMALLEST ORDER PERMITTED FOR THE ASYMPTOTIC
10 C EXPANSION. NLAST=0 MEANS ALL OF THE Y VALUES WERE SET.
11 C NLAST.NE.0 IS THE NUMBER LEFT TO BE COMPUTED BY ANOTHER
12 C FORMULA FOR ORDERS FNU TO FNU+NLAST-1 BECAUSE FNU+NLAST-1.LT.FNUL.
13 C Y(I)=CZERO FOR I=NLAST+1,N
15 C***ROUTINES CALLED ZUCHK,ZUNIK,ZUOIK,D1MACH,AZABS
16 C***END PROLOGUE ZUNI1
17 C COMPLEX CFN,CONE,CRSC,CSCL,CSR,CSS,CWRK,CZERO,C1,C2,PHI,RZ,SUM,S1,
19 DOUBLE PRECISION ALIM
, APHI
, ASCLE
, BRY
, CONER
, CRSC
,
20 * CSCL
, CSRR
, CSSR
, CWRKI
, CWRKR
, C1R
, C2I
, C2M
, C2R
, ELIM
, FN
,
21 * FNU
, FNUL
, PHII
, PHIR
, RAST
, RS1
, RZI
, RZR
, STI
, STR
, SUMI
,
22 * SUMR
, S1I
, S1R
, S2I
, S2R
, TOL
, YI
, YR
, ZEROI
, ZEROR
, ZETA1I
,
23 * ZETA1R
, ZETA2I
, ZETA2R
, ZI
, ZR
, CYR
, CYI
, D1MACH
, AZABS
24 INTEGER I
, IFLAG
, INIT
, K
, KODE
, M
, N
, ND
, NLAST
, NN
, NUF
, NW
, NZ
25 DIMENSION BRY
(3), YR
(N
), YI
(N
), CWRKR
(16), CWRKI
(16), CSSR
(3),
26 * CSRR
(3), CYR
(2), CYI
(2)
27 DATA ZEROR
,ZEROI
,CONER
/ 0.0D0
, 0.0D0
, 1.0D0
/
32 C-----------------------------------------------------------------------
33 C COMPUTED VALUES WITH EXPONENTS BETWEEN ALIM AND ELIM IN MAG-
34 C NITUDE ARE SCALED TO KEEP INTERMEDIATE ARITHMETIC ON SCALE,
35 C EXP(ALIM)=EXP(ELIM)*TOL
36 C-----------------------------------------------------------------------
45 BRY
(1) = 1.0D
+3*D1MACH
(1)/TOL
46 C-----------------------------------------------------------------------
47 C CHECK FOR UNDERFLOW AND OVERFLOW ON FIRST MEMBER
48 C-----------------------------------------------------------------------
51 CALL ZUNIK
(ZR
, ZI
, FN
, 1, 1, TOL
, INIT
, PHIR
, PHII
, ZETA1R
,
52 * ZETA1I
, ZETA2R
, ZETA2I
, SUMR
, SUMI
, CWRKR
, CWRKI
)
53 IF (KODE
.EQ
.1) GO TO 10
56 RAST
= FN
/AZABS
(STR
,STI
)
63 S1R
= -ZETA1R
+ ZETA2R
64 S1I
= -ZETA1I
+ ZETA2I
67 IF (DABS
(RS1
).GT
.ELIM
) GO TO 130
71 FN
= FNU
+ DBLE
(FLOAT
(ND
-I
))
73 CALL ZUNIK
(ZR
, ZI
, FN
, 1, 0, TOL
, INIT
, PHIR
, PHII
, ZETA1R
,
74 * ZETA1I
, ZETA2R
, ZETA2I
, SUMR
, SUMI
, CWRKR
, CWRKI
)
75 IF (KODE
.EQ
.1) GO TO 40
78 RAST
= FN
/AZABS
(STR
,STI
)
82 S1I
= -ZETA1I
+ STI
+ ZI
85 S1R
= -ZETA1R
+ ZETA2R
86 S1I
= -ZETA1I
+ ZETA2I
88 C-----------------------------------------------------------------------
89 C TEST FOR UNDERFLOW AND OVERFLOW
90 C-----------------------------------------------------------------------
92 IF (DABS
(RS1
).GT
.ELIM
) GO TO 110
94 IF (DABS
(RS1
).LT
.ALIM
) GO TO 60
95 C-----------------------------------------------------------------------
96 C REFINE TEST AND SCALE
97 C-----------------------------------------------------------------------
98 APHI
= AZABS
(PHIR
,PHII
)
99 RS1
= RS1
+ DLOG
(APHI
)
100 IF (DABS
(RS1
).GT
.ELIM
) GO TO 110
101 IF (I
.EQ
.1) IFLAG
= 1
102 IF (RS1
.LT
.0.0D0
) GO TO 60
103 IF (I
.EQ
.1) IFLAG
= 3
105 C-----------------------------------------------------------------------
106 C SCALE S1 IF CABS(S1).LT.ASCLE
107 C-----------------------------------------------------------------------
108 S2R
= PHIR*SUMR
- PHII*SUMI
109 S2I
= PHIR*SUMI
+ PHII*SUMR
110 STR
= DEXP
(S1R
)*CSSR
(IFLAG
)
113 STR
= S2R*S1R
- S2I*S1I
114 S2I
= S2R*S1I
+ S2I*S1R
116 IF (IFLAG
.NE
.1) GO TO 70
117 CALL ZUCHK
(S2R
, S2I
, NW
, BRY
(1), TOL
)
118 IF (NW
.NE
.0) GO TO 110
123 YR
(M
) = S2R*CSRR
(IFLAG
)
124 YI
(M
) = S2I*CSRR
(IFLAG
)
126 IF (ND
.LE
.2) GO TO 100
127 RAST
= 1.0D0
/AZABS
(ZR
,ZI
)
132 BRY
(2) = 1.0D0
/BRY
(1)
145 S2R
= S1R
+ (FNU
+FN
)*(RZR*C2R
-RZI*C2I
)
146 S2I
= S1I
+ (FNU
+FN
)*(RZR*C2I
+RZI*C2R
)
155 IF (IFLAG
.GE
.3) GO TO 90
159 IF (C2M
.LE
.ASCLE
) GO TO 90
166 S1R
= S1R*CSSR
(IFLAG
)
167 S1I
= S1I*CSSR
(IFLAG
)
168 S2R
= S2R*CSSR
(IFLAG
)
169 S2I
= S2I*CSSR
(IFLAG
)
174 C-----------------------------------------------------------------------
175 C SET UNDERFLOW AND UPDATE PARAMETERS
176 C-----------------------------------------------------------------------
178 IF (RS1
.GT
.0.0D0
) GO TO 120
183 IF (ND
.EQ
.0) GO TO 100
184 CALL ZUOIK
(ZR
, ZI
, FNU
, KODE
, 1, ND
, YR
, YI
, NUF
, TOL
, ELIM
, ALIM
)
185 IF (NUF
.LT
.0) GO TO 120
188 IF (ND
.EQ
.0) GO TO 100
189 FN
= FNU
+ DBLE
(FLOAT
(ND
-1))
190 IF (FN
.GE
.FNUL
) GO TO 30
197 IF (RS1
.GT
.0.0D0
) GO TO 120