zs1s2.f

Go to the documentation of this file.
00001       SUBROUTINE ZS1S2(ZRR, ZRI, S1R, S1I, S2R, S2I, NZ, ASCLE, ALIM,
00002      * IUF)
00003 C***BEGIN PROLOGUE  ZS1S2
00004 C***REFER TO  ZBESK,ZAIRY
00005 C
00006 C     ZS1S2 TESTS FOR A POSSIBLE UNDERFLOW RESULTING FROM THE
00007 C     ADDITION OF THE I AND K FUNCTIONS IN THE ANALYTIC CON-
00008 C     TINUATION FORMULA WHERE S1=K FUNCTION AND S2=I FUNCTION.
00009 C     ON KODE=1 THE I AND K FUNCTIONS ARE DIFFERENT ORDERS OF
00010 C     MAGNITUDE, BUT FOR KODE=2 THEY CAN BE OF THE SAME ORDER
00011 C     OF MAGNITUDE AND THE MAXIMUM MUST BE AT LEAST ONE
00012 C     PRECISION ABOVE THE UNDERFLOW LIMIT.
00013 C
00014 C***ROUTINES CALLED  XZABS,XZEXP,XZLOG
00015 C***END PROLOGUE  ZS1S2
00016 C     COMPLEX CZERO,C1,S1,S1D,S2,ZR
00017       DOUBLE PRECISION AA, ALIM, ALN, ASCLE, AS1, AS2, C1I, C1R, S1DI,
00018      * S1DR, S1I, S1R, S2I, S2R, ZEROI, ZEROR, ZRI, ZRR, XZABS
00019       INTEGER IUF, IDUM, NZ
00020       DATA ZEROR,ZEROI  / 0.0D0 , 0.0D0 /
00021       NZ = 0
00022       AS1 = XZABS(S1R,S1I)
00023       AS2 = XZABS(S2R,S2I)
00024       IF (S1R.EQ.0.0D0 .AND. S1I.EQ.0.0D0) GO TO 10
00025       IF (AS1.EQ.0.0D0) GO TO 10
00026       ALN = -ZRR - ZRR + DLOG(AS1)
00027       S1DR = S1R
00028       S1DI = S1I
00029       S1R = ZEROR
00030       S1I = ZEROI
00031       AS1 = ZEROR
00032       IF (ALN.LT.(-ALIM)) GO TO 10
00033       CALL XZLOG(S1DR, S1DI, C1R, C1I, IDUM)
00034       C1R = C1R - ZRR - ZRR
00035       C1I = C1I - ZRI - ZRI
00036       CALL XZEXP(C1R, C1I, S1R, S1I)
00037       AS1 = XZABS(S1R,S1I)
00038       IUF = IUF + 1
00039    10 CONTINUE
00040       AA = DMAX1(AS1,AS2)
00041       IF (AA.GT.ASCLE) RETURN
00042       S1R = ZEROR
00043       S1I = ZEROI
00044       S2R = ZEROR
00045       S2I = ZEROI
00046       NZ = 1
00047       IUF = 0
00048       RETURN
00049       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines