\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}}{\frac{x + y}{\frac{y}{1 + \left(x + y\right)}}}double f(double x, double y) {
double r21763645 = x;
double r21763646 = y;
double r21763647 = r21763645 * r21763646;
double r21763648 = r21763645 + r21763646;
double r21763649 = r21763648 * r21763648;
double r21763650 = 1.0;
double r21763651 = r21763648 + r21763650;
double r21763652 = r21763649 * r21763651;
double r21763653 = r21763647 / r21763652;
return r21763653;
}
double f(double x, double y) {
double r21763654 = x;
double r21763655 = y;
double r21763656 = r21763654 + r21763655;
double r21763657 = r21763654 / r21763656;
double r21763658 = 1.0;
double r21763659 = r21763658 + r21763656;
double r21763660 = r21763655 / r21763659;
double r21763661 = r21763656 / r21763660;
double r21763662 = r21763657 / r21763661;
return r21763662;
}




Bits error versus x




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