\sqrt{x \cdot x + y \cdot y}\mathsf{hypot}\left(x, y\right)double f(double x, double y) {
double r958142 = x;
double r958143 = r958142 * r958142;
double r958144 = y;
double r958145 = r958144 * r958144;
double r958146 = r958143 + r958145;
double r958147 = sqrt(r958146);
return r958147;
}
double f(double x, double y) {
double r958148 = x;
double r958149 = y;
double r958150 = hypot(r958148, r958149);
return r958150;
}




Bits error versus x




Bits error versus y
Results
| Original | 32.1 |
|---|---|
| Target | 18.1 |
| Herbie | 0.0 |
Initial program 32.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019305 +o rules:numerics
(FPCore (x y)
:name "Data.Octree.Internal:octantDistance from Octree-0.5.4.2"
:precision binary64
:herbie-target
(if (< x -1.123695082659983e145) (- x) (if (< x 1.11655762118336204e93) (sqrt (+ (* x x) (* y y))) x))
(sqrt (+ (* x x) (* y y))))