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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.8 |
| Herbie | 1.8 |
Initial program 3.6
rmApplied associate-/r*1.8
rmApplied *-un-lft-identity1.8
Applied times-frac1.8
rmApplied *-un-lft-identity1.8
Applied times-frac1.8
rmApplied *-un-lft-identity1.8
Applied *-un-lft-identity1.8
Applied times-frac1.8
Applied associate-*l*1.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2020058 +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))))