\[ \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 2 \cdot 10^{-52}:\\
\;\;\;\;\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 2e-52)
(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 <= 2e-52) {
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 <= 2e-52)
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, 2e-52], 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 2 \cdot 10^{-52}:\\
\;\;\;\;\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.6 Cost 13764
\[\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;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, \mathsf{fma}\left(t, y \cdot \left(z \cdot -9\right), b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\]
Alternative 2 Error 13.0 Cost 1360
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := y \cdot \left(z \cdot t\right)\\
t_3 := t_1 + -9 \cdot t_2\\
\mathbf{if}\;x \leq -9.2 \cdot 10^{-17}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-61}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+28}:\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+58}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t_2\\
\end{array}
\]
Alternative 3 Error 2.0 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{+123}:\\
\;\;\;\;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}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 4 Error 0.6 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 9 \cdot 10^{-56}:\\
\;\;\;\;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 5 Error 28.8 Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-17}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 1.14 \cdot 10^{-122}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-57}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+27}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+62}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 6 Error 28.8 Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-17}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{-176}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-58}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+25}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 7 Error 28.8 Cost 1108
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-17}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-176}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-62}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+27}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+61}:\\
\;\;\;\;\left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 8 Error 14.8 Cost 1100
\[\begin{array}{l}
t_1 := x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-172}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+122}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 9 Error 14.8 Cost 1100
\[\begin{array}{l}
t_1 := x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-172}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 10 Error 28.4 Cost 848
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-17}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 6.9 \cdot 10^{-123}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-57}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+22}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 11 Error 16.0 Cost 840
\[\begin{array}{l}
\mathbf{if}\;z \leq -1600:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\]
Alternative 12 Error 28.1 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+21}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 13 Error 28.1 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 400000000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 14 Error 37.3 Cost 192
\[x \cdot 2
\]