\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
Math FPCore C Java Julia Wolfram TeX \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+67}:\\
\;\;\;\;2 \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{x}\right)}^{1.5}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-225}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\mathbf{elif}\;y \leq 0:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z))))) ↓
(FPCore (x y z)
:precision binary64
(if (<= y -1.12e+67)
(* 2.0 (pow (* (cbrt y) (cbrt x)) 1.5))
(if (<= y -1e-225)
(* 2.0 (sqrt (+ (* x z) (* y (+ x z)))))
(if (<= y 0.0)
(* 2.0 (pow (exp (* 0.25 (- (log (- (- y) z)) (log (/ -1.0 x))))) 2.0))
(* 2.0 (* (sqrt (+ y x)) (sqrt z))))))) double code(double x, double y, double z) {
return 2.0 * sqrt((((x * y) + (x * z)) + (y * z)));
}
↓
double code(double x, double y, double z) {
double tmp;
if (y <= -1.12e+67) {
tmp = 2.0 * pow((cbrt(y) * cbrt(x)), 1.5);
} else if (y <= -1e-225) {
tmp = 2.0 * sqrt(((x * z) + (y * (x + z))));
} else if (y <= 0.0) {
tmp = 2.0 * pow(exp((0.25 * (log((-y - z)) - log((-1.0 / x))))), 2.0);
} else {
tmp = 2.0 * (sqrt((y + x)) * sqrt(z));
}
return tmp;
}
public static double code(double x, double y, double z) {
return 2.0 * Math.sqrt((((x * y) + (x * z)) + (y * z)));
}
↓
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.12e+67) {
tmp = 2.0 * Math.pow((Math.cbrt(y) * Math.cbrt(x)), 1.5);
} else if (y <= -1e-225) {
tmp = 2.0 * Math.sqrt(((x * z) + (y * (x + z))));
} else if (y <= 0.0) {
tmp = 2.0 * Math.pow(Math.exp((0.25 * (Math.log((-y - z)) - Math.log((-1.0 / x))))), 2.0);
} else {
tmp = 2.0 * (Math.sqrt((y + x)) * Math.sqrt(z));
}
return tmp;
}
function code(x, y, z)
return Float64(2.0 * sqrt(Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))))
end
↓
function code(x, y, z)
tmp = 0.0
if (y <= -1.12e+67)
tmp = Float64(2.0 * (Float64(cbrt(y) * cbrt(x)) ^ 1.5));
elseif (y <= -1e-225)
tmp = Float64(2.0 * sqrt(Float64(Float64(x * z) + Float64(y * Float64(x + z)))));
elseif (y <= 0.0)
tmp = Float64(2.0 * (exp(Float64(0.25 * Float64(log(Float64(Float64(-y) - z)) - log(Float64(-1.0 / x))))) ^ 2.0));
else
tmp = Float64(2.0 * Float64(sqrt(Float64(y + x)) * sqrt(z)));
end
return tmp
end
code[x_, y_, z_] := N[(2.0 * N[Sqrt[N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[y, -1.12e+67], N[(2.0 * N[Power[N[(N[Power[y, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-225], N[(2.0 * N[Sqrt[N[(N[(x * z), $MachinePrecision] + N[(y * N[(x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0], N[(2.0 * N[Power[N[Exp[N[(0.25 * N[(N[Log[N[((-y) - z), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[N[(y + x), $MachinePrecision]], $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+67}:\\
\;\;\;\;2 \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{x}\right)}^{1.5}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-225}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\mathbf{elif}\;y \leq 0:\\
\;\;\;\;2 \cdot {\left(e^{0.25 \cdot \left(\log \left(\left(-y\right) - z\right) - \log \left(\frac{-1}{x}\right)\right)}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
Alternatives Alternative 1 Error 1.6 Cost 19980
\[\begin{array}{l}
t_0 := 2 \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{x}\right)}^{1.5}\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{+67}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-224}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\mathbf{elif}\;y \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\]
Alternative 2 Error 10.0 Cost 13380
\[\begin{array}{l}
\mathbf{if}\;y \leq 9.6 \cdot 10^{-267}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{y + x} \cdot \sqrt{z}\right)\\
\end{array}
\]
Alternative 3 Error 10.9 Cost 13252
\[\begin{array}{l}
\mathbf{if}\;y \leq 10^{-266}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\end{array}
\]
Alternative 4 Error 19.7 Cost 7104
\[2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}
\]
Alternative 5 Error 20.5 Cost 6980
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-289}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\]
Alternative 6 Error 19.7 Cost 6980
\[\begin{array}{l}
\mathbf{if}\;y \leq 0:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\]
Alternative 7 Error 21.3 Cost 6916
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-289}:\\
\;\;\;\;2 \cdot {\left(y \cdot x\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\]
Alternative 8 Error 21.3 Cost 6852
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-289}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\]
Alternative 9 Error 62.8 Cost 6720
\[y \cdot \sqrt{\frac{z}{x}}
\]
Alternative 10 Error 41.9 Cost 6720
\[2 \cdot \sqrt{y \cdot z}
\]