\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 r20212808 = x;
double r20212809 = y;
double r20212810 = r20212808 * r20212809;
double r20212811 = r20212808 + r20212809;
double r20212812 = r20212811 * r20212811;
double r20212813 = 1.0;
double r20212814 = r20212811 + r20212813;
double r20212815 = r20212812 * r20212814;
double r20212816 = r20212810 / r20212815;
return r20212816;
}
double f(double x, double y) {
double r20212817 = y;
double r20212818 = x;
double r20212819 = r20212817 + r20212818;
double r20212820 = 1.0;
double r20212821 = r20212819 + r20212820;
double r20212822 = r20212817 / r20212821;
double r20212823 = r20212818 / r20212819;
double r20212824 = log1p(r20212823);
double r20212825 = expm1(r20212824);
double r20212826 = r20212822 * r20212825;
double r20212827 = r20212826 / r20212819;
return r20212827;
}




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