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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.0 |
| Herbie | 3.3 |
Initial program 12.3
rmApplied *-un-lft-identity12.3
Applied times-frac3.3
Simplified3.3
Final simplification3.3
herbie shell --seed 2020114
(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))