\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\frac{1}{\frac{x + y}{\frac{x}{x + y}}} \cdot \frac{y}{\left(x + y\right) + 1}double f(double x, double y) {
double r400318 = x;
double r400319 = y;
double r400320 = r400318 * r400319;
double r400321 = r400318 + r400319;
double r400322 = r400321 * r400321;
double r400323 = 1.0;
double r400324 = r400321 + r400323;
double r400325 = r400322 * r400324;
double r400326 = r400320 / r400325;
return r400326;
}
double f(double x, double y) {
double r400327 = 1.0;
double r400328 = x;
double r400329 = y;
double r400330 = r400328 + r400329;
double r400331 = r400328 / r400330;
double r400332 = r400330 / r400331;
double r400333 = r400327 / r400332;
double r400334 = 1.0;
double r400335 = r400330 + r400334;
double r400336 = r400329 / r400335;
double r400337 = r400333 * r400336;
return r400337;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.5 |
Initial program 19.7
rmApplied times-frac7.5
rmApplied associate-/r*0.2
rmApplied *-un-lft-identity0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Applied associate-/l*0.5
Final simplification0.5
herbie shell --seed 2020001 +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))))