\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}
\]
↓
\[\mathsf{hypot}\left(z, x\right)
\]
(FPCore (x y z) :precision binary64 (sqrt (+ (+ (* x x) (* y y)) (* z z)))) ↓
(FPCore (x y z) :precision binary64 (hypot z 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) {
return hypot(z, x);
}
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) {
return Math.hypot(z, x);
}
def code(x, y, z):
return math.sqrt((((x * x) + (y * y)) + (z * z)))
↓
def code(x, y, z):
return math.hypot(z, x)
function code(x, y, z)
return sqrt(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)))
end
↓
function code(x, y, z)
return hypot(z, x)
end
function tmp = code(x, y, z)
tmp = sqrt((((x * x) + (y * y)) + (z * z)));
end
↓
function tmp = code(x, y, z)
tmp = hypot(z, x);
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_] := N[Sqrt[z ^ 2 + x ^ 2], $MachinePrecision]
\sqrt{\left(x \cdot x + y \cdot y\right) + z \cdot z}
↓
\mathsf{hypot}\left(z, x\right)
Alternatives Alternative 1 Error 16.5 Cost 6924
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.629999090693948 \cdot 10^{-193}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -3.203970299165952 \cdot 10^{-228}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -7.585791708285869 \cdot 10^{-298}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(z, y\right)\\
\end{array}
\]
Alternative 2 Error 16.3 Cost 6924
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.629999090693948 \cdot 10^{-193}:\\
\;\;\;\;\mathsf{hypot}\left(y, x\right)\\
\mathbf{elif}\;y \leq -3.203970299165952 \cdot 10^{-228}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -7.585791708285869 \cdot 10^{-298}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(z, y\right)\\
\end{array}
\]
Alternative 3 Error 16.8 Cost 972
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.629999090693948 \cdot 10^{-193}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -3.203970299165952 \cdot 10^{-228}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -7.585791708285869 \cdot 10^{-298}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 4 Error 16.8 Cost 524
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.629999090693948 \cdot 10^{-193}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -3.203970299165952 \cdot 10^{-228}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -7.585791708285869 \cdot 10^{-298}:\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 5 Error 31.7 Cost 64
\[z
\]