Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\sqrt{x \cdot x + \left(y \cdot y + z \cdot z\right)}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{x \cdot x + \left(y \cdot y + z \cdot z\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (sqrt (+ (* x x) (+ (* y y) (* z z))))) ↓
(FPCore (x y z)
:precision binary64
(if (<= y -4.9e+93)
(hypot y x)
(if (<= y 1.4e-28)
(hypot z x)
(if (<= y 6.4e+15)
(sqrt (+ (* x x) (+ (* y y) (* z z))))
(if (<= y 8.2e+51) (hypot z x) (hypot y x)))))) 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 (y <= -4.9e+93) {
tmp = hypot(y, x);
} else if (y <= 1.4e-28) {
tmp = hypot(z, x);
} else if (y <= 6.4e+15) {
tmp = sqrt(((x * x) + ((y * y) + (z * z))));
} else if (y <= 8.2e+51) {
tmp = hypot(z, x);
} else {
tmp = hypot(y, x);
}
return tmp;
}
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 (y <= -4.9e+93) {
tmp = Math.hypot(y, x);
} else if (y <= 1.4e-28) {
tmp = Math.hypot(z, x);
} else if (y <= 6.4e+15) {
tmp = Math.sqrt(((x * x) + ((y * y) + (z * z))));
} else if (y <= 8.2e+51) {
tmp = Math.hypot(z, x);
} else {
tmp = Math.hypot(y, x);
}
return tmp;
}
def code(x, y, z):
return math.sqrt(((x * x) + ((y * y) + (z * z))))
↓
def code(x, y, z):
tmp = 0
if y <= -4.9e+93:
tmp = math.hypot(y, x)
elif y <= 1.4e-28:
tmp = math.hypot(z, x)
elif y <= 6.4e+15:
tmp = math.sqrt(((x * x) + ((y * y) + (z * z))))
elif y <= 8.2e+51:
tmp = math.hypot(z, x)
else:
tmp = math.hypot(y, x)
return tmp
function code(x, y, z)
return sqrt(Float64(Float64(x * x) + Float64(Float64(y * y) + Float64(z * z))))
end
↓
function code(x, y, z)
tmp = 0.0
if (y <= -4.9e+93)
tmp = hypot(y, x);
elseif (y <= 1.4e-28)
tmp = hypot(z, x);
elseif (y <= 6.4e+15)
tmp = sqrt(Float64(Float64(x * x) + Float64(Float64(y * y) + Float64(z * z))));
elseif (y <= 8.2e+51)
tmp = hypot(z, x);
else
tmp = hypot(y, x);
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 (y <= -4.9e+93)
tmp = hypot(y, x);
elseif (y <= 1.4e-28)
tmp = hypot(z, x);
elseif (y <= 6.4e+15)
tmp = sqrt(((x * x) + ((y * y) + (z * z))));
elseif (y <= 8.2e+51)
tmp = hypot(z, x);
else
tmp = hypot(y, x);
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[Sqrt[N[(N[(x * x), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[y, -4.9e+93], N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision], If[LessEqual[y, 1.4e-28], N[Sqrt[z ^ 2 + x ^ 2], $MachinePrecision], If[LessEqual[y, 6.4e+15], N[Sqrt[N[(N[(x * x), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 8.2e+51], N[Sqrt[z ^ 2 + x ^ 2], $MachinePrecision], N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision]]]]]
\sqrt{x \cdot x + \left(y \cdot y + z \cdot z\right)}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{x \cdot x + \left(y \cdot y + z \cdot z\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\end{array}
Alternatives Alternative 1 Error 8.8 Cost 7308
\[\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 0.0002:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{elif}\;y \cdot y \leq 5 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{elif}\;y \cdot y \leq 10^{+182}:\\
\;\;\;\;\mathsf{hypot}\left(z, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\end{array}
\]
Alternative 2 Error 13.6 Cost 7056
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+172}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+15}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 3 Error 37.5 Cost 1580
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{-7}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-81}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-108}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-203}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-273}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-203}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-137}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-46}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+52}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 4 Error 36.6 Cost 592
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.00027:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-194}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-180}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-80}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 5 Error 36.5 Cost 460
\[\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-35}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-180}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-74}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 6 Error 44.2 Cost 328
\[\begin{array}{l}
\mathbf{if}\;x \leq 2.3 \cdot 10^{-180}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-75}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 7 Error 44.2 Cost 196
\[\begin{array}{l}
\mathbf{if}\;x \leq 3.45 \cdot 10^{-54}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 52.0 Cost 64
\[x
\]