\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{1}{\frac{x + y}{x}} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}double f(double x, double y) {
double r477038 = x;
double r477039 = y;
double r477040 = r477038 * r477039;
double r477041 = r477038 + r477039;
double r477042 = r477041 * r477041;
double r477043 = 1.0;
double r477044 = r477041 + r477043;
double r477045 = r477042 * r477044;
double r477046 = r477040 / r477045;
return r477046;
}
double f(double x, double y) {
double r477047 = 1.0;
double r477048 = x;
double r477049 = y;
double r477050 = r477048 + r477049;
double r477051 = r477050 / r477048;
double r477052 = r477047 / r477051;
double r477053 = 1.0;
double r477054 = r477050 + r477053;
double r477055 = r477049 / r477054;
double r477056 = r477052 * r477055;
double r477057 = r477056 / r477050;
return r477057;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 19.8
rmApplied times-frac7.5
rmApplied associate-/r*0.2
rmApplied associate-*l/0.1
rmApplied clear-num0.1
Final simplification0.1
herbie shell --seed 2019353
(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))))