double code(double x, double y) {
return ((double) (((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) (((double) (x * ((double) (((double) (y / ((double) (x + y)))) / ((double) (y + ((double) (x + 1.0)))))))) / ((double) (x + y))));
}




Bits error versus x




Bits error versus y
Results
| Original | 19.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 19.4
Simplified11.0
rmApplied *-un-lft-identity11.0
Applied times-frac5.5
Applied associate-*r*4.0
Simplified3.9
rmApplied clear-num4.1
Simplified0.4
rmApplied associate-*l/0.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2020192
(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))))