GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
xzabs.f
Go to the documentation of this file.
1  DOUBLE PRECISION FUNCTION xzabs(ZR, ZI)
2 C***BEGIN PROLOGUE XZABS
3 C***REFER TO ZBESH,ZBESI,ZBESJ,ZBESK,ZBESY,ZAIRY,ZBIRY
4 C
5 C XZABS COMPUTES THE ABSOLUTE VALUE OR MAGNITUDE OF A DOUBLE
6 C PRECISION COMPLEX VARIABLE CMPLX(ZR,ZI)
7 C
8 C***ROUTINES CALLED (NONE)
9 C***END PROLOGUE XZABS
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  xzabs = v*dsqrt(1.d+0+q*q)
23  RETURN
24  10 q = v/u
25  xzabs = u*dsqrt(1.d+0+q*q)
26  RETURN
27  20 xzabs = 0.0d+0
28  RETURN
29  END
double precision function xzabs(ZR, ZI)
Definition: xzabs.f:2