LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ dlapy3()

 double precision function dlapy3 ( double precision X, double precision Y, double precision Z )

DLAPY3 returns sqrt(x2+y2+z2).

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.```

Definition at line 67 of file dlapy3.f.

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