Average Error: 29.9 → 19.0
Time: 6.4s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.44050137801381259 \cdot 10^{61} \lor \neg \left(x \le 4941.5357012267541\right):\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}}, 0.333333333333333315, 0.061728395061728392 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{\sqrt[3]{x \cdot x - 1 \cdot 1} \cdot \sqrt[3]{x \cdot x - 1 \cdot 1}}}{\sqrt[3]{\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.44050137801381259 \cdot 10^{61} \lor \neg \left(x \le 4941.5357012267541\right):\\
\;\;\;\;\mathsf{fma}\left({\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}}, 0.333333333333333315, 0.061728395061728392 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}\right)\\

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

\end{array}
double code(double x) {
	return ((double) (((double) cbrt(((double) (x + 1.0)))) - ((double) cbrt(x))));
}
double code(double x) {
	double VAR;
	if (((x <= -4.4405013780138126e+61) || !(x <= 4941.535701226754))) {
		VAR = ((double) fma(((double) pow(((double) (1.0 / ((double) pow(x, 2.0)))), 0.3333333333333333)), 0.3333333333333333, ((double) (((double) (0.06172839506172839 * ((double) pow(((double) (1.0 / ((double) pow(x, 8.0)))), 0.3333333333333333)))) - ((double) (0.1111111111111111 * ((double) pow(((double) (1.0 / ((double) pow(x, 5.0)))), 0.3333333333333333))))))));
	} else {
		VAR = ((double) fma(((double) (((double) cbrt(((double) (((double) cbrt(((double) (((double) (x * x)) - ((double) (1.0 * 1.0)))))) * ((double) cbrt(((double) (((double) (x * x)) - ((double) (1.0 * 1.0)))))))))) / ((double) cbrt(((double) (((double) cbrt(((double) (x - 1.0)))) * ((double) cbrt(((double) (x - 1.0)))))))))), ((double) cbrt(((double) cbrt(((double) (x + 1.0)))))), ((double) -(((double) cbrt(x))))));
	}
	return VAR;
}

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 x < -4.4405013780138126e+61 or 4941.535701226754 < x

    1. Initial program 60.8

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

      \[\leadsto \color{blue}{\left(0.333333333333333315 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}} + 0.061728395061728392 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}}\right) - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}}\]
    3. Simplified36.4

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}}, 0.333333333333333315, 0.061728395061728392 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}\right)}\]

    if -4.4405013780138126e+61 < x < 4941.535701226754

    1. Initial program 5.0

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}} - \sqrt[3]{x}\]
    5. Applied fma-neg5.0

      \[\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]{x}\right)}\]
    6. Using strategy rm
    7. Applied flip-+5.0

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    8. Applied cbrt-div5.0

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \color{blue}{\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    9. Applied flip-+5.0

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\sqrt[3]{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} \cdot \frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    10. Applied cbrt-div5.0

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}}} \cdot \frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    11. Applied frac-times5.0

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\color{blue}{\frac{\sqrt[3]{x \cdot x - 1 \cdot 1} \cdot \sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    12. Applied cbrt-div4.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.44050137801381259 \cdot 10^{61} \lor \neg \left(x \le 4941.5357012267541\right):\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}}, 0.333333333333333315, 0.061728395061728392 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{\sqrt[3]{x \cdot x - 1 \cdot 1} \cdot \sqrt[3]{x \cdot x - 1 \cdot 1}}}{\sqrt[3]{\sqrt[3]{x - 1} \cdot \sqrt[3]{x - 1}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020123 +o rules:numerics
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1)) (cbrt x)))