Average Error: 30.5 → 9.1
Time: 3.1s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -792.1945835035048:\\ \;\;\;\;\left(0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}} + 0.06172839506172839 \cdot \sqrt[3]{\frac{1}{{x}^{8}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{5}}} + 0.0411522633744856 \cdot \sqrt[3]{\frac{1}{{x}^{11}}}\right)\\ \mathbf{elif}\;x \leq 2.2994889441643388 \cdot 10^{-10}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{x \cdot x + \left(1 - x\right)}} - \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{0.6666666666666666} + \sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \leq -792.1945835035048:\\
\;\;\;\;\left(0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}} + 0.06172839506172839 \cdot \sqrt[3]{\frac{1}{{x}^{8}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{5}}} + 0.0411522633744856 \cdot \sqrt[3]{\frac{1}{{x}^{11}}}\right)\\

\mathbf{elif}\;x \leq 2.2994889441643388 \cdot 10^{-10}:\\
\;\;\;\;e^{\log \left(\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{x \cdot x + \left(1 - x\right)}} - \sqrt[3]{x}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{0.6666666666666666} + \sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}\\

\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (if (<= x -792.1945835035048)
   (-
    (+
     (* 0.3333333333333333 (cbrt (/ 1.0 (* x x))))
     (* 0.06172839506172839 (cbrt (/ 1.0 (pow x 8.0)))))
    (+
     (* 0.1111111111111111 (cbrt (/ 1.0 (pow x 5.0))))
     (* 0.0411522633744856 (cbrt (/ 1.0 (pow x 11.0))))))
   (if (<= x 2.2994889441643388e-10)
     (exp
      (log
       (-
        (/ (cbrt (+ 1.0 (pow x 3.0))) (cbrt (+ (* x x) (- 1.0 x))))
        (cbrt x))))
     (/
      1.0
      (+
       (pow x 0.6666666666666666)
       (* (cbrt (+ x 1.0)) (+ (cbrt x) (cbrt (+ x 1.0)))))))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double tmp;
	if (x <= -792.1945835035048) {
		tmp = ((0.3333333333333333 * cbrt(1.0 / (x * x))) + (0.06172839506172839 * cbrt(1.0 / pow(x, 8.0)))) - ((0.1111111111111111 * cbrt(1.0 / pow(x, 5.0))) + (0.0411522633744856 * cbrt(1.0 / pow(x, 11.0))));
	} else if (x <= 2.2994889441643388e-10) {
		tmp = exp(log((cbrt(1.0 + pow(x, 3.0)) / cbrt((x * x) + (1.0 - x))) - cbrt(x)));
	} else {
		tmp = 1.0 / (pow(x, 0.6666666666666666) + (cbrt(x + 1.0) * (cbrt(x) + cbrt(x + 1.0))));
	}
	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 3 regimes
  2. if x < -792.194583503504759

    1. Initial program 60.4

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Taylor expanded around inf 44.0

      \[\leadsto \color{blue}{\left(0.06172839506172839 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{0.3333333333333333} + 0.3333333333333333 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333}\right) - \left(0.0411522633744856 \cdot {\left(\frac{1}{{x}^{11}}\right)}^{0.3333333333333333} + 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{0.3333333333333333}\right)}\]
    3. Simplified30.9

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

    if -792.194583503504759 < x < 2.29948894416433881e-10

    1. Initial program 0.0

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt[3]{1 + {x}^{3}}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}} - \sqrt[3]{x}\]
    6. Simplified0.1

      \[\leadsto \frac{\sqrt[3]{1 + {x}^{3}}}{\color{blue}{\sqrt[3]{x \cdot x + \left(1 - x\right)}}} - \sqrt[3]{x}\]
    7. Using strategy rm
    8. Applied add-exp-log_binary640.1

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

    if 2.29948894416433881e-10 < x

    1. Initial program 57.4

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

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

      \[\leadsto \frac{\color{blue}{1}}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}\]
    5. Simplified4.4

      \[\leadsto \frac{1}{\color{blue}{{x}^{0.6666666666666666} + \sqrt[3]{1 + x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -792.1945835035048:\\ \;\;\;\;\left(0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}} + 0.06172839506172839 \cdot \sqrt[3]{\frac{1}{{x}^{8}}}\right) - \left(0.1111111111111111 \cdot \sqrt[3]{\frac{1}{{x}^{5}}} + 0.0411522633744856 \cdot \sqrt[3]{\frac{1}{{x}^{11}}}\right)\\ \mathbf{elif}\;x \leq 2.2994889441643388 \cdot 10^{-10}:\\ \;\;\;\;e^{\log \left(\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{x \cdot x + \left(1 - x\right)}} - \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{0.6666666666666666} + \sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}\\ \end{array}\]

Reproduce

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