\sqrt{x \cdot x + y}\sqrt{x \cdot x + y}(FPCore (x y) :precision binary64 (sqrt (+ (* x x) y)))
(FPCore (x y) :precision binary64 (sqrt (+ (* x x) y)))
double code(double x, double y) {
return sqrt((x * x) + y);
}
double code(double x, double y) {
return sqrt((x * x) + y);
}




Bits error versus x




Bits error versus y
Results
| Original | 20.9 |
|---|---|
| Target | 0.5 |
| Herbie | 20.9 |
Initial program 20.9
Final simplification20.9
herbie shell --seed 2020268
(FPCore (x y)
:name "Linear.Quaternion:$clog from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< x -1.5097698010472593e+153) (- (+ (* 0.5 (/ y x)) x)) (if (< x 5.582399551122541e+57) (sqrt (+ (* x x) y)) (+ (* 0.5 (/ y x)) x)))
(sqrt (+ (* x x) y)))