\[ \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 -1 \cdot 10^{+217}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 + y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, \mathsf{fma}\left(x, 2, 27 \cdot \left(a \cdot b\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) -1e+217)
(fma a (* 27.0 b) (+ (* x 2.0) (* y (* (* z t) -9.0))))
(fma t (* (* y z) -9.0) (fma x 2.0 (* 27.0 (* a b)))))) 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) <= -1e+217) {
tmp = fma(a, (27.0 * b), ((x * 2.0) + (y * ((z * t) * -9.0))));
} else {
tmp = fma(t, ((y * z) * -9.0), fma(x, 2.0, (27.0 * (a * b))));
}
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) <= -1e+217)
tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) + Float64(y * Float64(Float64(z * t) * -9.0))));
else
tmp = fma(t, Float64(Float64(y * z) * -9.0), fma(x, 2.0, Float64(27.0 * Float64(a * b))));
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], -1e+217], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] + N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision] + N[(x * 2.0 + N[(27.0 * N[(a * b), $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 -1 \cdot 10^{+217}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 + y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, \mathsf{fma}\left(x, 2, 27 \cdot \left(a \cdot b\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 10.2 Cost 1481
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-13} \lor \neg \left(t_1 \leq 5 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 2 Error 1.2 Cost 1348
\[\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -2 \cdot 10^{+201}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\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 1.6 Cost 1220
\[\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 4.8 \cdot 10^{+84}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 4 Error 28.9 Cost 1112
\[\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -520000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.46 \cdot 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-270}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-168}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 5 Error 28.7 Cost 1112
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -350000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.82 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-162}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-220}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-167}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 6 Error 28.6 Cost 1112
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -560000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-162}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-220}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-168}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 7 Error 19.1 Cost 1105
\[\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{if}\;x \leq -1.82 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-161}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-186} \lor \neg \left(x \leq 5.5 \cdot 10^{-168}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\]
Alternative 8 Error 19.2 Cost 1104
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right) + x \cdot 2\\
\mathbf{if}\;x \leq -1.82 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-162}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-168}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\end{array}
\]
Alternative 9 Error 28.1 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -600000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4.05 \cdot 10^{+14}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 10 Error 37.4 Cost 192
\[x \cdot 2
\]