LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

◆ dlapy3()

double precision function dlapy3 ( double precision x,
double precision y,
double precision z )

DLAPY3 returns sqrt(x2+y2+z2).

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

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

Definition at line 65 of file dlapy3.f.

66*
67* -- LAPACK auxiliary routine --
68* -- LAPACK is a software package provided by Univ. of Tennessee, --
69* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
70*
71* .. Scalar Arguments ..
72 DOUBLE PRECISION X, Y, Z
73* ..
74*
75* =====================================================================
76*
77* .. Parameters ..
78 DOUBLE PRECISION ZERO
79 parameter( zero = 0.0d0 )
80* ..
81* .. Local Scalars ..
82 DOUBLE PRECISION W, XABS, YABS, ZABS, HUGEVAL
83* ..
84* .. External Subroutines ..
85 DOUBLE PRECISION DLAMCH
86* ..
87* .. Intrinsic Functions ..
88 INTRINSIC abs, max, sqrt
89* ..
90* .. Executable Statements ..
91*
92 hugeval = dlamch( 'Overflow' )
93 xabs = abs( x )
94 yabs = abs( y )
95 zabs = abs( z )
96 w = max( xabs, yabs, zabs )
97 IF( w.EQ.zero .OR. w.GT.hugeval ) THEN
98* W can be zero for max(0,nan,0)
99* adding all three entries together will make sure
100* NaN will not disappear.
101 dlapy3 = xabs + yabs + zabs
102 ELSE
103 dlapy3 = w*sqrt( ( xabs / w )**2+( yabs / w )**2+
104 $ ( zabs / w )**2 )
105 END IF
106 RETURN
107*
108* End of DLAPY3
109*
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlapy3(x, y, z)
DLAPY3 returns sqrt(x2+y2+z2).
Definition dlapy3.f:66
program zabs
zabs tests the robustness and precision of the intrinsic ABS for double complex
Here is the call graph for this function:
Here is the caller graph for this function: