\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r733478 = x;
double r733479 = r733478 * r733478;
double r733480 = y;
double r733481 = r733480 * r733480;
double r733482 = r733479 + r733481;
double r733483 = sqrt(r733482);
return r733483;
}
double f(double x, double y) {
double r733484 = x;
double r733485 = y;
double r733486 = hypot(r733484, r733485);
return r733486;
}




Bits error versus x




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