\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\left(x - \frac{\frac{y}{3}}{z}\right) + \frac{\frac{t}{3 \cdot z}}{y}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
return ((double) (((double) (x - ((double) (((double) (y / 3.0)) / z)))) + ((double) (((double) (t / ((double) (3.0 * z)))) / y))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.8 |
|---|---|
| Target | 1.7 |
| Herbie | 1.7 |
Initial program 3.8
rmApplied associate-*l*3.7
Applied associate-/r*1.7
rmApplied *-commutative1.7
Applied associate-/r*1.7
rmApplied associate-/r*1.7
Simplified1.7
Final simplification1.7
herbie shell --seed 2020113 +o rules:numerics
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))
(+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))