\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
Math FPCore C Julia Wolfram TeX \[2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
\]
↓
\[\begin{array}{l}
t_0 := \left(x \cdot y + x \cdot z\right) + y \cdot z\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-324} \lor \neg \left(t_0 \leq 10^{+305}\right):\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot \left(x + y\right)\right)}\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z))))) ↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (+ (* x y) (* x z)) (* y z))))
(if (or (<= t_0 5e-324) (not (<= t_0 1e+305)))
(* 2.0 (* (sqrt z) (sqrt y)))
(* 2.0 (sqrt (fma x y (* z (+ x 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 t_0 = ((x * y) + (x * z)) + (y * z);
double tmp;
if ((t_0 <= 5e-324) || !(t_0 <= 1e+305)) {
tmp = 2.0 * (sqrt(z) * sqrt(y));
} else {
tmp = 2.0 * sqrt(fma(x, y, (z * (x + 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)
t_0 = Float64(Float64(Float64(x * y) + Float64(x * z)) + Float64(y * z))
tmp = 0.0
if ((t_0 <= 5e-324) || !(t_0 <= 1e+305))
tmp = Float64(2.0 * Float64(sqrt(z) * sqrt(y)));
else
tmp = Float64(2.0 * sqrt(fma(x, y, Float64(z * Float64(x + 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_] := Block[{t$95$0 = N[(N[(N[(x * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-324], N[Not[LessEqual[t$95$0, 1e+305]], $MachinePrecision]], N[(2.0 * N[(N[Sqrt[z], $MachinePrecision] * N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[Sqrt[N[(x * y + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
2 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}
↓
\begin{array}{l}
t_0 := \left(x \cdot y + x \cdot z\right) + y \cdot z\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-324} \lor \neg \left(t_0 \leq 10^{+305}\right):\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{\mathsf{fma}\left(x, y, z \cdot \left(x + y\right)\right)}\\
\end{array}
Alternatives Alternative 1 Error 10.5 Cost 14665
\[\begin{array}{l}
t_0 := \left(x \cdot y + x \cdot z\right) + y \cdot z\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-324} \lor \neg \left(t_0 \leq 10^{+305}\right):\\
\;\;\;\;2 \cdot \left(\sqrt{z} \cdot \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}\\
\end{array}
\]
Alternative 2 Error 19.7 Cost 7104
\[2 \cdot \sqrt{y \cdot z + x \cdot \left(y + z\right)}
\]
Alternative 3 Error 21.0 Cost 6980
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-246}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(x + y\right)}\\
\end{array}
\]
Alternative 4 Error 20.3 Cost 6980
\[\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-245}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot \left(y + z\right)}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{z \cdot \left(x + y\right)}\\
\end{array}
\]
Alternative 5 Error 21.2 Cost 6852
\[\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-310}:\\
\;\;\;\;2 \cdot \sqrt{x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \sqrt{y \cdot z}\\
\end{array}
\]
Alternative 6 Error 41.3 Cost 6720
\[2 \cdot \sqrt{x \cdot y}
\]