\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) + 1}}{y + x}\right)\right)double f(double x, double y) {
double r518325 = x;
double r518326 = y;
double r518327 = r518325 * r518326;
double r518328 = r518325 + r518326;
double r518329 = r518328 * r518328;
double r518330 = 1.0;
double r518331 = r518328 + r518330;
double r518332 = r518329 * r518331;
double r518333 = r518327 / r518332;
return r518333;
}
double f(double x, double y) {
double r518334 = x;
double r518335 = y;
double r518336 = r518334 + r518335;
double r518337 = r518334 / r518336;
double r518338 = 1.0;
double r518339 = r518336 + r518338;
double r518340 = r518335 / r518339;
double r518341 = r518337 * r518340;
double r518342 = r518335 + r518334;
double r518343 = r518341 / r518342;
double r518344 = log1p(r518343);
double r518345 = expm1(r518344);
return r518345;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 20.0
rmApplied times-frac8.2
rmApplied *-un-lft-identity8.2
Applied times-frac0.2
Applied associate-*l*0.2
rmApplied expm1-log1p-u0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020046 +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))))