\[ \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 -4000000:\\
\;\;\;\;x \cdot 2 + \left(\left(z \cdot t\right) \cdot \left(y \cdot -9\right) - a \cdot \left(b \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot 27, b, x \cdot 2 + z \cdot \left(t \cdot \left(y \cdot -9\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) -4000000.0)
(+ (* x 2.0) (- (* (* z t) (* y -9.0)) (* a (* b -27.0))))
(fma (* a 27.0) b (+ (* x 2.0) (* z (* t (* y -9.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) <= -4000000.0) {
tmp = (x * 2.0) + (((z * t) * (y * -9.0)) - (a * (b * -27.0)));
} else {
tmp = fma((a * 27.0), b, ((x * 2.0) + (z * (t * (y * -9.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) <= -4000000.0)
tmp = Float64(Float64(x * 2.0) + Float64(Float64(Float64(z * t) * Float64(y * -9.0)) - Float64(a * Float64(b * -27.0))));
else
tmp = fma(Float64(a * 27.0), b, Float64(Float64(x * 2.0) + Float64(z * Float64(t * Float64(y * -9.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], -4000000.0], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 27.0), $MachinePrecision] * b + N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(t * N[(y * -9.0), $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}\;y \cdot 9 \leq -4000000:\\
\;\;\;\;x \cdot 2 + \left(\left(z \cdot t\right) \cdot \left(y \cdot -9\right) - a \cdot \left(b \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot 27, b, x \cdot 2 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 1.0 Cost 2120
\[\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
t_2 := t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + t_1\\
\end{array}
\]
Alternative 2 Error 0.8 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-177}:\\
\;\;\;\;x \cdot 2 + \left(\left(z \cdot t\right) \cdot \left(y \cdot -9\right) - a \cdot \left(b \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\]
Alternative 3 Error 29.1 Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+88}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-276}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-212}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-29}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+48}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 4 Error 15.4 Cost 1100
\[\begin{array}{l}
t_1 := x \cdot 2 + \left(t \cdot \left(y \cdot z\right)\right) \cdot -9\\
\mathbf{if}\;z \leq -3.35 \cdot 10^{+78}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-9}:\\
\;\;\;\;x + \left(x - \left(a \cdot b\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 15.3 Cost 1100
\[\begin{array}{l}
t_1 := \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-122}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-195}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-19}:\\
\;\;\;\;x + \left(x - \left(a \cdot b\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot \left(y \cdot z\right)\right) \cdot -9\\
\end{array}
\]
Alternative 6 Error 14.6 Cost 968
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-195}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot \left(z \cdot t\right)\right) \cdot -9\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-21}:\\
\;\;\;\;x + \left(x - \left(a \cdot b\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot \left(y \cdot z\right)\right) \cdot -9\\
\end{array}
\]
Alternative 7 Error 28.6 Cost 844
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+91}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-41}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+48}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 8 Error 15.9 Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+56}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+47}:\\
\;\;\;\;x + \left(x - \left(a \cdot b\right) \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 9 Error 28.1 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+88}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+34}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 10 Error 28.2 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{+88}:\\
\;\;\;\;x + x\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+36}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x + x\\
\end{array}
\]
Alternative 11 Error 37.6 Cost 192
\[x + x
\]