\[ \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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, t \cdot \left(z \cdot -9\right), t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + t_1\\
\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 1.2e-58)
(fma x 2.0 (fma y (* t (* z -9.0)) t_1))
(+ (+ (* x 2.0) (* t (* z (* y -9.0)))) t_1)))) 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 <= 1.2e-58) {
tmp = fma(x, 2.0, fma(y, (t * (z * -9.0)), t_1));
} else {
tmp = ((x * 2.0) + (t * (z * (y * -9.0)))) + t_1;
}
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 <= 1.2e-58)
tmp = fma(x, 2.0, fma(y, Float64(t * Float64(z * -9.0)), t_1));
else
tmp = Float64(Float64(Float64(x * 2.0) + Float64(t * Float64(z * Float64(y * -9.0)))) + t_1);
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, 1.2e-58], N[(x * 2.0 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $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 1.2 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, t \cdot \left(z \cdot -9\right), t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\right) + t_1\\
\end{array}
Alternatives Alternative 1 Error 0.72% Cost 7492
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 + y \cdot \left(-9 \cdot \left(z \cdot t\right)\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 2 Error 30.82% Cost 1369
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -8 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-66}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-178}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.95 \cdot 10^{-249}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-276} \lor \neg \left(a \leq 1.7 \cdot 10^{-259}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 3 Error 21.19% Cost 1352
\[\begin{array}{l}
t_1 := y \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot 2 \leq -8.9 \cdot 10^{-26}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right) + x \cdot 2\\
\mathbf{elif}\;x \cdot 2 \leq 5 \cdot 10^{-99}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + -9 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t_1\\
\end{array}
\]
Alternative 4 Error 2.83% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{-9}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right) + x \cdot 2\\
\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 5 Error 1.44% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{+73}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\right) + a \cdot \left(27 \cdot b\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 6 Error 0.82% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{-45}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\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 7 Error 44% Cost 1108
\[\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-193}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-232}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-95}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 8 Error 44.09% Cost 1108
\[\begin{array}{l}
t_1 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-192}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-232}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-97}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 9 Error 44.14% Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-189}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-232}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-99}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-28}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 10 Error 44.09% Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-196}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-232}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-98}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-28}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Error 19.37% Cost 969
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-23} \lor \neg \left(z \leq 3 \cdot 10^{-24}\right):\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\]
Alternative 12 Error 24.94% Cost 969
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+19} \lor \neg \left(a \leq 6 \cdot 10^{-257}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 13 Error 44.02% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-96}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 14 Error 44.07% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.45 \cdot 10^{-26}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-96}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 15 Error 58.47% Cost 192
\[x \cdot 2
\]