LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

## ◆ slapy3()

 real function slapy3 ( real X, real Y, real Z )

SLAPY3 returns sqrt(x2+y2+z2).

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

Definition at line 67 of file slapy3.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  REAL X, Y, Z
75 * ..
76 *
77 * =====================================================================
78 *
79 * .. Parameters ..
80  REAL ZERO
81  parameter( zero = 0.0e0 )
82 * ..
83 * .. Local Scalars ..
84  REAL W, XABS, YABS, ZABS
85 * ..
86 * .. Intrinsic Functions ..
87  INTRINSIC abs, max, sqrt
88 * ..
89 * .. Executable Statements ..
90 *
91  xabs = abs( x )
92  yabs = abs( y )
93  zabs = abs( z )
94  w = max( xabs, yabs, zabs )
95  IF( w.EQ.zero ) THEN
96 * W can be zero for max(0,nan,0)
97 * adding all three entries together will make sure
98 * NaN will not disappear.
99  slapy3 = xabs + yabs + zabs
100  ELSE
101  slapy3 = w*sqrt( ( xabs / w )**2+( yabs / w )**2+
102  \$ ( zabs / w )**2 )
103  END IF
104  RETURN
105 *
106 * End of SLAPY3
107 *
real function slapy3(X, Y, Z)
SLAPY3 returns sqrt(x2+y2+z2).
Definition: slapy3.f:68