\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\frac{x - \frac{x}{t \cdot z - x}}{x + 1} + \frac{1}{t - \frac{x}{z}} \cdot \frac{y}{x + 1}(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t) :precision binary64 (+ (/ (- x (/ x (- (* t z) x))) (+ x 1.0)) (* (/ 1.0 (- t (/ x z))) (/ y (+ x 1.0)))))
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 ((x - (x / ((t * z) - x))) / (x + 1.0)) + ((1.0 / (t - (x / z))) * (y / (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.4 |
| Herbie | 0.1 |
Initial program 7.4
Taylor expanded around 0 7.4
Simplified7.4
rmApplied times-frac_binary64_167932.0
Simplified2.0
rmApplied clear-num_binary64_167862.0
Taylor expanded around 0 0.1
Final simplification0.1
herbie shell --seed 2021040
(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)))