Average Error: 29.5 → 0.6
Time: 7.3s
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}\\ t_2 := \frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{t_1}\\ \mathbf{if}\;x \leq -9.53569078558344 \cdot 10^{+65}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5.23150834671369 \cdot 10^{+37}:\\ \;\;\;\;\frac{\left(x + \left(x + 1\right)\right) \cdot \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {t_0}^{2}, x\right), {t_0}^{4}\right)}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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}\\
t_2 := \frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{t_1}\\
\mathbf{if}\;x \leq -9.53569078558344 \cdot 10^{+65}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 5.23150834671369 \cdot 10^{+37}:\\
\;\;\;\;\frac{\left(x + \left(x + 1\right)\right) \cdot \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \mathsf{fma}\left(\sqrt[3]{x}, {t_0}^{2}, x\right), {t_0}^{4}\right)}}{t_1}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\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)))
        (t_2 (/ (* 0.6666666666666666 (cbrt (/ 1.0 x))) t_1)))
   (if (<= x -9.53569078558344e+65)
     t_2
     (if (<= x 5.23150834671369e+37)
       (/
        (*
         (+ x (+ x 1.0))
         (/ 1.0 (fma (cbrt x) (fma (cbrt x) (pow t_0 2.0) x) (pow t_0 4.0))))
        t_1)
       t_2))))
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 t_2 = (0.6666666666666666 * cbrt(1.0 / x)) / t_1;
	double tmp;
	if (x <= -9.53569078558344e+65) {
		tmp = t_2;
	} else if (x <= 5.23150834671369e+37) {
		tmp = ((x + (x + 1.0)) * (1.0 / fma(cbrt(x), fma(cbrt(x), pow(t_0, 2.0), x), pow(t_0, 4.0)))) / t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -9.53569078558344024e65 or 5.23150834671368982e37 < x

    1. Initial program 61.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied flip--_binary6461.2

      \[\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}}} \]
    3. Taylor expanded in x around inf 32.9

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

      \[\leadsto \frac{\color{blue}{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}} \]

    if -9.53569078558344024e65 < x < 5.23150834671368982e37

    1. Initial program 6.6

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied flip--_binary646.7

      \[\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}}} \]
    3. Applied flip3--_binary646.7

      \[\leadsto \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}} \]
    4. Simplified0.3

      \[\leadsto \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}} \]
    5. Simplified0.3

      \[\leadsto \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}} \]
    6. Applied div-inv_binary640.3

      \[\leadsto \frac{\color{blue}{\left(x + \left(1 + x\right)\right) \cdot \frac{1}{\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}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.53569078558344 \cdot 10^{+65}:\\ \;\;\;\;\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\ \mathbf{elif}\;x \leq 5.23150834671369 \cdot 10^{+37}:\\ \;\;\;\;\frac{\left(x + \left(x + 1\right)\right) \cdot \frac{1}{\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 + 1} + \sqrt[3]{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.6666666666666666 \cdot \sqrt[3]{\frac{1}{x}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\ \end{array} \]

Reproduce

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