\frac{x \cdot \left(y - z\right)}{y}
\frac{x}{\frac{y}{y - z}}
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z) :precision binary64 (/ x (/ y (- y z))))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
double code(double x, double y, double z) {
return x / (y / (y - z));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 9.6 |
|---|---|
| Target | 2.6 |
| Herbie | 2.5 |
Initial program 9.6
Applied associate-/l*_binary642.5
Applied *-un-lft-identity_binary642.5
Applied associate-/r*_binary642.5
Final simplification2.5
herbie shell --seed 2022068
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))