\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{\frac{x}{x + y}}{x + y} \cdot y}{\left(x + y\right) + 1}double f(double x, double y) {
double r1916 = x;
double r1917 = y;
double r1918 = r1916 * r1917;
double r1919 = r1916 + r1917;
double r1920 = r1919 * r1919;
double r1921 = 1.0;
double r1922 = r1919 + r1921;
double r1923 = r1920 * r1922;
double r1924 = r1918 / r1923;
return r1924;
}
double f(double x, double y) {
double r1925 = x;
double r1926 = y;
double r1927 = r1925 + r1926;
double r1928 = r1925 / r1927;
double r1929 = r1928 / r1927;
double r1930 = r1929 * r1926;
double r1931 = 1.0;
double r1932 = r1927 + r1931;
double r1933 = r1930 / r1932;
return r1933;
}




Bits error versus x




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