Average Error: 29.6 → 0.5
Time: 1.7s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 1.5432653867719637 \cdot 10^{-05}:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 + \frac{-0.1111111111111111}{x}\right) + \left(\sqrt[3]{x} - \sqrt[3]{-x} \cdot \sqrt[3]{-1}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{-1 + x \cdot x}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 1.5432653867719637 \cdot 10^{-05}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(0.3333333333333333 + \frac{-0.1111111111111111}{x}\right) + \left(\sqrt[3]{x} - \sqrt[3]{-x} \cdot \sqrt[3]{-1}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{-1 + x \cdot x}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\

\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 1.5432653867719637e-05)
   (+
    (* (/ (cbrt x) x) (+ 0.3333333333333333 (/ -0.1111111111111111 x)))
    (- (cbrt x) (* (cbrt (- x)) (cbrt -1.0))))
   (- (/ (cbrt (+ -1.0 (* x x))) (cbrt (+ x -1.0))) (cbrt x))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double tmp;
	if ((cbrt(x + 1.0) - cbrt(x)) <= 1.5432653867719637e-05) {
		tmp = ((cbrt(x) / x) * (0.3333333333333333 + (-0.1111111111111111 / x))) + (cbrt(x) - (cbrt(-x) * cbrt(-1.0)));
	} else {
		tmp = (cbrt(-1.0 + (x * x)) / cbrt(x + -1.0)) - cbrt(x);
	}
	return tmp;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

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

    1. Initial program 60.6

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

      \[\leadsto \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. Using strategy rm
    5. Applied add-cube-cbrt_binary6460.9

      \[\leadsto \sqrt[3]{x + 1} - \left(\sqrt[3]{\sqrt[3]{x}} \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\sqrt[3]{x}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{x}}}\right) \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{x}}}\right)}\right) \cdot \sqrt[3]{\sqrt[3]{x}}\]
    6. Taylor expanded 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} + e^{0.3333333333333333 \cdot \left(\log -1 - \log \left(\frac{-1}{x}\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)}\]
    7. Simplified0.6

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

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

    1. Initial program 0.3

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied flip-+_binary640.3

      \[\leadsto \sqrt[3]{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \sqrt[3]{x}\]
    4. Applied cbrt-div_binary640.3

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}}} - \sqrt[3]{x}\]
    5. Simplified0.3

      \[\leadsto \frac{\color{blue}{\sqrt[3]{x \cdot x - 1}}}{\sqrt[3]{x - 1}} - \sqrt[3]{x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

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

Reproduce

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