\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r30056052 = x;
double r30056053 = r30056052 * r30056052;
double r30056054 = y;
double r30056055 = r30056054 * r30056054;
double r30056056 = r30056053 + r30056055;
double r30056057 = sqrt(r30056056);
return r30056057;
}
double f(double x, double y) {
double r30056058 = x;
double r30056059 = y;
double r30056060 = hypot(r30056058, r30056059);
return r30056060;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.9 |
|---|---|
| Target | 17.5 |
| Herbie | 0.0 |
Initial program 31.9
Simplified0.0
Final simplification0.0
herbie shell --seed 2019170 +o rules:numerics
(FPCore (x y)
:name "Data.Octree.Internal:octantDistance from Octree-0.5.4.2"
:herbie-target
(if (< x -1.1236950826599826e+145) (- x) (if (< x 1.116557621183362e+93) (sqrt (+ (* x x) (* y y))) x))
(sqrt (+ (* x x) (* y y))))