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




Bits error versus x
Results
| Original | 19.5 |
|---|---|
| Target | 0.7 |
| Herbie | 0.4 |
Initial program 19.5
rmApplied frac-sub_binary64_177119.5
Simplified19.5
Simplified19.5
rmApplied flip--_binary64_173719.3
Simplified0.4
rmApplied associate-/r*_binary64_17080.4
Simplified0.3
rmApplied add-cube-cbrt_binary64_17940.4
Applied sqrt-prod_binary64_17770.4
Applied associate-*r*_binary64_17040.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020299
(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)))))