\[ \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 6 \cdot 10^{+32}:\\
\;\;\;\;\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 6e+32)
(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 <= 6e+32) {
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 <= 6e+32)
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, 6e+32], 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 6 \cdot 10^{+32}:\\
\;\;\;\;\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.7% Cost 7492
\[\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+32}:\\
\;\;\;\;\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 97.7% Cost 1476
\[\begin{array}{l}
\mathbf{if}\;z \cdot \left(9 \cdot y\right) \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\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}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 77.9% Cost 1361
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;b \leq -1.04 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+57}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+153} \lor \neg \left(b \leq 4.4 \cdot 10^{+216}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\end{array}
\]
Alternative 4 Accuracy 98.3% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-51}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - y \cdot \left(9 \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 5 Accuracy 48.9% Cost 976
\[\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.12 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -5.8 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-175}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 6 Accuracy 48.4% Cost 976
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.8 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.95 \cdot 10^{-127}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-174}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+125}:\\
\;\;\;\;\left(z \cdot \left(y \cdot t\right)\right) \cdot -9\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 7 Accuracy 78.0% Cost 968
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.12 \cdot 10^{-36}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+124}:\\
\;\;\;\;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 76.5% Cost 968
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{-37}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{elif}\;b \leq 2.08 \cdot 10^{+124}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 9 Accuracy 76.0% Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+39}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(y \cdot t\right)\right) \cdot -9\\
\end{array}
\]
Alternative 10 Accuracy 47.4% Cost 585
\[\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{-48} \lor \neg \left(b \leq 3.6 \cdot 10^{+65}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Accuracy 30.9% Cost 192
\[x \cdot 2
\]