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




Bits error versus x




Bits error versus y
Results
| Original | 18.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 18.9
rmApplied times-frac7.5
rmApplied *-un-lft-identity7.5
Applied times-frac0.2
Final simplification0.2
herbie shell --seed 2020106
(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))))