\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}\;\left(y \cdot 9\right) \cdot z \le -7.4066034790300907 \cdot 10^{146}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\right)\\
\mathbf{elif}\;\left(y \cdot 9\right) \cdot z \le 581031448.42280841:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}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 temp;
if ((((y * 9.0) * z) <= -7.406603479030091e+146)) {
temp = fma(a, (27.0 * b), ((x * 2.0) - (y * ((9.0 * z) * t))));
} else {
double temp_1;
if ((((y * 9.0) * z) <= 581031448.4228084)) {
temp_1 = (((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b));
} else {
temp_1 = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (z * t)))));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 3.9 |
|---|---|
| Target | 2.8 |
| Herbie | 1.4 |
if (* (* y 9.0) z) < -7.406603479030091e+146Initial program 19.6
Simplified19.5
rmApplied associate-*l*1.5
rmApplied associate-*l*1.4
rmApplied associate-*r*1.8
if -7.406603479030091e+146 < (* (* y 9.0) z) < 581031448.4228084Initial program 0.6
if 581031448.4228084 < (* (* y 9.0) z) Initial program 9.3
Simplified9.2
rmApplied associate-*l*4.5
rmApplied associate-*l*4.3
Final simplification1.4
herbie shell --seed 2020049 +o rules:numerics
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b)))
(+ (- (* x 2) (* (* (* y 9) z) t)) (* (* a 27) b)))