\[ \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^{-147}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 + y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\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-147)
(fma a (* 27.0 b) (+ (* x 2.0) (* y (* (* z t) -9.0))))
(+ (+ (* x 2.0) (* (* z y) (* t -9.0))) (* a (* 27.0 b))))) 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-147) {
tmp = fma(a, (27.0 * b), ((x * 2.0) + (y * ((z * t) * -9.0))));
} else {
tmp = ((x * 2.0) + ((z * y) * (t * -9.0))) + (a * (27.0 * b));
}
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-147)
tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) + Float64(y * Float64(Float64(z * t) * -9.0))));
else
tmp = Float64(Float64(Float64(x * 2.0) + Float64(Float64(z * y) * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b)));
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-147], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] + N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $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^{-147}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 + y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 95.4% Cost 1609
\[\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{-206} \lor \neg \left(y \cdot 9 \leq 5 \cdot 10^{-234}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 2 Accuracy 77.1% Cost 1232
\[\begin{array}{l}
t_1 := x \cdot 2 + \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
t_2 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -4.3 \cdot 10^{-166}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 3 Accuracy 77.1% Cost 1232
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.85 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+73}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 4 Accuracy 99.0% Cost 1220
\[\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{-37}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + t_1\\
\end{array}
\]
Alternative 5 Accuracy 69.2% Cost 1105
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.4 \cdot 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-271}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{-202} \lor \neg \left(b \leq 1.45 \cdot 10^{-186}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\end{array}
\]
Alternative 6 Accuracy 69.2% Cost 1104
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -6.2 \cdot 10^{-303}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-272}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{-200}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-186}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 7 Accuracy 81.7% Cost 1096
\[\begin{array}{l}
\mathbf{if}\;x \leq -26000000:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-67}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 8 Accuracy 81.8% Cost 1096
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -420:\\
\;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-67}:\\
\;\;\;\;t_1 + \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t_1\\
\end{array}
\]
Alternative 9 Accuracy 54.1% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-260}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-214}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 10000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 10 Accuracy 54.1% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{-259}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-216}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;x \leq 11000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Accuracy 55.7% Cost 848
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-259}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 8200000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 12 Accuracy 55.9% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2000000000:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 13 Accuracy 40.8% Cost 192
\[x \cdot 2
\]