\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r606969 = x;
double r606970 = r606969 * r606969;
double r606971 = y;
double r606972 = r606971 * r606971;
double r606973 = r606970 + r606972;
double r606974 = sqrt(r606973);
return r606974;
}
double f(double x, double y) {
double r606975 = x;
double r606976 = y;
double r606977 = hypot(r606975, r606976);
return r606977;
}




Bits error versus x




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