Fix missing import in finiterectlat-scatter.py
[qpms.git] / amos / zabs.f
blob31514a2d6aaeb388f776e0b7e0d6291916cd6838
1 DOUBLE PRECISION FUNCTION AZABS(ZR, ZI)
2 C***BEGIN PROLOGUE AZABS
3 C***REFER TO ZBESH,ZBESI,ZBESJ,ZBESK,ZBESY,ZAIRY,ZBIRY
5 C AZABS COMPUTES THE ABSOLUTE VALUE OR MAGNITUDE OF A DOUBLE
6 C PRECISION COMPLEX VARIABLE CMPLX(ZR,ZI)
8 C***ROUTINES CALLED (NONE)
9 C***END PROLOGUE AZABS
10 DOUBLE PRECISION ZR, ZI, U, V, Q, S
11 U = DABS(ZR)
12 V = DABS(ZI)
13 S = U + V
14 C-----------------------------------------------------------------------
15 C S*1.0D0 MAKES AN UNNORMALIZED UNDERFLOW ON CDC MACHINES INTO A
16 C TRUE FLOATING ZERO
17 C-----------------------------------------------------------------------
18 S = S*1.0D+0
19 IF (S.EQ.0.0D+0) GO TO 20
20 IF (U.GT.V) GO TO 10
21 Q = U/V
22 AZABS = V*DSQRT(1.D+0+Q*Q)
23 RETURN
24 10 Q = V/U
25 AZABS = U*DSQRT(1.D+0+Q*Q)
26 RETURN
27 20 AZABS = 0.0D+0
28 RETURN
29 END