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




Bits error versus x
Results
| Original | 30.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program Error: 30.5 bits
rmApplied flip--Error: 30.2 bits
SimplifiedError: 0.2 bits
Final simplificationError: 0.2 bits
herbie shell --seed 2020204
(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)))