\[ \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 1500000000000:\\
\;\;\;\;\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}
\]
(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 1500000000000.0)
(fma a (* 27.0 b) (- (* x 2.0) (* y (* 9.0 (* z t)))))
(+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.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 (z <= 1500000000000.0) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.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 (z <= 1500000000000.0)
tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t)))));
else
tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.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[z, 1500000000000.0], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $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 1500000000000:\\
\;\;\;\;\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}
Alternatives Alternative 1 Error 21.5 Cost 1633
\[\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := t_1 + x \cdot 2\\
\mathbf{if}\;x \leq -1.26 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-10}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-270}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{-290}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-237}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-143} \lor \neg \left(x \leq 4.5 \cdot 10^{-117}\right) \land x \leq 5.6 \cdot 10^{-43}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 2 Error 21.5 Cost 1633
\[\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := t_1 + x \cdot 2\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+16}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-10}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-272}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + x \cdot 2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-286}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-234}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-141} \lor \neg \left(x \leq 2.6 \cdot 10^{-117}\right) \land x \leq 5.6 \cdot 10^{-43}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 3 Error 30.3 Cost 1504
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+27}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-286}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-235}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 4 Error 30.4 Cost 1504
\[\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.85 \cdot 10^{+19}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -1.02 \cdot 10^{-44}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-208}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-286}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.48 \cdot 10^{-238}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 5 Error 30.4 Cost 1504
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -8.4 \cdot 10^{-45}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.65 \cdot 10^{-287}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right)\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-237}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 6 Error 13.2 Cost 1492
\[\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := x \cdot 2 + t_1\\
t_3 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+17}:\\
\;\;\;\;t_3 + x \cdot 2\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-20}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + t_1\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-32}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-240}:\\
\;\;\;\;t_3 + z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+73}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 7 Error 10.0 Cost 1481
\[\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+14} \lor \neg \left(t_1 \leq 4 \cdot 10^{-9}\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 8 Error 1.6 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 2.85 \cdot 10^{+94}:\\
\;\;\;\;\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}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\\
\end{array}
\]
Alternative 9 Error 0.7 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{-145}:\\
\;\;\;\;\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 10 Error 12.6 Cost 1096
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+76}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 11 Error 28.4 Cost 585
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+46} \lor \neg \left(x \leq 5.2 \cdot 10^{+75}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\]
Alternative 12 Error 28.3 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+46}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 10^{+74}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 13 Error 37.4 Cost 192
\[x \cdot 2
\]