\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\frac{\frac{1}{x + 1}}{\frac{1}{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}}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) (1.0 / ((double) (x + 1.0)))) / ((double) (1.0 / ((double) (x + ((double) (((double) (y / ((double) (t - ((double) (x / z)))))) - ((double) (x / ((double) (((double) (t * z)) - x))))))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 7.3
rmApplied div-sub7.3
Simplified2.3
Simplified2.3
rmApplied clear-num2.4
Simplified0.4
rmApplied div-inv0.5
Applied associate-/r*0.4
Final simplification0.4
herbie shell --seed 2020184
(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)))