\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} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}double f(double x, double y) {
double r303284 = x;
double r303285 = y;
double r303286 = r303284 * r303285;
double r303287 = r303284 + r303285;
double r303288 = r303287 * r303287;
double r303289 = 1.0;
double r303290 = r303287 + r303289;
double r303291 = r303288 * r303290;
double r303292 = r303286 / r303291;
return r303292;
}
double f(double x, double y) {
double r303293 = x;
double r303294 = y;
double r303295 = r303293 + r303294;
double r303296 = r303293 / r303295;
double r303297 = 1.0;
double r303298 = r303295 + r303297;
double r303299 = r303294 / r303298;
double r303300 = r303296 * r303299;
double r303301 = r303300 / r303295;
return r303301;
}




Bits error versus x




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