Average Error: 29.9 → 0.6
Time: 5.5s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ t_1 := t_0 + \sqrt[3]{x}\\ \mathbf{if}\;x \leq -1.9028890590158987 \cdot 10^{+126} \lor \neg \left(x \leq 1.560200924407642 \cdot 10^{+43}\right):\\ \;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{t_1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_2 := \sqrt[3]{x + \left(x + 1\right)}\\ \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{t_2 \cdot t_2}{\frac{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {t_0}^{2}, x\right), {t_0}^{4}\right)}{t_2}}}{t_1}\right)\right) \end{array}\\ \end{array} \]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := t_0 + \sqrt[3]{x}\\
\mathbf{if}\;x \leq -1.9028890590158987 \cdot 10^{+126} \lor \neg \left(x \leq 1.560200924407642 \cdot 10^{+43}\right):\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{t_1}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt[3]{x + \left(x + 1\right)}\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{t_2 \cdot t_2}{\frac{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {t_0}^{2}, x\right), {t_0}^{4}\right)}{t_2}}}{t_1}\right)\right)
\end{array}\\


\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ x 1.0))) (t_1 (+ t_0 (cbrt x))))
   (if (or (<= x -1.9028890590158987e+126) (not (<= x 1.560200924407642e+43)))
     (expm1 (log1p (/ (* 0.6666666666666666 (cbrt (/ 1.0 x))) t_1)))
     (let* ((t_2 (cbrt (+ x (+ x 1.0)))))
       (expm1
        (log1p
         (/
          (/
           (* t_2 t_2)
           (/ (fma (cbrt x) (fma (cbrt x) (pow t_0 2.0) x) (pow t_0 4.0)) t_2))
          t_1)))))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt(x + 1.0);
	double t_1 = t_0 + cbrt(x);
	double tmp;
	if ((x <= -1.9028890590158987e+126) || !(x <= 1.560200924407642e+43)) {
		tmp = expm1(log1p((0.6666666666666666 * cbrt(1.0 / x)) / t_1));
	} else {
		double t_2 = cbrt(x + (x + 1.0));
		tmp = expm1(log1p(((t_2 * t_2) / (fma(cbrt(x), fma(cbrt(x), pow(t_0, 2.0), x), pow(t_0, 4.0)) / t_2)) / t_1));
	}
	return tmp;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -1.9028890590158987e126 or 1.560200924407642e43 < x

    1. Initial program 61.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied expm1-log1p-u_binary6461.2

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)\right)} \]
    3. Applied flip--_binary6461.2

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\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}}}\right)\right) \]
    4. Taylor expanded in x around inf 29.0

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\color{blue}{0.6666666666666666 \cdot {\left(\frac{1}{x}\right)}^{0.3333333333333333}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
    5. Simplified1.0

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\color{blue}{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]

    if -1.9028890590158987e126 < x < 1.560200924407642e43

    1. Initial program 11.8

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied expm1-log1p-u_binary6411.8

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)\right)} \]
    3. Applied flip--_binary6411.9

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\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}}}\right)\right) \]
    4. Applied flip3--_binary6411.9

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\color{blue}{\frac{{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{3}}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) + \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
    5. Simplified0.5

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{\color{blue}{x + \left(1 + x\right)}}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) + \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
    6. Simplified0.4

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{x + \left(1 + x\right)}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}, x\right), {\left(\sqrt[3]{1 + x}\right)}^{4}\right)}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
    7. Applied add-cube-cbrt_binary640.4

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(\sqrt[3]{x + \left(1 + x\right)} \cdot \sqrt[3]{x + \left(1 + x\right)}\right) \cdot \sqrt[3]{x + \left(1 + x\right)}}}{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}, x\right), {\left(\sqrt[3]{1 + x}\right)}^{4}\right)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
    8. Applied associate-/l*_binary640.4

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\color{blue}{\frac{\sqrt[3]{x + \left(1 + x\right)} \cdot \sqrt[3]{x + \left(1 + x\right)}}{\frac{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}, x\right), {\left(\sqrt[3]{1 + x}\right)}^{4}\right)}{\sqrt[3]{x + \left(1 + x\right)}}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9028890590158987 \cdot 10^{+126} \lor \neg \left(x \leq 1.560200924407642 \cdot 10^{+43}\right):\\ \;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{\sqrt[3]{x + \left(x + 1\right)} \cdot \sqrt[3]{x + \left(x + 1\right)}}{\frac{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}, x\right), {\left(\sqrt[3]{x + 1}\right)}^{4}\right)}{\sqrt[3]{x + \left(x + 1\right)}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\right)\right)\\ \end{array} \]

Reproduce

herbie shell --seed 2022081 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1.0)) (cbrt x)))