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




Bits error versus x
Results
| Original | 29.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 29.4
rmApplied flip--_binary64_140029.2
Simplified0.2
rmApplied add-sqr-sqrt_binary64_14460.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020299
(FPCore (x)
:name "2sqrt (example 3.1)"
:precision binary64
:herbie-target
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(- (sqrt (+ x 1.0)) (sqrt x)))