\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}{y + x}}{y + x} \cdot \frac{1}{\frac{\left(y + x\right) + 1}{y}}double f(double x, double y) {
double r20314709 = x;
double r20314710 = y;
double r20314711 = r20314709 * r20314710;
double r20314712 = r20314709 + r20314710;
double r20314713 = r20314712 * r20314712;
double r20314714 = 1.0;
double r20314715 = r20314712 + r20314714;
double r20314716 = r20314713 * r20314715;
double r20314717 = r20314711 / r20314716;
return r20314717;
}
double f(double x, double y) {
double r20314718 = x;
double r20314719 = y;
double r20314720 = r20314719 + r20314718;
double r20314721 = r20314718 / r20314720;
double r20314722 = r20314721 / r20314720;
double r20314723 = 1.0;
double r20314724 = 1.0;
double r20314725 = r20314720 + r20314724;
double r20314726 = r20314725 / r20314719;
double r20314727 = r20314723 / r20314726;
double r20314728 = r20314722 * r20314727;
return r20314728;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.5
rmApplied times-frac8.0
rmApplied associate-/r*0.2
rmApplied clear-num0.2
Final simplification0.2
herbie shell --seed 2019170 +o rules:numerics
(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))))