KTH framework for Nek5000 toolboxes; testing version  0.0.1
dlapy2.f
Go to the documentation of this file.
1  DOUBLE PRECISION FUNCTION dlapy2( X, Y )
2 *
3 * -- LAPACK auxiliary routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * October 31, 1992
7 *
8 * .. Scalar Arguments ..
9  DOUBLE PRECISION x, y
10 * ..
11 *
12 * Purpose
13 * =======
14 *
15 * DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary
16 * overflow.
17 *
18 * Arguments
19 * =========
20 *
21 * X (input) DOUBLE PRECISION
22 * Y (input) DOUBLE PRECISION
23 * X and Y specify the values x and y.
24 *
25 * =====================================================================
26 *
27 * .. Parameters ..
28  DOUBLE PRECISION zero
29  parameter( zero = 0.0d0 )
30  DOUBLE PRECISION one
31  parameter( one = 1.0d0 )
32 * ..
33 * .. Local Scalars ..
34  DOUBLE PRECISION w, xabs, yabs, z
35 * ..
36 * .. Intrinsic Functions ..
37  INTRINSIC abs, max, min, sqrt
38 * ..
39 * .. Executable Statements ..
40 *
41  xabs = abs( x )
42  yabs = abs( y )
43  w = max( xabs, yabs )
44  z = min( xabs, yabs )
45  IF( z.EQ.zero ) THEN
46  dlapy2 = w
47  ELSE
48  dlapy2 = w*sqrt( one+( z / w )**2 )
49  END IF
50  RETURN
51 *
52 * End of DLAPY2
53 *
54  END
double precision function dlapy2(X, Y)
Definition: dlapy2.f:2