\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}{y + x}}{\frac{y + x}{\frac{y}{\left(y + x\right) + 1}}}double f(double x, double y) {
double r24987201 = x;
double r24987202 = y;
double r24987203 = r24987201 * r24987202;
double r24987204 = r24987201 + r24987202;
double r24987205 = r24987204 * r24987204;
double r24987206 = 1.0;
double r24987207 = r24987204 + r24987206;
double r24987208 = r24987205 * r24987207;
double r24987209 = r24987203 / r24987208;
return r24987209;
}
double f(double x, double y) {
double r24987210 = x;
double r24987211 = y;
double r24987212 = r24987211 + r24987210;
double r24987213 = r24987210 / r24987212;
double r24987214 = 1.0;
double r24987215 = r24987212 + r24987214;
double r24987216 = r24987211 / r24987215;
double r24987217 = r24987212 / r24987216;
double r24987218 = r24987213 / r24987217;
return r24987218;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.4 |
Initial program 20.2
rmApplied times-frac7.8
rmApplied associate-/r*0.2
rmApplied associate-*l/0.1
rmApplied associate-/l*0.4
Final simplification0.4
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))