\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r33556760 = x;
double r33556761 = r33556760 * r33556760;
double r33556762 = y;
double r33556763 = r33556762 * r33556762;
double r33556764 = r33556761 + r33556763;
double r33556765 = sqrt(r33556764);
return r33556765;
}
double f(double x, double y) {
double r33556766 = x;
double r33556767 = y;
double r33556768 = hypot(r33556766, r33556767);
return r33556768;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 17.9 |
| Herbie | 0.0 |
Initial program 31.8
Simplified0.0
Final simplification0.0
herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y)
:name "Data.Octree.Internal:octantDistance from Octree-0.5.4.2"
:herbie-target
(if (< x -1.1236950826599826e+145) (- x) (if (< x 1.116557621183362e+93) (sqrt (+ (* x x) (* y y))) x))
(sqrt (+ (* x x) (* y y))))