\frac{x}{x} - \frac{1}{x} \cdot \sqrt{x \cdot x}1 - \frac{\left|x\right|}{x}(FPCore (x) :precision binary64 (- (/ x x) (* (/ 1.0 x) (sqrt (* x x)))))
(FPCore (x) :precision binary64 (- 1.0 (/ (fabs x) x)))
double code(double x) {
return ((double) ((x / x) - ((double) ((1.0 / x) * ((double) sqrt(((double) (x * x))))))));
}
double code(double x) {
return ((double) (1.0 - (((double) fabs(x)) / x)));
}




Bits error versus x
Results
| Original | 32.6 |
|---|---|
| Target | 0 |
| Herbie | 0 |
Initial program 32.6
Simplified0
Final simplification0
herbie shell --seed 2020219
(FPCore (x)
:name "sqrt sqr"
:precision binary64
:herbie-target
(if (< x 0.0) 2.0 0.0)
(- (/ x x) (* (/ 1.0 x) (sqrt (* x x)))))