\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{x}{x + y}}{x + y} \cdot \frac{y}{\left(x + y\right) + 1}double f(double x, double y) {
double r1136602 = x;
double r1136603 = y;
double r1136604 = r1136602 * r1136603;
double r1136605 = r1136602 + r1136603;
double r1136606 = r1136605 * r1136605;
double r1136607 = 1.0;
double r1136608 = r1136605 + r1136607;
double r1136609 = r1136606 * r1136608;
double r1136610 = r1136604 / r1136609;
return r1136610;
}
double f(double x, double y) {
double r1136611 = x;
double r1136612 = y;
double r1136613 = r1136611 + r1136612;
double r1136614 = r1136611 / r1136613;
double r1136615 = r1136614 / r1136613;
double r1136616 = 1.0;
double r1136617 = r1136613 + r1136616;
double r1136618 = r1136612 / r1136617;
double r1136619 = r1136615 * r1136618;
return r1136619;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.6
rmApplied times-frac8.0
rmApplied associate-/r*0.2
Final simplification0.2
herbie shell --seed 2020034 +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))))