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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 0.2 |
| Herbie | 2.0 |
Initial program 7.0
rmApplied div-sub7.0
Applied associate-+r-7.0
Applied div-sub7.0
Simplified4.5
rmApplied clear-num4.6
rmApplied fma-udef4.6
Simplified2.0
Final simplification2.0
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1)))