\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r535487 = x;
double r535488 = r535487 * r535487;
double r535489 = y;
double r535490 = r535489 * r535489;
double r535491 = r535488 + r535490;
double r535492 = sqrt(r535491);
return r535492;
}
double f(double x, double y) {
double r535493 = x;
double r535494 = y;
double r535495 = hypot(r535493, r535494);
return r535495;
}




Bits error versus x




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