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




Bits error versus x
Results
| Original | 30.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 30.0
rmApplied flip--_binary64_1232929.8
Simplified0.2
Simplified0.2
rmApplied add-sqr-sqrt_binary64_123760.3
rmApplied inv-pow_binary64_124390.3
Applied sqrt-pow1_binary64_123720.3
Applied inv-pow_binary64_124390.3
Applied sqrt-pow1_binary64_123720.3
Applied pow-prod-down_binary64_124250.2
Final simplification0.2
herbie shell --seed 2021044
(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)))