\sqrt{x + 1} - \sqrt{x}
\frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}
(FPCore (x) :precision binary64 (- (sqrt (+ x 1.0)) (sqrt x)))
(FPCore (x) :precision binary64 (/ 1.0 (+ (sqrt x) (hypot 1.0 (sqrt x)))))
double code(double x) {
return sqrt(x + 1.0) - sqrt(x);
}
double code(double x) {
return 1.0 / (sqrt(x) + hypot(1.0, sqrt(x)));
}




Bits error versus x
Results
| Original | 29.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 29.5
Applied flip--_binary6429.3
Simplified0.2
Simplified0.2
Applied add-sqr-sqrt_binary640.2
Applied hypot-1-def_binary640.2
Final simplification0.2
herbie shell --seed 2022088
(FPCore (x)
:name "Main:bigenough3 from C"
:precision binary64
:herbie-target
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(- (sqrt (+ x 1.0)) (sqrt x)))