\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\frac{\frac{x}{x + y}}{x + y} \cdot \frac{1}{\frac{\left(x + y\right) + 1}{y}}double f(double x, double y) {
double r532699 = x;
double r532700 = y;
double r532701 = r532699 * r532700;
double r532702 = r532699 + r532700;
double r532703 = r532702 * r532702;
double r532704 = 1.0;
double r532705 = r532702 + r532704;
double r532706 = r532703 * r532705;
double r532707 = r532701 / r532706;
return r532707;
}
double f(double x, double y) {
double r532708 = x;
double r532709 = y;
double r532710 = r532708 + r532709;
double r532711 = r532708 / r532710;
double r532712 = r532711 / r532710;
double r532713 = 1.0;
double r532714 = 1.0;
double r532715 = r532710 + r532714;
double r532716 = r532715 / r532709;
double r532717 = r532713 / r532716;
double r532718 = r532712 * r532717;
return r532718;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 20.0
rmApplied times-frac8.1
rmApplied associate-/r*0.2
rmApplied clear-num0.2
Final simplification0.2
herbie shell --seed 2020060 +o rules:numerics
(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))))