\sqrt{x + 1} - \sqrt{x}
\sqrt{{\left(\sqrt{1 + x} + \sqrt{x}\right)}^{-2}}
(FPCore (x) :precision binary64 (- (sqrt (+ x 1.0)) (sqrt x)))
(FPCore (x) :precision binary64 (sqrt (pow (+ (sqrt (+ 1.0 x)) (sqrt x)) -2.0)))
double code(double x) {
return sqrt(x + 1.0) - sqrt(x);
}
double code(double x) {
return sqrt(pow((sqrt(1.0 + x) + sqrt(x)), -2.0));
}




Bits error versus x
Results
| Original | 30.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 30.5
rmApplied flip--_binary6430.3
Simplified0.2
Simplified0.2
rmApplied add-sqr-sqrt_binary640.3
Applied sqrt-unprod_binary640.2
Simplified0.2
rmApplied *-un-lft-identity_binary640.2
Final simplification0.2
herbie shell --seed 2021211
(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)))