\sqrt[3]{x + 1} - \sqrt[3]{x}\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 1.4079318845006128 \cdot 10^{-05}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 + \frac{-0.1111111111111111}{x}\right) + \left(\sqrt[3]{x} - \sqrt[3]{-x} \cdot \sqrt[3]{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(x + 1\right)}^{0.3333333333333333} - \sqrt[3]{x}\\
\end{array}(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 1.4079318845006128e-05)
(+
(* (/ (cbrt x) x) (+ 0.3333333333333333 (/ -0.1111111111111111 x)))
(- (cbrt x) (* (cbrt (- x)) (cbrt -1.0))))
(- (pow (+ x 1.0) 0.3333333333333333) (cbrt x))))double code(double x) {
return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
double tmp;
if ((cbrt(x + 1.0) - cbrt(x)) <= 1.4079318845006128e-05) {
tmp = ((cbrt(x) / x) * (0.3333333333333333 + (-0.1111111111111111 / x))) + (cbrt(x) - (cbrt(-x) * cbrt(-1.0)));
} else {
tmp = pow((x + 1.0), 0.3333333333333333) - cbrt(x);
}
return tmp;
}



Bits error versus x
Results
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 1.4079318845e-5Initial program 60.6
Taylor expanded around -inf 64.0
Simplified0.6
if 1.4079318845e-5 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 0.2
rmApplied pow1/3_binary64_8420.7
Final simplification0.7
herbie shell --seed 2020356
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))