Average Error: 29.6 → 0.4
Time: 5.1s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2.0969662585912374 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{t_0 \cdot t_0}, \sqrt[3]{t_0}, -\sqrt[3]{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)\\ \end{array} \]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2.0969662585912374 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{t_0 \cdot t_0}, \sqrt[3]{t_0}, -\sqrt[3]{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)\\


\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ x 1.0))))
   (if (<= (- t_0 (cbrt x)) 2.0969662585912374e-5)
     (+
      (* (/ (cbrt x) x) (- 0.3333333333333333 (/ 0.1111111111111111 x)))
      (* 0.06172839506172839 (/ (cbrt x) (pow x 3.0))))
     (fma
      (cbrt (* t_0 t_0))
      (cbrt t_0)
      (- (cbrt (* (cbrt x) (* (cbrt x) (cbrt x)))))))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt(x + 1.0);
	double tmp;
	if ((t_0 - cbrt(x)) <= 2.0969662585912374e-5) {
		tmp = ((cbrt(x) / x) * (0.3333333333333333 - (0.1111111111111111 / x))) + (0.06172839506172839 * (cbrt(x) / pow(x, 3.0)));
	} else {
		tmp = fma(cbrt(t_0 * t_0), cbrt(t_0), -cbrt(cbrt(x) * (cbrt(x) * cbrt(x))));
	}
	return tmp;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2.0969662586e-5

    1. Initial program 60.6

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied add-cube-cbrt_binary6460.7

      \[\leadsto \sqrt[3]{x + 1} - \sqrt[3]{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}} \]
    3. Applied cbrt-prod_binary6460.8

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}} \]
    4. Taylor expanded in x around -inf 64.0

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \frac{e^{0.3333333333333333 \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{x} + \left(0.06172839506172839 \cdot \frac{e^{0.3333333333333333 \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{{x}^{3}} + e^{0.3333333333333333 \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}\right)\right) - \left(0.1111111111111111 \cdot \frac{e^{0.3333333333333333 \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{{x}^{2}} + {\left(-1 \cdot x\right)}^{0.3333333333333333} \cdot \sqrt[3]{-1}\right)} \]
    5. Simplified0.6

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}} \]

    if 2.0969662586e-5 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 0.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied add-cbrt-cube_binary640.2

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}} \]
    3. Applied add-cube-cbrt_binary640.2

      \[\leadsto \sqrt[3]{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \sqrt[3]{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} \]
    4. Applied cbrt-prod_binary640.3

      \[\leadsto \color{blue}{\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}} - \sqrt[3]{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}} \]
    5. Applied fma-neg_binary640.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 2.0969662585912374 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}\right)\\ \end{array} \]

Reproduce

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