\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r778922 = x;
double r778923 = r778922 * r778922;
double r778924 = y;
double r778925 = r778924 * r778924;
double r778926 = r778923 + r778925;
double r778927 = sqrt(r778926);
return r778927;
}
double f(double x, double y) {
double r778928 = x;
double r778929 = y;
double r778930 = hypot(r778928, r778929);
return r778930;
}




Bits error versus x




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