\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 \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{\left(x + y\right) + 1}\right)\right)double f(double x, double y) {
double r541919 = x;
double r541920 = y;
double r541921 = r541919 * r541920;
double r541922 = r541919 + r541920;
double r541923 = r541922 * r541922;
double r541924 = 1.0;
double r541925 = r541922 + r541924;
double r541926 = r541923 * r541925;
double r541927 = r541921 / r541926;
return r541927;
}
double f(double x, double y) {
double r541928 = x;
double r541929 = y;
double r541930 = r541928 + r541929;
double r541931 = r541928 / r541930;
double r541932 = r541931 / r541930;
double r541933 = 1.0;
double r541934 = r541930 + r541933;
double r541935 = r541929 / r541934;
double r541936 = log1p(r541935);
double r541937 = expm1(r541936);
double r541938 = r541932 * r541937;
return r541938;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 19.7
rmApplied times-frac8.2
rmApplied associate-/r*0.2
rmApplied expm1-log1p-u0.2
Final simplification0.2
herbie shell --seed 2019362 +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))))