LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ slapy3()

real function slapy3 ( real x,
real y,
real z )

SLAPY3 returns sqrt(x2+y2+z2).

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

Purpose:
!>
!> SLAPY3 returns sqrt(x**2+y**2+z**2), taking care not to cause
!> unnecessary overflow and unnecessary underflow.
!> 
Parameters
[in]X
!>          X is REAL
!> 
[in]Y
!>          Y is REAL
!> 
[in]Z
!>          Z is REAL
!>          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 slapy3.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 REAL X, Y, Z
73* ..
74*
75* =====================================================================
76*
77* .. Parameters ..
78 REAL ZERO
79 parameter( zero = 0.0e0 )
80* ..
81* .. Local Scalars ..
82 REAL W, XABS, YABS, ZABS, HUGEVAL
83* ..
84* .. External Subroutines ..
85 REAL SLAMCH
86* ..
87* .. Intrinsic Functions ..
88 INTRINSIC abs, max, sqrt
89* ..
90* .. Executable Statements ..
91*
92 hugeval = slamch( '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 slapy3 = xabs + yabs + zabs
102 ELSE
103 slapy3 = w*sqrt( ( xabs / w )**2+( yabs / w )**2+
104 $ ( zabs / w )**2 )
105 END IF
106 RETURN
107*
108* End of SLAPY3
109*
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
real function slapy3(x, y, z)
SLAPY3 returns sqrt(x2+y2+z2).
Definition slapy3.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: