\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\frac{x}{x + y} \cdot \frac{\frac{y}{\left(x + y\right) + 1}}{x + y}(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y) :precision binary64 (* (/ x (+ x y)) (/ (/ y (+ (+ x y) 1.0)) (+ x y))))
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) ((x / ((double) (x + y))) * ((y / ((double) (((double) (x + y)) + 1.0))) / ((double) (x + y)))));
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 19.8
rmApplied distribute-lft-in_binary6419.8
Simplified19.8
Simplified19.8
rmApplied times-frac_binary6410.8
Simplified8.1
rmApplied associate-/r*_binary640.2
rmApplied div-inv_binary640.2
Applied associate-*l*_binary640.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020210
(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))))