\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{x}}}{1 + x} \cdot \frac{\frac{\sqrt[3]{1}}{\sqrt{x}}}{\frac{1}{\sqrt{x}} + \frac{1}{\sqrt{1 + x}}}(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
(FPCore (x) :precision binary64 (* (/ (/ (* (cbrt 1.0) (cbrt 1.0)) (sqrt x)) (+ 1.0 x)) (/ (/ (cbrt 1.0) (sqrt x)) (+ (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ 1.0 x)))))))
double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt(x + 1.0));
}
double code(double x) {
return (((cbrt(1.0) * cbrt(1.0)) / sqrt(x)) / (1.0 + x)) * ((cbrt(1.0) / sqrt(x)) / ((1.0 / sqrt(x)) + (1.0 / sqrt(1.0 + x))));
}




Bits error versus x
Results
| Original | 20.3 |
|---|---|
| Target | 0.7 |
| Herbie | 0.3 |
Initial program 20.3
rmApplied flip--_binary64_175820.3
Simplified20.3
Simplified20.3
rmApplied frac-sub_binary64_179219.7
Simplified5.9
rmApplied *-un-lft-identity_binary64_17835.9
Applied times-frac_binary64_17895.5
Applied associate-/l*_binary64_17280.4
Simplified0.4
rmApplied add-sqr-sqrt_binary64_18050.4
Applied add-cube-cbrt_binary64_18180.4
Applied times-frac_binary64_17890.3
Applied times-frac_binary64_17890.3
Final simplification0.3
herbie shell --seed 2021009
(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)))))