\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r802195 = x;
double r802196 = r802195 * r802195;
double r802197 = y;
double r802198 = r802197 * r802197;
double r802199 = r802196 + r802198;
double r802200 = sqrt(r802199);
return r802200;
}
double f(double x, double y) {
double r802201 = x;
double r802202 = y;
double r802203 = hypot(r802201, r802202);
return r802203;
}




Bits error versus x




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