\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 r493858 = x;
double r493859 = y;
double r493860 = r493858 * r493859;
double r493861 = r493858 + r493859;
double r493862 = r493861 * r493861;
double r493863 = 1.0;
double r493864 = r493861 + r493863;
double r493865 = r493862 * r493864;
double r493866 = r493860 / r493865;
return r493866;
}
double f(double x, double y) {
double r493867 = x;
double r493868 = y;
double r493869 = r493867 + r493868;
double r493870 = r493867 / r493869;
double r493871 = r493870 / r493869;
double r493872 = 1.0;
double r493873 = r493869 + r493872;
double r493874 = r493873 / r493868;
double r493875 = r493871 / r493874;
return r493875;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.4
rmApplied times-frac7.6
rmApplied associate-/r*0.2
rmApplied associate-*r/0.2
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2020043
(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))))