\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r36015693 = x;
double r36015694 = r36015693 * r36015693;
double r36015695 = y;
double r36015696 = r36015695 * r36015695;
double r36015697 = r36015694 + r36015696;
double r36015698 = sqrt(r36015697);
return r36015698;
}
double f(double x, double y) {
double r36015699 = x;
double r36015700 = y;
double r36015701 = hypot(r36015699, r36015700);
return r36015701;
}




Bits error versus x




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