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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.4 |
|---|---|
| Target | 0.3 |
| Herbie | 2.5 |
Initial program 7.4
rmApplied div-sub7.4
rmApplied *-un-lft-identity7.4
Applied times-frac2.4
Simplified2.4
rmApplied div-inv2.5
Final simplification2.5
herbie shell --seed 2020168
(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.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))