\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 r322934 = x;
double r322935 = y;
double r322936 = r322934 * r322935;
double r322937 = r322934 + r322935;
double r322938 = r322937 * r322937;
double r322939 = 1.0;
double r322940 = r322937 + r322939;
double r322941 = r322938 * r322940;
double r322942 = r322936 / r322941;
return r322942;
}
double f(double x, double y) {
double r322943 = x;
double r322944 = y;
double r322945 = r322943 + r322944;
double r322946 = r322943 / r322945;
double r322947 = r322946 / r322945;
double r322948 = 1.0;
double r322949 = r322945 + r322948;
double r322950 = r322944 / r322949;
double r322951 = r322947 * r322950;
return r322951;
}




Bits error versus x




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