\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.32951410425208251 \cdot 10^{257} \lor \neg \left(\left(y \cdot 9\right) \cdot z \le 1.15727662613318563 \cdot 10^{249}\right):\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, -\left(\left(\sqrt{9} \cdot z\right) \cdot t\right) \cdot \left(y \cdot \sqrt{9}\right)\right) + \left(\left(\sqrt{9} \cdot z\right) \cdot t\right) \cdot \left(\left(-y \cdot \sqrt{9}\right) + y \cdot \sqrt{9}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return ((double) (((double) (((double) (x * 2.0)) - ((double) (((double) (((double) (y * 9.0)) * z)) * t)))) + ((double) (((double) (a * 27.0)) * b))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if (((((double) (((double) (y * 9.0)) * z)) <= -7.329514104252083e+257) || !(((double) (((double) (y * 9.0)) * z)) <= 1.1572766261331856e+249))) {
VAR = ((double) fma(a, ((double) (27.0 * b)), ((double) (((double) fma(x, 2.0, ((double) -(((double) (((double) (((double) (((double) sqrt(9.0)) * z)) * t)) * ((double) (y * ((double) sqrt(9.0)))))))))) + ((double) (((double) (((double) (((double) sqrt(9.0)) * z)) * t)) * ((double) (((double) -(((double) (y * ((double) sqrt(9.0)))))) + ((double) (y * ((double) sqrt(9.0))))))))))));
} else {
VAR = ((double) fma(a, ((double) (27.0 * b)), ((double) (((double) (x * 2.0)) - ((double) (9.0 * ((double) (t * ((double) (z * y))))))))));
}
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.8 |
|---|---|
| Target | 2.6 |
| Herbie | 0.6 |
if (* (* y 9.0) z) < -7.329514104252083e+257 or 1.1572766261331856e+249 < (* (* y 9.0) z) Initial program 41.4
Simplified41.4
rmApplied add-sqr-sqrt41.4
Applied associate-*r*41.4
Applied associate-*l*41.2
Applied associate-*l*1.5
Applied prod-diff1.5
Simplified1.5
if -7.329514104252083e+257 < (* (* y 9.0) z) < 1.1572766261331856e+249Initial program 0.5
Simplified0.5
rmApplied *-commutative0.5
Applied associate-*l*0.5
Applied associate-*l*0.5
Simplified0.5
Final simplification0.6
herbie shell --seed 2020114 +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)))