2019-03-19 16:42:47 +02:00
|
|
|
SUBROUTINE ZS1S2(ZRR, ZRI, S1R, S1I, S2R, S2I, NZ, ASCLE, ALIM,
|
|
|
|
* IUF)
|
|
|
|
C***BEGIN PROLOGUE ZS1S2
|
|
|
|
C***REFER TO ZBESK,ZAIRY
|
|
|
|
C
|
|
|
|
C ZS1S2 TESTS FOR A POSSIBLE UNDERFLOW RESULTING FROM THE
|
|
|
|
C ADDITION OF THE I AND K FUNCTIONS IN THE ANALYTIC CON-
|
|
|
|
C TINUATION FORMULA WHERE S1=K FUNCTION AND S2=I FUNCTION.
|
|
|
|
C ON KODE=1 THE I AND K FUNCTIONS ARE DIFFERENT ORDERS OF
|
|
|
|
C MAGNITUDE, BUT FOR KODE=2 THEY CAN BE OF THE SAME ORDER
|
|
|
|
C OF MAGNITUDE AND THE MAXIMUM MUST BE AT LEAST ONE
|
|
|
|
C PRECISION ABOVE THE UNDERFLOW LIMIT.
|
|
|
|
C
|
2019-03-20 12:25:42 +02:00
|
|
|
C***ROUTINES CALLED AZABS,AZEXP,AZLOG
|
2019-03-19 16:42:47 +02:00
|
|
|
C***END PROLOGUE ZS1S2
|
|
|
|
C COMPLEX CZERO,C1,S1,S1D,S2,ZR
|
|
|
|
DOUBLE PRECISION AA, ALIM, ALN, ASCLE, AS1, AS2, C1I, C1R, S1DI,
|
2019-03-20 12:25:42 +02:00
|
|
|
* S1DR, S1I, S1R, S2I, S2R, ZEROI, ZEROR, ZRI, ZRR, AZABS
|
2019-03-19 16:42:47 +02:00
|
|
|
INTEGER IUF, IDUM, NZ
|
|
|
|
DATA ZEROR,ZEROI / 0.0D0 , 0.0D0 /
|
|
|
|
NZ = 0
|
2019-03-20 12:25:42 +02:00
|
|
|
AS1 = AZABS(S1R,S1I)
|
|
|
|
AS2 = AZABS(S2R,S2I)
|
2019-03-19 16:42:47 +02:00
|
|
|
IF (S1R.EQ.0.0D0 .AND. S1I.EQ.0.0D0) GO TO 10
|
|
|
|
IF (AS1.EQ.0.0D0) GO TO 10
|
|
|
|
ALN = -ZRR - ZRR + DLOG(AS1)
|
|
|
|
S1DR = S1R
|
|
|
|
S1DI = S1I
|
|
|
|
S1R = ZEROR
|
|
|
|
S1I = ZEROI
|
|
|
|
AS1 = ZEROR
|
|
|
|
IF (ALN.LT.(-ALIM)) GO TO 10
|
2019-03-20 12:25:42 +02:00
|
|
|
CALL AZLOG(S1DR, S1DI, C1R, C1I, IDUM)
|
2019-03-19 16:42:47 +02:00
|
|
|
C1R = C1R - ZRR - ZRR
|
|
|
|
C1I = C1I - ZRI - ZRI
|
2019-03-20 12:25:42 +02:00
|
|
|
CALL AZEXP(C1R, C1I, S1R, S1I)
|
|
|
|
AS1 = AZABS(S1R,S1I)
|
2019-03-19 16:42:47 +02:00
|
|
|
IUF = IUF + 1
|
|
|
|
10 CONTINUE
|
|
|
|
AA = DMAX1(AS1,AS2)
|
|
|
|
IF (AA.GT.ASCLE) RETURN
|
|
|
|
S1R = ZEROR
|
|
|
|
S1I = ZEROI
|
|
|
|
S2R = ZEROR
|
|
|
|
S2I = ZEROI
|
|
|
|
NZ = 1
|
|
|
|
IUF = 0
|
|
|
|
RETURN
|
|
|
|
END
|