Average Error: 29.7 → 0.4
Time: 7.3s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\ \mathbf{if}\;x \leq -4527.3591884227435:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4285.791217009184:\\ \;\;\;\;\begin{array}{l} t_1 := \sqrt[3]{x + 1}\\ t_2 := \sqrt[3]{\sqrt[3]{x}}\\ t_3 := t_2 \cdot t_2\\ t_4 := t_2 \cdot t_3\\ \sqrt{e^{\log \left(t_1 - \sqrt[3]{x}\right)}} \cdot \sqrt{\mathsf{fma}\left(\sqrt[3]{t_1 \cdot t_1}, \sqrt[3]{t_1}, -t_4\right) + \mathsf{fma}\left(-t_2, t_3, t_4\right)} \end{array}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\
\mathbf{if}\;x \leq -4527.3591884227435:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 4285.791217009184:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{x + 1}\\
t_2 := \sqrt[3]{\sqrt[3]{x}}\\
t_3 := t_2 \cdot t_2\\
t_4 := t_2 \cdot t_3\\
\sqrt{e^{\log \left(t_1 - \sqrt[3]{x}\right)}} \cdot \sqrt{\mathsf{fma}\left(\sqrt[3]{t_1 \cdot t_1}, \sqrt[3]{t_1}, -t_4\right) + \mathsf{fma}\left(-t_2, t_3, t_4\right)}
\end{array}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0
         (+
          (* (/ (cbrt x) x) (- 0.3333333333333333 (/ 0.1111111111111111 x)))
          (* 0.06172839506172839 (/ (cbrt x) (pow x 3.0))))))
   (if (<= x -4527.3591884227435)
     t_0
     (if (<= x 4285.791217009184)
       (let* ((t_1 (cbrt (+ x 1.0)))
              (t_2 (cbrt (cbrt x)))
              (t_3 (* t_2 t_2))
              (t_4 (* t_2 t_3)))
         (*
          (sqrt (exp (log (- t_1 (cbrt x)))))
          (sqrt
           (+
            (fma (cbrt (* t_1 t_1)) (cbrt t_1) (- t_4))
            (fma (- t_2) t_3 t_4)))))
       t_0))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double t_0 = ((cbrt(x) / x) * (0.3333333333333333 - (0.1111111111111111 / x))) + (0.06172839506172839 * (cbrt(x) / pow(x, 3.0)));
	double tmp;
	if (x <= -4527.3591884227435) {
		tmp = t_0;
	} else if (x <= 4285.791217009184) {
		double t_1 = cbrt(x + 1.0);
		double t_2 = cbrt(cbrt(x));
		double t_3 = t_2 * t_2;
		double t_4 = t_2 * t_3;
		tmp = sqrt(exp(log(t_1 - cbrt(x)))) * sqrt(fma(cbrt(t_1 * t_1), cbrt(t_1), -t_4) + fma(-t_2, t_3, t_4));
	} else {
		tmp = t_0;
	}
	return tmp;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -4527.3591884227435 or 4285.791217009184 < x

    1. Initial program 60.2

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

      \[\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.4

      \[\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 -4527.3591884227435 < x < 4285.791217009184

    1. Initial program 0.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied add-sqr-sqrt_binary640.2

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

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

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

      \[\leadsto \sqrt{\sqrt[3]{x + 1} - \sqrt[3]{x}} \cdot \sqrt{\color{blue}{\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}} - \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right) \cdot \sqrt[3]{\sqrt[3]{x}}} \]
    6. Applied prod-diff_binary640.2

      \[\leadsto \sqrt{\sqrt[3]{x + 1} - \sqrt[3]{x}} \cdot \sqrt{\color{blue}{\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]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right)}} \]
    7. Applied add-exp-log_binary640.2

      \[\leadsto \sqrt{\color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}}} \cdot \sqrt{\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]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right)} \]
    8. Simplified0.2

      \[\leadsto \sqrt{e^{\color{blue}{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}}} \cdot \sqrt{\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]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4527.3591884227435:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\ \mathbf{elif}\;x \leq 4285.791217009184:\\ \;\;\;\;\sqrt{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}} \cdot \sqrt{\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]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}, \sqrt[3]{\sqrt[3]{x}} \cdot \left(\sqrt[3]{\sqrt[3]{x}} \cdot \sqrt[3]{\sqrt[3]{x}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 - \frac{0.1111111111111111}{x}\right) + 0.06172839506172839 \cdot \frac{\sqrt[3]{x}}{{x}^{3}}\\ \end{array} \]

Reproduce

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