\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r433348 = x;
double r433349 = r433348 * r433348;
double r433350 = y;
double r433351 = r433350 * r433350;
double r433352 = r433349 + r433351;
double r433353 = sqrt(r433352);
return r433353;
}
double f(double x, double y) {
double r433354 = x;
double r433355 = y;
double r433356 = hypot(r433354, r433355);
return r433356;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.7 |
|---|---|
| Target | 17.9 |
| Herbie | 0.0 |
Initial program 31.7
Simplified0.0
Final simplification0.0
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y)
:name "Data.Octree.Internal:octantDistance from Octree-0.5.4.2"
:precision binary64
:herbie-target
(if (< x -1.123695082659983e145) (- x) (if (< x 1.11655762118336204e93) (sqrt (+ (* x x) (* y y))) x))
(sqrt (+ (* x x) (* y y))))