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











Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 15.8 |
| Cost | 33473 |
| Alternative 2 | |
|---|---|
| Error | 16.1 |
| Cost | 26561 |
| Alternative 3 | |
|---|---|
| Error | 15.8 |
| Cost | 26497 |
| Alternative 4 | |
|---|---|
| Error | 16.2 |
| Cost | 7432 |
| Alternative 5 | |
|---|---|
| Error | 16.3 |
| Cost | 7176 |
| Alternative 6 | |
|---|---|
| Error | 16.6 |
| Cost | 7176 |
| Alternative 7 | |
|---|---|
| Error | 31.5 |
| Cost | 6592 |
| Alternative 8 | |
|---|---|
| Error | 32.0 |
| Cost | 64 |

if x < -1.00567900631919005Initial program 59.7
Taylor expanded around inf 44.1
Simplified30.7
Simplified30.7
if -1.00567900631919005 < x < 1.5642350038859539e-9Initial program 0.0
rmApplied pow1/3_binary64_1600.0
Simplified0.0
if 1.5642350038859539e-9 < x Initial program 58.2
rmApplied flip3--_binary64_8258.1
Simplified1.0
Simplified4.4
Simplified4.4
Final simplification8.8
herbie shell --seed 2021044
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))