\[ \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}\;z \leq -5.2 \cdot 10^{-126}:\\
\;\;\;\;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}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(z \cdot y\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 (<= z -5.2e-126)
(+ (* a (* 27.0 b)) (+ (* x 2.0) (* (* z t) (* y -9.0))))
(fma t (* (* z y) -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 (z <= -5.2e-126) {
tmp = (a * (27.0 * b)) + ((x * 2.0) + ((z * t) * (y * -9.0)));
} else {
tmp = fma(t, ((z * y) * -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 (z <= -5.2e-126)
tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) + Float64(Float64(z * t) * Float64(y * -9.0))));
else
tmp = fma(t, Float64(Float64(z * y) * -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[z, -5.2e-126], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(z * y), $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}\;z \leq -5.2 \cdot 10^{-126}:\\
\;\;\;\;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}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(z \cdot y\right) \cdot -9, \mathsf{fma}\left(x, 2, 27 \cdot \left(a \cdot b\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Accuracy 98.9% Cost 7492
\[\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-240}:\\
\;\;\;\;\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 Accuracy 99.0% Cost 7492
\[\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-126}:\\
\;\;\;\;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}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, 27 \cdot \left(a \cdot b\right) + -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 97.9% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+58}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 + t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\right)\\
\end{array}
\]
Alternative 4 Accuracy 98.9% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-208}:\\
\;\;\;\;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}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 + t \cdot \left(\left(z \cdot y\right) \cdot -9\right)\right)\\
\end{array}
\]
Alternative 5 Accuracy 98.8% Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-208}:\\
\;\;\;\;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}:\\
\;\;\;\;\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 6 Accuracy 71.8% Cost 1104
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+283}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{+245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{+214}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 7 Accuracy 82.1% Cost 1097
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{-60} \lor \neg \left(x \leq 39000000000000\right):\\
\;\;\;\;t_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1 + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 8 Accuracy 54.1% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+54}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-60}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-304}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 9 Accuracy 53.6% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+55}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-58}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-305}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 10 Accuracy 53.6% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+48}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.1 \cdot 10^{-58}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-305}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Accuracy 53.6% Cost 980
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+45}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-59}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-306}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 12 Accuracy 76.6% Cost 969
\[\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+85} \lor \neg \left(a \leq 9 \cdot 10^{-180}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\end{array}
\]
Alternative 13 Accuracy 56.8% Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+46}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+18}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 14 Accuracy 41.8% Cost 192
\[x \cdot 2
\]