\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 -1.0585773649804962 \cdot 10^{295}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;\left(y \cdot 9\right) \cdot z \le 1.6190471234479575 \cdot 10^{41}:\\
\;\;\;\;\left(2 \cdot x - \left(9 \cdot t\right) \cdot \left(z \cdot y\right)\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot x - \left(\left(9 \cdot t\right) \cdot z\right) \cdot y\right) + \left(a \cdot 27\right) \cdot b\\
\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 VAR;
if ((((y * 9.0) * z) <= -1.0585773649804962e+295)) {
VAR = (((x * 2.0) - ((y * 9.0) * (z * t))) + (27.0 * (a * b)));
} else {
double VAR_1;
if ((((y * 9.0) * z) <= 1.6190471234479575e+41)) {
VAR_1 = (((2.0 * x) - ((9.0 * t) * (z * y))) + ((a * 27.0) * b));
} else {
VAR_1 = (((2.0 * x) - (((9.0 * t) * z) * y)) + ((a * 27.0) * b));
}
VAR = VAR_1;
}
return VAR;
}




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.6 |
|---|---|
| Target | 2.6 |
| Herbie | 1.1 |
if (* (* y 9.0) z) < -1.0585773649804962e+295Initial program 55.6
Taylor expanded around 0 55.6
rmApplied associate-*l*1.6
if -1.0585773649804962e+295 < (* (* y 9.0) z) < 1.6190471234479575e+41Initial program 0.5
Taylor expanded around inf 0.5
rmApplied associate-*r*0.6
if 1.6190471234479575e+41 < (* (* y 9.0) z) Initial program 9.6
Taylor expanded around inf 9.4
rmApplied associate-*r*9.4
rmApplied associate-*r*3.7
Final simplification1.1
herbie shell --seed 2020100 +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)))