\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\frac{1}{x + y} \cdot \left(\frac{x}{x + y} \cdot \left(y \cdot \frac{1}{\left(x + y\right) + 1}\right)\right)double code(double x, double y) {
return (((double) (x * y)) / ((double) (((double) (((double) (x + y)) * ((double) (x + y)))) * ((double) (((double) (x + y)) + 1.0)))));
}
double code(double x, double y) {
return ((double) ((1.0 / ((double) (x + y))) * ((double) ((x / ((double) (x + y))) * ((double) (y * (1.0 / ((double) (((double) (x + y)) + 1.0)))))))));
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.8
rmApplied times-frac7.7
rmApplied *-un-lft-identity7.7
Applied times-frac0.2
Applied associate-*l*0.2
rmApplied div-inv0.2
Final simplification0.2
herbie shell --seed 2020182
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))