\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} \cdot \frac{1}{\frac{\left(x + y\right) + 1}{y}}}{x + y}double f(double x, double y) {
double r593672 = x;
double r593673 = y;
double r593674 = r593672 * r593673;
double r593675 = r593672 + r593673;
double r593676 = r593675 * r593675;
double r593677 = 1.0;
double r593678 = r593675 + r593677;
double r593679 = r593676 * r593678;
double r593680 = r593674 / r593679;
return r593680;
}
double f(double x, double y) {
double r593681 = x;
double r593682 = y;
double r593683 = r593681 + r593682;
double r593684 = r593681 / r593683;
double r593685 = 1.0;
double r593686 = 1.0;
double r593687 = r593683 + r593686;
double r593688 = r593687 / r593682;
double r593689 = r593685 / r593688;
double r593690 = r593684 * r593689;
double r593691 = r593690 / r593683;
return r593691;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.8
rmApplied times-frac8.0
rmApplied associate-/r*0.2
rmApplied associate-*l/0.1
rmApplied clear-num0.2
Final simplification0.2
herbie shell --seed 2019303 +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))))