\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 r419044 = x;
double r419045 = y;
double r419046 = r419044 * r419045;
double r419047 = r419044 + r419045;
double r419048 = r419047 * r419047;
double r419049 = 1.0;
double r419050 = r419047 + r419049;
double r419051 = r419048 * r419050;
double r419052 = r419046 / r419051;
return r419052;
}
double f(double x, double y) {
double r419053 = x;
double r419054 = y;
double r419055 = r419053 + r419054;
double r419056 = r419053 / r419055;
double r419057 = r419056 / r419055;
double r419058 = 1.0;
double r419059 = r419055 + r419058;
double r419060 = r419054 / r419059;
double r419061 = r419057 * r419060;
return r419061;
}




Bits error versus x




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