\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
\[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{x}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\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 -1e-310)
(* 2.0 (pow (* (cbrt y) (cbrt x)) 1.5))
(* 2.0 (* (sqrt z) (sqrt y)))))
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 <= -1e-310) {
tmp = 2.0 * pow((cbrt(y) * cbrt(x)), 1.5);
} else {
tmp = 2.0 * (sqrt(z) * sqrt(y));
}
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 <= -1e-310) {
tmp = 2.0 * Math.pow((Math.cbrt(y) * Math.cbrt(x)), 1.5);
} else {
tmp = 2.0 * (Math.sqrt(z) * Math.sqrt(y));
}
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 <= -1e-310)
tmp = Float64(2.0 * (Float64(cbrt(y) * cbrt(x)) ^ 1.5));
else
tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(y)));
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, -1e-310], N[(2.0 * N[Power[N[(N[Power[y, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sqrt[z], $MachinePrecision] * N[Sqrt[y], $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 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot {\left(\sqrt[3]{y} \cdot \sqrt[3]{x}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 71.5% |
|---|
| Cost | 14921 |
|---|
\[\begin{array}{l}
t_0 := \left(x \cdot z + y \cdot x\right) + y \cdot z\\
\mathbf{if}\;t_0 \leq 10^{-322} \lor \neg \left(t_0 \leq \infty\right):\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot \left(y + x\right)\right)}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 71.5% |
|---|
| Cost | 14665 |
|---|
\[\begin{array}{l}
t_0 := \left(x \cdot z + y \cdot x\right) + y \cdot z\\
\mathbf{if}\;t_0 \leq 10^{-322} \lor \neg \left(t_0 \leq \infty\right):\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 69.2% |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 10^{-302}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot z + y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 69.3% |
|---|
| Cost | 7104 |
|---|
\[2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}
\]
| Alternative 5 |
|---|
| Accuracy | 69.3% |
|---|
| Cost | 7104 |
|---|
\[2 \cdot \sqrt{x \cdot z + y \cdot \left(x + z\right)}
\]
| Alternative 6 |
|---|
| Accuracy | 67.9% |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-263}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 69.2% |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-298}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(y + x\right)}\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 66.9% |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot x}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 34.2% |
|---|
| Cost | 6720 |
|---|
\[2 \cdot \sqrt{y \cdot x}
\]