\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{\left(\frac{x + y}{\mathsf{hypot}\left(y, x\right)} \cdot \frac{x + y}{\mathsf{hypot}\left(y, x\right)}\right) \cdot \left(\left(\frac{x + y}{\mathsf{hypot}\left(y, x\right)} \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right) \cdot \left(\frac{x - y}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right)\right)}double f(double x, double y) {
double r28424509 = x;
double r28424510 = y;
double r28424511 = r28424509 - r28424510;
double r28424512 = r28424509 + r28424510;
double r28424513 = r28424511 * r28424512;
double r28424514 = r28424509 * r28424509;
double r28424515 = r28424510 * r28424510;
double r28424516 = r28424514 + r28424515;
double r28424517 = r28424513 / r28424516;
return r28424517;
}
double f(double x, double y) {
double r28424518 = x;
double r28424519 = y;
double r28424520 = r28424518 + r28424519;
double r28424521 = hypot(r28424519, r28424518);
double r28424522 = r28424520 / r28424521;
double r28424523 = r28424522 * r28424522;
double r28424524 = r28424518 - r28424519;
double r28424525 = hypot(r28424518, r28424519);
double r28424526 = r28424524 / r28424525;
double r28424527 = r28424522 * r28424526;
double r28424528 = r28424526 * r28424526;
double r28424529 = r28424527 * r28424528;
double r28424530 = r28424523 * r28424529;
double r28424531 = cbrt(r28424530);
return r28424531;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 20.5
Simplified20.5
rmApplied clear-num20.5
rmApplied add-sqr-sqrt20.5
Applied times-frac20.5
Applied add-cube-cbrt20.5
Applied times-frac20.5
Simplified20.5
Simplified0.0
rmApplied add-cbrt-cube0.1
Applied add-cbrt-cube32.3
Applied add-cbrt-cube32.3
Applied cbrt-undiv32.3
Applied cbrt-unprod32.3
Simplified0.0
Final simplification0.0
herbie shell --seed 2019121 +o rules:numerics
(FPCore (x y)
:name "Kahan p9 Example"
:pre (and (< 0 x 1) (< y 1))
:herbie-target
(if (< 0.5 (fabs (/ x y)) 2) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1 (/ 2 (+ 1 (* (/ x y) (/ x y))))))
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))