\[ \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}\;z \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\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 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\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 5e-12)
(fma a (* 27.0 b) (+ (* x 2.0) (* y (* -9.0 (* z t)))))
(+ (+ (* x 2.0) (* (* z y) (* t -9.0))) (* a (* 27.0 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 <= 5e-12) {
tmp = fma(a, (27.0 * b), ((x * 2.0) + (y * (-9.0 * (z * t)))));
} else {
tmp = ((x * 2.0) + ((z * y) * (t * -9.0))) + (a * (27.0 * 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 <= 5e-12)
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(Float64(z * y) * Float64(t * -9.0))) + Float64(a * Float64(27.0 * 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, 5e-12], 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[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $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 \cdot 10^{-12}:\\
\;\;\;\;\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 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
Alternatives Alternative 1 Error 29.9 Cost 1376
\[\begin{array}{l}
t_1 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{+82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-138}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.32 \cdot 10^{-199}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-280}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-66}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 2 Error 30.0 Cost 1376
\[\begin{array}{l}
t_1 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+83}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-279}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-66}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 3 Error 30.1 Cost 1376
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.08 \cdot 10^{+84}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.75 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-274}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-101}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 4 Error 30.1 Cost 1376
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -5.1 \cdot 10^{+82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-202}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-278}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-274}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{-100}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 5 Error 1.2 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{+61}:\\
\;\;\;\;x \cdot 2 + \left(27 \cdot \left(a \cdot b\right) + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\
\end{array}
\]
Alternative 6 Error 0.5 Cost 1220
\[\begin{array}{l}
\mathbf{if}\;z \leq 1.25 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2 + \left(27 \cdot \left(a \cdot b\right) + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + \left(z \cdot y\right) \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\]
Alternative 7 Error 17.0 Cost 1104
\[\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-66}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 680000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\]
Alternative 8 Error 14.1 Cost 1101
\[\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -6.8 \cdot 10^{+227}:\\
\;\;\;\;t_1 + -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-7} \lor \neg \left(a \leq 1.05 \cdot 10^{-113}\right):\\
\;\;\;\;x \cdot 2 + t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\]
Alternative 9 Error 13.1 Cost 1100
\[\begin{array}{l}
t_1 := x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-126}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 10 Error 15.0 Cost 969
\[\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{-6} \lor \neg \left(a \leq 4.8 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\
\end{array}
\]
Alternative 11 Error 29.4 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-69}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\]
Alternative 12 Error 37.7 Cost 192
\[x \cdot 2
\]