\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\frac{\frac{\frac{x}{x + y} \cdot y}{\left(x + y\right) + 1}}{x + y}double f(double x, double y) {
double r20567480 = x;
double r20567481 = y;
double r20567482 = r20567480 * r20567481;
double r20567483 = r20567480 + r20567481;
double r20567484 = r20567483 * r20567483;
double r20567485 = 1.0;
double r20567486 = r20567483 + r20567485;
double r20567487 = r20567484 * r20567486;
double r20567488 = r20567482 / r20567487;
return r20567488;
}
double f(double x, double y) {
double r20567489 = x;
double r20567490 = y;
double r20567491 = r20567489 + r20567490;
double r20567492 = r20567489 / r20567491;
double r20567493 = r20567492 * r20567490;
double r20567494 = 1.0;
double r20567495 = r20567491 + r20567494;
double r20567496 = r20567493 / r20567495;
double r20567497 = r20567496 / r20567491;
return r20567497;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 19.5
rmApplied times-frac8.1
rmApplied associate-/r*0.2
rmApplied associate-*l/0.1
rmApplied associate-*r/0.1
Final simplification0.1
herbie shell --seed 2019200
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))