\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1.0\right)}\frac{\frac{y}{\left(y + x\right) + 1.0} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y + x}\right)\right)}{y + x}double f(double x, double y) {
double r21936874 = x;
double r21936875 = y;
double r21936876 = r21936874 * r21936875;
double r21936877 = r21936874 + r21936875;
double r21936878 = r21936877 * r21936877;
double r21936879 = 1.0;
double r21936880 = r21936877 + r21936879;
double r21936881 = r21936878 * r21936880;
double r21936882 = r21936876 / r21936881;
return r21936882;
}
double f(double x, double y) {
double r21936883 = y;
double r21936884 = x;
double r21936885 = r21936883 + r21936884;
double r21936886 = 1.0;
double r21936887 = r21936885 + r21936886;
double r21936888 = r21936883 / r21936887;
double r21936889 = r21936884 / r21936885;
double r21936890 = log1p(r21936889);
double r21936891 = expm1(r21936890);
double r21936892 = r21936888 * r21936891;
double r21936893 = r21936892 / r21936885;
return r21936893;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 19.3
rmApplied times-frac7.6
rmApplied associate-/r*0.2
rmApplied associate-*l/0.1
rmApplied expm1-log1p-u0.1
Final simplification0.1
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:herbie-target
(/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))