Windows installer: Update SBCL.
[maxima.git] / src / numerical / slatec / fortran / zs1s2.f
blobe62809458f772ca39f19a7ea8a44432d0600ba72
1 *DECK ZS1S2
2 SUBROUTINE ZS1S2 (ZRR, ZRI, S1R, S1I, S2R, S2I, NZ, ASCLE, ALIM,
3 + IUF)
4 C***BEGIN PROLOGUE ZS1S2
5 C***SUBSIDIARY
6 C***PURPOSE Subsidiary to ZAIRY and ZBESK
7 C***LIBRARY SLATEC
8 C***TYPE ALL (CS1S2-A, ZS1S2-A)
9 C***AUTHOR Amos, D. E., (SNL)
10 C***DESCRIPTION
12 C ZS1S2 TESTS FOR A POSSIBLE UNDERFLOW RESULTING FROM THE
13 C ADDITION OF THE I AND K FUNCTIONS IN THE ANALYTIC CON-
14 C TINUATION FORMULA WHERE S1=K FUNCTION AND S2=I FUNCTION.
15 C ON KODE=1 THE I AND K FUNCTIONS ARE DIFFERENT ORDERS OF
16 C MAGNITUDE, BUT FOR KODE=2 THEY CAN BE OF THE SAME ORDER
17 C OF MAGNITUDE AND THE MAXIMUM MUST BE AT LEAST ONE
18 C PRECISION ABOVE THE UNDERFLOW LIMIT.
20 C***SEE ALSO ZAIRY, ZBESK
21 C***ROUTINES CALLED ZABS, ZEXP, ZLOG
22 C***REVISION HISTORY (YYMMDD)
23 C 830501 DATE WRITTEN
24 C 910415 Prologue converted to Version 4.0 format. (BAB)
25 C 930122 Added ZEXP and ZLOG to EXTERNAL statement. (RWC)
26 C***END PROLOGUE ZS1S2
27 C COMPLEX CZERO,C1,S1,S1D,S2,ZR
28 DOUBLE PRECISION AA, ALIM, ALN, ASCLE, AS1, AS2, C1I, C1R, S1DI,
29 * S1DR, S1I, S1R, S2I, S2R, ZEROI, ZEROR, ZRI, ZRR, ZABS
30 INTEGER IUF, IDUM, NZ
31 EXTERNAL ZABS, ZEXP, ZLOG
32 DATA ZEROR,ZEROI / 0.0D0 , 0.0D0 /
33 C***FIRST EXECUTABLE STATEMENT ZS1S2
34 NZ = 0
35 AS1 = ZABS(S1R,S1I)
36 AS2 = ZABS(S2R,S2I)
37 IF (S1R.EQ.0.0D0 .AND. S1I.EQ.0.0D0) GO TO 10
38 IF (AS1.EQ.0.0D0) GO TO 10
39 ALN = -ZRR - ZRR + LOG(AS1)
40 S1DR = S1R
41 S1DI = S1I
42 S1R = ZEROR
43 S1I = ZEROI
44 AS1 = ZEROR
45 IF (ALN.LT.(-ALIM)) GO TO 10
46 CALL ZLOG(S1DR, S1DI, C1R, C1I, IDUM)
47 C1R = C1R - ZRR - ZRR
48 C1I = C1I - ZRI - ZRI
49 CALL ZEXP(C1R, C1I, S1R, S1I)
50 AS1 = ZABS(S1R,S1I)
51 IUF = IUF + 1
52 10 CONTINUE
53 AA = MAX(AS1,AS2)
54 IF (AA.GT.ASCLE) RETURN
55 S1R = ZEROR
56 S1I = ZEROI
57 S2R = ZEROR
58 S2I = ZEROI
59 NZ = 1
60 IUF = 0
61 RETURN
62 END