\[ \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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 2.2 \cdot 10^{-105}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, -9 \cdot \left(z \cdot t\right), t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\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
(let* ((t_1 (* b (* a 27.0))))
(if (<= z 2.2e-105)
(fma x 2.0 (fma y (* -9.0 (* z t)) t_1))
(+ t_1 (- (* x 2.0) (* t (* 9.0 (* z y)))))))) 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 t_1 = b * (a * 27.0);
double tmp;
if (z <= 2.2e-105) {
tmp = fma(x, 2.0, fma(y, (-9.0 * (z * t)), t_1));
} else {
tmp = t_1 + ((x * 2.0) - (t * (9.0 * (z * y))));
}
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)
t_1 = Float64(b * Float64(a * 27.0))
tmp = 0.0
if (z <= 2.2e-105)
tmp = fma(x, 2.0, fma(y, Float64(-9.0 * Float64(z * t)), t_1));
else
tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))));
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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.2e-105], N[(x * 2.0 + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 2.2 \cdot 10^{-105}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, -9 \cdot \left(z \cdot t\right), t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 83.3% Cost 1480
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+83}:\\
\;\;\;\;t_1 + \left(x + x\right)\\
\mathbf{elif}\;t_1 \leq 10^{-38}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot -9\right) \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\]
Alternative 2 Accuracy 98.3% Cost 1476
\[\begin{array}{l}
\mathbf{if}\;z \cdot \left(y \cdot 9\right) \leq 10^{+295}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot -9\right) \cdot \left(z \cdot t\right)\\
\end{array}
\]
Alternative 3 Accuracy 81.3% Cost 1352
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;x \cdot 2 \leq -1 \cdot 10^{-24}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot -9\right) \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot 2 \leq 10^{-43}:\\
\;\;\;\;t_1 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x + x\right)\\
\end{array}
\]
Alternative 4 Accuracy 99.1% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 8 \cdot 10^{-54}:\\
\;\;\;\;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}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\]
Alternative 5 Accuracy 46.9% Cost 1112
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;a \leq -2.25 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.05 \cdot 10^{+100}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{+85}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -5.8 \cdot 10^{+54}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.14 \cdot 10^{+64}:\\
\;\;\;\;x + x\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 6 Accuracy 54.4% Cost 980
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+43}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-102}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-201}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-112}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 7 Accuracy 54.2% Cost 980
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+43}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-104}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-202}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-110}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-29}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 8 Accuracy 71.6% Cost 972
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right) + \left(x + x\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+247}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{+241}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\]
Alternative 9 Accuracy 55.3% Cost 716
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+43}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-104}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-22}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 10 Accuracy 56.2% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{-30}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-31}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 11 Accuracy 41.7% Cost 192
\[x + x
\]