\[ \begin{array}{c}[y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \end{array} \]
Math FPCore C Julia Wolfram TeX \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
(FPCore (x y z t a b)
:precision binary64
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b))) ↓
(FPCore (x y z t a b)
:precision binary64
(if (<= z 5e-57)
(fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t)))))
(+ (- (* x 2.0) (* t (* 9.0 (* z y)))) (* b (* a 27.0))))) double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
↓
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5e-57) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
↓
function code(x, y, z, t, a, b)
tmp = 0.0
if (z <= 5e-57)
tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))));
else
tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(a * 27.0)));
end
return tmp
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5e-57], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
↓
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 98.8% Cost 7492
\[\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 2 Accuracy 98.0% Cost 1476
\[\begin{array}{l}
\mathbf{if}\;z \cdot \left(9 \cdot y\right) \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 97.0% Cost 1476
\[\begin{array}{l}
\mathbf{if}\;z \cdot \left(9 \cdot y\right) \leq 10^{+209}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot \left(b \cdot -27\right) + 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 4 Accuracy 78.0% Cost 1228
\[\begin{array}{l}
t_1 := y \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{-70}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-185}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+23}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + t_1 \cdot -9\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(t \cdot \left(9 \cdot y\right)\right)\\
\end{array}
\]
Alternative 5 Accuracy 77.9% Cost 1228
\[\begin{array}{l}
t_1 := 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-79}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-185}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+24}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(t \cdot \left(9 \cdot y\right)\right)\\
\end{array}
\]
Alternative 6 Accuracy 98.3% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(9 \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 7 Accuracy 52.8% Cost 1096
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+25}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+52}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 8 Accuracy 76.8% Cost 964
\[\begin{array}{l}
\mathbf{if}\;9 \cdot y \leq -1 \cdot 10^{+75}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\end{array}
\]
Alternative 9 Accuracy 75.0% Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{+38}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 0.00095:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 10 Accuracy 47.5% Cost 585
\[\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{-58} \lor \neg \left(b \leq 1.2 \cdot 10^{+87}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Accuracy 47.5% Cost 584
\[\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{-64}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{+87}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 12 Accuracy 48.4% Cost 580
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+74}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 13 Accuracy 48.5% Cost 580
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 14 Accuracy 30.4% Cost 192
\[x \cdot 2
\]