\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{1}{\frac{x + y}{x}} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}double f(double x, double y) {
double r402868 = x;
double r402869 = y;
double r402870 = r402868 * r402869;
double r402871 = r402868 + r402869;
double r402872 = r402871 * r402871;
double r402873 = 1.0;
double r402874 = r402871 + r402873;
double r402875 = r402872 * r402874;
double r402876 = r402870 / r402875;
return r402876;
}
double f(double x, double y) {
double r402877 = 1.0;
double r402878 = x;
double r402879 = y;
double r402880 = r402878 + r402879;
double r402881 = r402880 / r402878;
double r402882 = r402877 / r402881;
double r402883 = 1.0;
double r402884 = r402880 + r402883;
double r402885 = r402879 / r402884;
double r402886 = r402882 * r402885;
double r402887 = r402886 / r402880;
return r402887;
}




Bits error versus x




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