\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}}{x + y}}{\frac{\left(x + y\right) + 1}{y}}double f(double x, double y) {
double r245687 = x;
double r245688 = y;
double r245689 = r245687 * r245688;
double r245690 = r245687 + r245688;
double r245691 = r245690 * r245690;
double r245692 = 1.0;
double r245693 = r245690 + r245692;
double r245694 = r245691 * r245693;
double r245695 = r245689 / r245694;
return r245695;
}
double f(double x, double y) {
double r245696 = x;
double r245697 = y;
double r245698 = r245696 + r245697;
double r245699 = r245696 / r245698;
double r245700 = r245699 / r245698;
double r245701 = 1.0;
double r245702 = r245698 + r245701;
double r245703 = r245702 / r245697;
double r245704 = r245700 / r245703;
return r245704;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.8
rmApplied times-frac8.0
rmApplied associate-/r*0.2
rmApplied associate-*r/0.2
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019306 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1))))