\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\left(\frac{\frac{x}{x + y}}{x + y} \cdot y\right) \cdot \frac{1}{\left(x + y\right) + 1}double f(double x, double y) {
double r301013 = x;
double r301014 = y;
double r301015 = r301013 * r301014;
double r301016 = r301013 + r301014;
double r301017 = r301016 * r301016;
double r301018 = 1.0;
double r301019 = r301016 + r301018;
double r301020 = r301017 * r301019;
double r301021 = r301015 / r301020;
return r301021;
}
double f(double x, double y) {
double r301022 = x;
double r301023 = y;
double r301024 = r301022 + r301023;
double r301025 = r301022 / r301024;
double r301026 = r301025 / r301024;
double r301027 = r301026 * r301023;
double r301028 = 1.0;
double r301029 = 1.0;
double r301030 = r301024 + r301029;
double r301031 = r301028 / r301030;
double r301032 = r301027 * r301031;
return r301032;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 19.3
rmApplied times-frac7.7
rmApplied associate-/r*0.2
rmApplied div-inv0.2
Applied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2019347 +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))))