\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}\;t \le -3.963364500537577 \cdot 10^{70}:\\
\;\;\;\;x \cdot 2 + \left(27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\mathbf{elif}\;t \le 1.0723699369715044 \cdot 10^{-123}:\\
\;\;\;\;x \cdot 2 + \left(27 \cdot \left(a \cdot b\right) - 9 \cdot \left(\left(t \cdot z\right) \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\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 VAR;
if ((t <= -3.963364500537577e+70)) {
VAR = ((x * 2.0) + ((27.0 * (a * b)) - (9.0 * (t * (z * y)))));
} else {
double VAR_1;
if ((t <= 1.0723699369715044e-123)) {
VAR_1 = ((x * 2.0) + ((27.0 * (a * b)) - (9.0 * ((t * z) * y))));
} else {
VAR_1 = (((x * 2.0) - (((y * 9.0) * z) * t)) + (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.2 |
|---|---|
| Target | 2.3 |
| Herbie | 0.8 |
if t < -3.963364500537577e+70Initial program 0.8
rmApplied sub-neg0.8
Applied associate-+l+0.8
Simplified0.7
Taylor expanded around inf 0.7
if -3.963364500537577e+70 < t < 1.0723699369715044e-123Initial program 5.0
rmApplied sub-neg5.0
Applied associate-+l+5.0
Simplified5.0
Taylor expanded around inf 4.9
rmApplied associate-*r*0.5
if 1.0723699369715044e-123 < t Initial program 1.4
rmApplied associate-*l*1.4
Final simplification0.8
herbie shell --seed 2020092
(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)))