\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 r354841 = x;
double r354842 = y;
double r354843 = r354841 * r354842;
double r354844 = r354841 + r354842;
double r354845 = r354844 * r354844;
double r354846 = 1.0;
double r354847 = r354844 + r354846;
double r354848 = r354845 * r354847;
double r354849 = r354843 / r354848;
return r354849;
}
double f(double x, double y) {
double r354850 = 1.0;
double r354851 = x;
double r354852 = y;
double r354853 = r354851 + r354852;
double r354854 = r354853 / r354851;
double r354855 = r354850 / r354854;
double r354856 = 1.0;
double r354857 = r354853 + r354856;
double r354858 = r354852 / r354857;
double r354859 = r354855 * r354858;
double r354860 = r354859 / r354853;
return r354860;
}




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