\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r743868 = x;
double r743869 = r743868 * r743868;
double r743870 = y;
double r743871 = r743870 * r743870;
double r743872 = r743869 + r743871;
double r743873 = sqrt(r743872);
return r743873;
}
double f(double x, double y) {
double r743874 = x;
double r743875 = y;
double r743876 = hypot(r743874, r743875);
return r743876;
}




Bits error versus x




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