\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 r491088 = x;
double r491089 = y;
double r491090 = r491088 * r491089;
double r491091 = r491088 + r491089;
double r491092 = r491091 * r491091;
double r491093 = 1.0;
double r491094 = r491091 + r491093;
double r491095 = r491092 * r491094;
double r491096 = r491090 / r491095;
return r491096;
}
double f(double x, double y) {
double r491097 = x;
double r491098 = y;
double r491099 = r491097 + r491098;
double r491100 = r491097 / r491099;
double r491101 = r491100 / r491099;
double r491102 = 1.0;
double r491103 = 1.0;
double r491104 = r491099 + r491103;
double r491105 = r491104 / r491098;
double r491106 = r491102 / r491105;
double r491107 = r491101 * r491106;
return r491107;
}




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))))