\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{-103}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \cdot z \leq 10^{+163}:\\
\;\;\;\;\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}\\
\mathbf{elif}\;z \cdot z \leq 4 \cdot 10^{+284}:\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (sqrt (+ (+ (* x x) (* y y)) (* z z)))) ↓
(FPCore (x y z)
:precision binary64
(if (<= (* z z) 2e-103)
(- x)
(if (<= (* z z) 1e+163)
(sqrt (+ (+ (* x x) (* y y)) (* z z)))
(if (<= (* z z) 4e+284) (- x) z)))) double code(double x, double y, double z) {
return sqrt((((x * x) + (y * y)) + (z * z)));
}
↓
double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e-103) {
tmp = -x;
} else if ((z * z) <= 1e+163) {
tmp = sqrt((((x * x) + (y * y)) + (z * z)));
} else if ((z * z) <= 4e+284) {
tmp = -x;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = sqrt((((x * x) + (y * y)) + (z * z)))
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z * z) <= 2d-103) then
tmp = -x
else if ((z * z) <= 1d+163) then
tmp = sqrt((((x * x) + (y * y)) + (z * z)))
else if ((z * z) <= 4d+284) then
tmp = -x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return Math.sqrt((((x * x) + (y * y)) + (z * z)));
}
↓
public static double code(double x, double y, double z) {
double tmp;
if ((z * z) <= 2e-103) {
tmp = -x;
} else if ((z * z) <= 1e+163) {
tmp = Math.sqrt((((x * x) + (y * y)) + (z * z)));
} else if ((z * z) <= 4e+284) {
tmp = -x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z):
return math.sqrt((((x * x) + (y * y)) + (z * z)))
↓
def code(x, y, z):
tmp = 0
if (z * z) <= 2e-103:
tmp = -x
elif (z * z) <= 1e+163:
tmp = math.sqrt((((x * x) + (y * y)) + (z * z)))
elif (z * z) <= 4e+284:
tmp = -x
else:
tmp = z
return tmp
function code(x, y, z)
return sqrt(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)))
end
↓
function code(x, y, z)
tmp = 0.0
if (Float64(z * z) <= 2e-103)
tmp = Float64(-x);
elseif (Float64(z * z) <= 1e+163)
tmp = sqrt(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)));
elseif (Float64(z * z) <= 4e+284)
tmp = Float64(-x);
else
tmp = z;
end
return tmp
end
function tmp = code(x, y, z)
tmp = sqrt((((x * x) + (y * y)) + (z * z)));
end
↓
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z * z) <= 2e-103)
tmp = -x;
elseif ((z * z) <= 1e+163)
tmp = sqrt((((x * x) + (y * y)) + (z * z)));
elseif ((z * z) <= 4e+284)
tmp = -x;
else
tmp = z;
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[Sqrt[N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[N[(z * z), $MachinePrecision], 2e-103], (-x), If[LessEqual[N[(z * z), $MachinePrecision], 1e+163], N[Sqrt[N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(z * z), $MachinePrecision], 4e+284], (-x), z]]]
\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}
↓
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2 \cdot 10^{-103}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \cdot z \leq 10^{+163}:\\
\;\;\;\;\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}\\
\mathbf{elif}\;z \cdot z \leq 4 \cdot 10^{+284}:\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}