\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}x \cdot \frac{\left(y - z\right) + 1}{z}double f(double x, double y, double z) {
double r470641 = x;
double r470642 = y;
double r470643 = z;
double r470644 = r470642 - r470643;
double r470645 = 1.0;
double r470646 = r470644 + r470645;
double r470647 = r470641 * r470646;
double r470648 = r470647 / r470643;
return r470648;
}
double f(double x, double y, double z) {
double r470649 = x;
double r470650 = y;
double r470651 = z;
double r470652 = r470650 - r470651;
double r470653 = 1.0;
double r470654 = r470652 + r470653;
double r470655 = r470654 / r470651;
double r470656 = r470649 * r470655;
return r470656;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.3 |
|---|---|
| Target | 0.5 |
| Herbie | 3.5 |
if z < -1.83651324945672e+16 or 8797080640.399511 < z Initial program 17.5
rmApplied *-un-lft-identity17.5
Applied times-frac0.1
Simplified0.1
if -1.83651324945672e+16 < z < 8797080640.399511Initial program 0.2
rmApplied distribute-lft-in0.2
Final simplification3.5
herbie shell --seed 1978988140
(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))