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




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program Error: 19.7 bits
SimplifiedError: 11.3 bits
rmApplied *-un-lft-identityError: 11.3 bits
Applied times-fracError: 5.8 bits
Applied associate-*r*Error: 4.0 bits
SimplifiedError: 3.9 bits
rmApplied *-un-lft-identityError: 3.9 bits
Applied times-fracError: 0.2 bits
SimplifiedError: 0.2 bits
SimplifiedError: 0.2 bits
Final simplificationError: 0.2 bits
herbie shell --seed 2020204
(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))))