Average Error: 30.2 → 0.6
Time: 51.3s
Precision: binary64
Cost: 59976
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 576.7628552642777\right):\\
\;\;\;\;\frac{\left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} + 0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}} + 0.02880658436213992 \cdot \sqrt[3]{\frac{1}{{x}^{10}}}\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;{\left(x + 1\right)}^{0.3333333333333333} - \sqrt[3]{x}\\
\end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}↓
\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 576.7628552642777\right):\\
\;\;\;\;\frac{\left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} + 0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}} + 0.02880658436213992 \cdot \sqrt[3]{\frac{1}{{x}^{10}}}\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\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 (or (<= x -1.0054527956503754) (not (<= x 576.7628552642777)))
(/
(-
(+
(* 0.6666666666666666 (cbrt (/ 1.0 x)))
(* 0.04938271604938271 (cbrt (/ 1.0 (pow x 7.0)))))
(+
(* 0.1111111111111111 (cbrt (/ 1.0 (pow x 4.0))))
(* 0.02880658436213992 (cbrt (/ 1.0 (pow x 10.0))))))
(+ (cbrt (+ x 1.0)) (cbrt x)))
(- (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 ((x <= -1.0054527956503754) || !(x <= 576.7628552642777)) {
tmp = (((0.6666666666666666 * cbrt(1.0 / x)) + (0.04938271604938271 * cbrt(1.0 / pow(x, 7.0)))) - ((0.1111111111111111 * cbrt(1.0 / pow(x, 4.0))) + (0.02880658436213992 * cbrt(1.0 / pow(x, 10.0))))) / (cbrt(x + 1.0) + cbrt(x));
} else {
tmp = pow((x + 1.0), 0.3333333333333333) - cbrt(x);
}
return tmp;
}
Try it out
Enter valid numbers for all inputs
Alternatives
| Alternative 1 |
|---|
| Error | 0.6 |
|---|
| Cost | 46728 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4332.041001643122 \lor \neg \left(x \leq 2693.05771023905\right):\\
\;\;\;\;\frac{0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}} + \left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} - 0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}}\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{x + 1} - \sqrt[3]{\sqrt[3]{x}} \cdot \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\\
\end{array}\]
| Alternative 2 |
|---|
| Error | 0.7 |
|---|
| Cost | 33480 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -105352.56770425299 \lor \neg \left(x \leq 63605.802848912346\right):\\
\;\;\;\;\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} - 0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} - \sqrt[3]{x \cdot x}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\end{array}\]
| Alternative 3 |
|---|
| Error | 0.8 |
|---|
| Cost | 26824 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -25266815.562077403 \lor \neg \left(x \leq 56905652.54357344\right):\\
\;\;\;\;\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{x \cdot x + \left(1 - x\right)}} - \sqrt[3]{x}\\
\end{array}\]
| Alternative 4 |
|---|
| Error | 0.8 |
|---|
| Cost | 20232 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -13625869.572864452 \lor \neg \left(x \leq 18145458.081923485\right):\\
\;\;\;\;\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x \cdot x + -1}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}\]
| Alternative 5 |
|---|
| Error | 16.2 |
|---|
| Cost | 20232 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -30197579.700860236 \lor \neg \left(x \leq 19112764.660132885\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x \cdot x + -1}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}\]
| Alternative 6 |
|---|
| Error | 16.1 |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -50261857.06093893 \lor \neg \left(x \leq 21047377.816551685\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{x + 1} - \sqrt[3]{x}\\
\end{array}\]
| Alternative 7 |
|---|
| Error | 16.6 |
|---|
| Cost | 7688 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 1.257388279530115\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot \left(0.3333333333333333 + x \cdot \left(x \cdot 0.06172839506172839 + -0.1111111111111111\right)\right) - \sqrt[3]{x}\right)\\
\end{array}\]
| Alternative 8 |
|---|
| Error | 16.6 |
|---|
| Cost | 7432 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 1.0270220023312078\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(0.3333333333333333 - x \cdot 0.1111111111111111\right)\right) - \sqrt[3]{x}\\
\end{array}\]
| Alternative 9 |
|---|
| Error | 16.7 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 1.0270220023312078\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)\\
\end{array}\]
| Alternative 10 |
|---|
| Error | 16.7 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 1.0270220023312078\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.3333333333333333\right) - \sqrt[3]{x}\\
\end{array}\]
| Alternative 11 |
|---|
| Error | 31.8 |
|---|
| Cost | 6592 |
|---|
\[1 - \sqrt[3]{x}\]
| Alternative 12 |
|---|
| Error | 32.3 |
|---|
| Cost | 64 |
|---|
\[1\]
| Alternative 13 |
|---|
| Error | 61.7 |
|---|
| Cost | 64 |
|---|
\[0\]
Error

Derivation
- Split input into 2 regimes
if x < -1.0054527956503754 or 576.76285526427773 < x
Initial program 59.6
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
- Using strategy
rm Applied flip--_binary64_5359.6
\[\leadsto \color{blue}{\frac{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} - \sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}}\]
Simplified61.7
\[\leadsto \frac{\color{blue}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} - {x}^{0.6666666666666666}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
Taylor expanded around inf 35.6
\[\leadsto \frac{\color{blue}{\left(0.04938271604938271 \cdot {\left(\frac{1}{{x}^{7}}\right)}^{0.3333333333333333} + 0.6666666666666666 \cdot {\left(\frac{1}{x}\right)}^{0.3333333333333333}\right) - \left(0.02880658436213992 \cdot {\left(\frac{1}{{x}^{10}}\right)}^{0.3333333333333333} + 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{0.3333333333333333}\right)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
Simplified1.1
\[\leadsto \frac{\color{blue}{\left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} + 0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}} + 0.02880658436213992 \cdot \sqrt[3]{\frac{1}{{x}^{10}}}\right)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
Simplified1.1
\[\leadsto \color{blue}{\frac{\left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} + 0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}} + 0.02880658436213992 \cdot \sqrt[3]{\frac{1}{{x}^{10}}}\right)}{\sqrt[3]{1 + x} + \sqrt[3]{x}}}\]
if -1.0054527956503754 < x < 576.76285526427773
Initial program 0.0
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
- Using strategy
rm Applied sub-neg_binary64_710.0
\[\leadsto \color{blue}{\sqrt[3]{x + 1} + \left(-\sqrt[3]{x}\right)}\]
- Using strategy
rm Applied pow1/3_binary64_1600.0
\[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} + \left(-\sqrt[3]{x}\right)\]
Simplified0.0
\[\leadsto \color{blue}{{\left(1 + x\right)}^{0.3333333333333333} - \sqrt[3]{x}}\]
- Recombined 2 regimes into one program.
Final simplification0.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \leq -1.0054527956503754 \lor \neg \left(x \leq 576.7628552642777\right):\\
\;\;\;\;\frac{\left(0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}} + 0.04938271604938271 \cdot \sqrt[3]{\frac{1}{{x}^{7}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{4}}} + 0.02880658436213992 \cdot \sqrt[3]{\frac{1}{{x}^{10}}}\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\
\mathbf{else}:\\
\;\;\;\;{\left(x + 1\right)}^{0.3333333333333333} - \sqrt[3]{x}\\
\end{array}\]
Reproduce
herbie shell --seed 2021014
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))