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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 3.0 |
Initial program 12.4
rmApplied associate-/l*3.0
Final simplification3.0
herbie shell --seed 2020100 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))