\[ \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}\;y \cdot 9 \leq -1.5 \cdot 10^{+67}:\\
\;\;\;\;\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(\left(y \cdot 9\right) \cdot z\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 (<= (* y 9.0) -1.5e+67)
(fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t)))))
(+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* 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 ((y * 9.0) <= -1.5e+67) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (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 (Float64(y * 9.0) <= -1.5e+67)
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(Float64(y * 9.0) * z))) + 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[N[(y * 9.0), $MachinePrecision], -1.5e+67], 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[(N[(y * 9.0), $MachinePrecision] * z), $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}\;y \cdot 9 \leq -1.5 \cdot 10^{+67}:\\
\;\;\;\;\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(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 98.4% Cost 7620
\[\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -1.5 \cdot 10^{+67}:\\
\;\;\;\;\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(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 2 Accuracy 97.7% Cost 1476
\[\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\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 46.2% Cost 1373
\[\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-138}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-86}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-38}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+114} \lor \neg \left(t \leq 9.5 \cdot 10^{+155}\right) \land t \leq 1.8 \cdot 10^{+183}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Accuracy 97.7% Cost 1348
\[\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -1.5 \cdot 10^{+67}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 5 Accuracy 97.1% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{+103}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\]
Alternative 6 Accuracy 79.7% Cost 1096
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-82}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 7 Accuracy 78.0% Cost 969
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+23} \lor \neg \left(z \leq 1.6 \cdot 10^{-32}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 8 Accuracy 74.6% Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+25}:\\
\;\;\;\;\left(y \cdot 9\right) \cdot \left(z \cdot \left(-t\right)\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-8}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\end{array}
\]
Alternative 9 Accuracy 74.7% Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+24}:\\
\;\;\;\;\left(y \cdot 9\right) \cdot \left(z \cdot \left(-t\right)\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\end{array}
\]
Alternative 10 Accuracy 47.4% Cost 585
\[\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+120} \lor \neg \left(a \leq 7.5 \cdot 10^{-89}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Accuracy 30.3% Cost 192
\[x \cdot 2
\]