\[ \begin{array}{c}[y, z, t] = \mathsf{sort}([y, z, t])\\ \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}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+165}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\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
(if (<= (* (* y 9.0) z) 5e+165)
(+ (+ (* x 2.0) (* t (* z (* y -9.0)))) (* (* a 27.0) b))
(fma a (* 27.0 b) (- (* x 2.0) (* y (* 9.0 (* z t))))))) 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) * z) <= 5e+165) {
tmp = ((x * 2.0) + (t * (z * (y * -9.0)))) + ((a * 27.0) * b);
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (z * t)))));
}
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(Float64(y * 9.0) * z) <= 5e+165)
tmp = Float64(Float64(Float64(x * 2.0) + Float64(t * Float64(z * Float64(y * -9.0)))) + Float64(Float64(a * 27.0) * b));
else
tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))));
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[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+165], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $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}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+165}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 1.16% Cost 1476
\[\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+146}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 2 Error 45.42% Cost 1376
\[\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_3 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-21}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-199}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-286}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-210}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 3 Error 45.35% Cost 1376
\[\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_3 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-19}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-197}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-286}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-209}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-125}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 4 Error 45.36% Cost 1376
\[\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_3 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.85 \cdot 10^{-21}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-195}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-265}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-285}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-210}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 5 Error 31.25% Cost 1370
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-216}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-255} \lor \neg \left(x \leq -2.1 \cdot 10^{-285}\right) \land \left(x \leq 1.35 \cdot 10^{-209} \lor \neg \left(x \leq 5.1 \cdot 10^{-126}\right)\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 6 Error 23.44% Cost 1365
\[\begin{array}{l}
t_1 := x \cdot 2 + t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+125}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-219} \lor \neg \left(z \leq 10^{-97}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 7 Error 23.34% Cost 1365
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+124}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-154}:\\
\;\;\;\;x \cdot 2 + t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-219} \lor \neg \left(z \leq 1.7 \cdot 10^{-93}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 8 Error 20.89% Cost 1233
\[\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-49}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-220} \lor \neg \left(z \leq 5 \cdot 10^{-93}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 9 Error 19.32% Cost 1232
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-26}:\\
\;\;\;\;\left(t \cdot -9\right) \cdot \left(y \cdot z\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+180}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + x \cdot 2\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+232}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\]
Alternative 10 Error 2.79% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+133}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + \left(x \cdot 2 + 27 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\]
Alternative 11 Error 0.94% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-8}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right) + \left(x \cdot 2 + 27 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\]
Alternative 12 Error 26.76% Cost 972
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{+14}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-12}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\end{array}
\]
Alternative 13 Error 43.83% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-26}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 14 Error 43.85% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-25}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 15 Error 43.9% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-26}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 16 Error 58.48% Cost 192
\[x \cdot 2
\]