Average Error: 29.6 → 0.4
Time: 3.7s
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 0.000821547002082923:\\ \;\;\;\;\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}:\\ \;\;\;\;\log \left(e^{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 0.000821547002082923:\\
\;\;\;\;\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}:\\
\;\;\;\;\log \left(e^{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)) 0.000821547002082923)
     (+
      (* (/ (cbrt x) x) (- 0.3333333333333333 (/ 0.1111111111111111 x)))
      (* 0.06172839506172839 (/ (cbrt x) (pow x 3.0))))
     (log (exp (- 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)) <= 0.000821547002082923) {
		tmp = ((cbrt(x) / x) * (0.3333333333333333 - (0.1111111111111111 / x))) + (0.06172839506172839 * (cbrt(x) / pow(x, 3.0)));
	} else {
		tmp = log(exp(t_0 - cbrt(cbrt(x) * (cbrt(x) * 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)) < 8.2154700208292e-4

    1. Initial program 60.3

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

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

      \[\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 8.2154700208292e-4 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))

    1. Initial program 0.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied add-log-exp_binary640.2

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{\log \left(e^{\sqrt[3]{x}}\right)} \]
    3. Applied add-log-exp_binary640.2

      \[\leadsto \color{blue}{\log \left(e^{\sqrt[3]{x + 1}}\right)} - \log \left(e^{\sqrt[3]{x}}\right) \]
    4. Applied diff-log_binary640.2

      \[\leadsto \color{blue}{\log \left(\frac{e^{\sqrt[3]{x + 1}}}{e^{\sqrt[3]{x}}}\right)} \]
    5. Simplified0.1

      \[\leadsto \log \color{blue}{\left(e^{\sqrt[3]{1 + x} - \sqrt[3]{x}}\right)} \]
    6. Applied add-cbrt-cube_binary640.1

      \[\leadsto \log \left(e^{\sqrt[3]{1 + x} - \color{blue}{\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 0.000821547002082923:\\ \;\;\;\;\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}:\\ \;\;\;\;\log \left(e^{\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 2021313 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1.0)) (cbrt x)))