\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{{\left(\left(x + y\right) \cdot \frac{1}{\mathsf{hypot}\left(x, y\right) \cdot \frac{\mathsf{hypot}\left(x, y\right)}{x - y}}\right)}^{3}}double f(double x, double y) {
double r90192 = x;
double r90193 = y;
double r90194 = r90192 - r90193;
double r90195 = r90192 + r90193;
double r90196 = r90194 * r90195;
double r90197 = r90192 * r90192;
double r90198 = r90193 * r90193;
double r90199 = r90197 + r90198;
double r90200 = r90196 / r90199;
return r90200;
}
double f(double x, double y) {
double r90201 = x;
double r90202 = y;
double r90203 = r90201 + r90202;
double r90204 = 1.0;
double r90205 = hypot(r90201, r90202);
double r90206 = r90201 - r90202;
double r90207 = r90205 / r90206;
double r90208 = r90205 * r90207;
double r90209 = r90204 / r90208;
double r90210 = r90203 * r90209;
double r90211 = 3.0;
double r90212 = pow(r90210, r90211);
double r90213 = cbrt(r90212);
return r90213;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 20.0
rmApplied add-cbrt-cube47.1
Applied add-cbrt-cube47.3
Applied add-cbrt-cube47.4
Applied cbrt-unprod47.1
Applied cbrt-undiv47.0
Simplified20.1
rmApplied div-inv20.1
rmApplied *-un-lft-identity20.1
Applied add-sqr-sqrt20.1
Applied times-frac20.1
Simplified20.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2020018 +o rules:numerics
(FPCore (x y)
:name "Kahan p9 Example"
:precision binary64
:pre (and (< 0.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))))