LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function dlapy2 ( double precision  X,
double precision  Y 
)

DLAPY2 returns sqrt(x2+y2).

Download DLAPY2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary
 overflow.
Parameters
[in]X
          X is DOUBLE PRECISION
[in]Y
          Y is DOUBLE PRECISION
          X and Y specify the values x and y.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012

Definition at line 65 of file dlapy2.f.

65 *
66 * -- LAPACK auxiliary routine (version 3.4.2) --
67 * -- LAPACK is a software package provided by Univ. of Tennessee, --
68 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
69 * September 2012
70 *
71 * .. Scalar Arguments ..
72  DOUBLE PRECISION x, y
73 * ..
74 *
75 * =====================================================================
76 *
77 * .. Parameters ..
78  DOUBLE PRECISION zero
79  parameter ( zero = 0.0d0 )
80  DOUBLE PRECISION one
81  parameter ( one = 1.0d0 )
82 * ..
83 * .. Local Scalars ..
84  DOUBLE PRECISION w, xabs, yabs, z
85 * ..
86 * .. Intrinsic Functions ..
87  INTRINSIC abs, max, min, sqrt
88 * ..
89 * .. Executable Statements ..
90 *
91  xabs = abs( x )
92  yabs = abs( y )
93  w = max( xabs, yabs )
94  z = min( xabs, yabs )
95  IF( z.EQ.zero ) THEN
96  dlapy2 = w
97  ELSE
98  dlapy2 = w*sqrt( one+( z / w )**2 )
99  END IF
100  RETURN
101 *
102 * End of DLAPY2
103 *
double precision function dlapy2(X, Y)
DLAPY2 returns sqrt(x2+y2).
Definition: dlapy2.f:65