\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r1169956 = x;
double r1169957 = r1169956 * r1169956;
double r1169958 = y;
double r1169959 = r1169958 * r1169958;
double r1169960 = r1169957 + r1169959;
double r1169961 = sqrt(r1169960);
return r1169961;
}
double f(double x, double y) {
double r1169962 = x;
double r1169963 = y;
double r1169964 = hypot(r1169962, r1169963);
return r1169964;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.5 |
|---|---|
| Target | 17.6 |
| Herbie | 0.0 |
Initial program 31.5
Simplified0.0
Final simplification0.0
herbie shell --seed 2019196 +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))))