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




Bits error versus x
Results
| Original | 19.4 |
|---|---|
| Target | 0.6 |
| Herbie | 0.2 |
Initial program 19.4
rmApplied frac-sub_binary6419.4
Simplified19.4
Simplified19.4
rmApplied flip--_binary6419.2
Simplified0.4
rmApplied *-un-lft-identity_binary640.4
Applied add-sqr-sqrt_binary640.4
Applied times-frac_binary640.4
Applied times-frac_binary640.4
Simplified0.4
Simplified0.3
rmApplied pow1/2_binary640.3
Applied pow-flip_binary640.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020210
(FPCore (x)
:name "2isqrt (example 3.6)"
:precision binary64
:herbie-target
(/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))
(- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))