\[ \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 -7.5 \cdot 10^{-216}:\\
\;\;\;\;\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(z \cdot \left(9 \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 -7.5e-216)
(fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t)))))
(+ (- (* x 2.0) (* t (* z (* 9.0 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 <= -7.5e-216) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (z * (9.0 * 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 <= -7.5e-216)
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(z * Float64(9.0 * 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, -7.5e-216], 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[(z * N[(9.0 * 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 -7.5 \cdot 10^{-216}:\\
\;\;\;\;\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(z \cdot \left(9 \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 70.1% Cost 1476
\[\begin{array}{l}
t_1 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq 10^{+269}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 2 Accuracy 72.6% Cost 1476
\[\begin{array}{l}
t_1 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+184}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(9 \cdot y\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 59.6% Cost 1352
\[\begin{array}{l}
t_1 := 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{elif}\;x \cdot 2 \leq 10^{-73}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 4 Accuracy 59.5% Cost 1352
\[\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{-80}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \cdot 2 \leq 10^{-73}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - y \cdot \left(z \cdot \left(9 \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 5 Accuracy 52.4% Cost 1105
\[\begin{array}{l}
t_1 := x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-27}:\\
\;\;\;\;\left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+21} \lor \neg \left(z \leq 2.9 \cdot 10^{+105}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 6 Accuracy 57.5% Cost 969
\[\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{-159} \lor \neg \left(b \leq 3 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 7 Accuracy 40.5% Cost 716
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.9 \cdot 10^{+103}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{+56}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-100}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 8 Accuracy 40.5% Cost 716
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+104}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+55}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-100}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 9 Accuracy 41.0% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-80}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-100}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 10 Accuracy 41.0% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-87}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-100}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 11 Accuracy 31.2% Cost 192
\[x + x
\]