\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\frac{x}{z} \cdot \left(\left(y - z\right) + 1\right)double f(double x, double y, double z) {
double r440438 = x;
double r440439 = y;
double r440440 = z;
double r440441 = r440439 - r440440;
double r440442 = 1.0;
double r440443 = r440441 + r440442;
double r440444 = r440438 * r440443;
double r440445 = r440444 / r440440;
return r440445;
}
double f(double x, double y, double z) {
double r440446 = x;
double r440447 = z;
double r440448 = r440446 / r440447;
double r440449 = y;
double r440450 = r440449 - r440447;
double r440451 = 1.0;
double r440452 = r440450 + r440451;
double r440453 = r440448 * r440452;
return r440453;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.3 |
|---|---|
| Target | 0.4 |
| Herbie | 9.0 |
if x < -7.269742081445241e+26Initial program 29.9
rmApplied associate-/l*0.1
rmApplied clear-num0.2
rmApplied div-inv0.3
Applied add-sqr-sqrt0.3
Applied times-frac0.3
Simplified0.3
Simplified0.1
if -7.269742081445241e+26 < x < 6.18740927030149e-72Initial program 0.3
Taylor expanded around 0 0.1
if 6.18740927030149e-72 < x Initial program 19.0
rmApplied associate-/l*0.4
rmApplied associate-/r/0.8
Final simplification9.0
herbie shell --seed 2019303
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< x -2.7148310671343599e-162) (- (* (+ 1 y) (/ x z)) x) (if (< x 3.87410881643954616e-197) (* (* x (+ (- y z) 1)) (/ 1 z)) (- (* (+ 1 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1)) z))