Average Error: 29.9 → 12.4
Time: 6.2s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.45593027296653583 \cdot 10^{61}:\\ \;\;\;\;e^{\log \left(\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)\right)}\\ \mathbf{elif}\;x \le 3103.3891723919032:\\ \;\;\;\;e^{\log \left(\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}} - \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\mathsf{fma}\left(0.18518518518518517, \frac{1}{{x}^{2}}, \left(\log \left(\frac{1}{x}\right) + \log \left(0.333333333333333315 \cdot {x}^{\frac{1}{3}}\right)\right) - \mathsf{fma}\left(0.006172839506172839, \frac{1}{{x}^{2} \cdot {0.333333333333333315}^{2}}, 0.333333333333333315 \cdot \frac{1}{x}\right)\right)}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.45593027296653583 \cdot 10^{61}:\\
\;\;\;\;e^{\log \left(\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)\right)}\\

\mathbf{elif}\;x \le 3103.3891723919032:\\
\;\;\;\;e^{\log \left(\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}} - \sqrt[3]{x}\right)}\\

\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(0.18518518518518517, \frac{1}{{x}^{2}}, \left(\log \left(\frac{1}{x}\right) + \log \left(0.333333333333333315 \cdot {x}^{\frac{1}{3}}\right)\right) - \mathsf{fma}\left(0.006172839506172839, \frac{1}{{x}^{2} \cdot {0.333333333333333315}^{2}}, 0.333333333333333315 \cdot \frac{1}{x}\right)\right)}\\

\end{array}
double code(double x) {
	return (cbrt((x + 1.0)) - cbrt(x));
}
double code(double x) {
	double VAR;
	if ((x <= -4.455930272966536e+61)) {
		VAR = exp(log(fma(pow((1.0 / pow(x, 2.0)), 0.3333333333333333), 0.3333333333333333, ((0.06172839506172839 * pow((1.0 / pow(x, 8.0)), 0.3333333333333333)) - (0.1111111111111111 * pow((1.0 / pow(x, 5.0)), 0.3333333333333333))))));
	} else {
		double VAR_1;
		if ((x <= 3103.3891723919032)) {
			VAR_1 = exp(log(((cbrt(((x * x) - (1.0 * 1.0))) / cbrt((x - 1.0))) - cbrt(x))));
		} else {
			VAR_1 = exp(fma(0.18518518518518517, (1.0 / pow(x, 2.0)), ((log((1.0 / x)) + log((0.3333333333333333 * pow(x, 0.3333333333333333)))) - fma(0.006172839506172839, (1.0 / (pow(x, 2.0) * pow(0.3333333333333333, 2.0))), (0.3333333333333333 * (1.0 / x))))));
		}
		VAR = VAR_1;
	}
	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 3 regimes
  2. if x < -4.455930272966536e+61

    1. Initial program 61.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-exp-log61.2

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}}\]
    4. Taylor expanded around inf 41.2

      \[\leadsto e^{\log \color{blue}{\left(\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}}\right)}}\]
    5. Simplified41.2

      \[\leadsto e^{\log \color{blue}{\left(\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)\right)}}\]

    if -4.455930272966536e+61 < x < 3103.3891723919032

    1. Initial program 4.8

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-exp-log4.8

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}}\]
    4. Using strategy rm
    5. Applied flip-+4.8

      \[\leadsto e^{\log \left(\sqrt[3]{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \sqrt[3]{x}\right)}\]
    6. Applied cbrt-div4.8

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

    if 3103.3891723919032 < x

    1. Initial program 60.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-exp-log60.1

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}}\]
    4. Taylor expanded around inf 5.9

      \[\leadsto e^{\color{blue}{\left(0.18518518518518517 \cdot \frac{1}{{x}^{2}} + \left(\log \left(\frac{1}{x}\right) + \log \left(0.333333333333333315 \cdot {x}^{\frac{1}{3}}\right)\right)\right) - \left(0.006172839506172839 \cdot \frac{1}{{x}^{2} \cdot {0.333333333333333315}^{2}} + 0.333333333333333315 \cdot \frac{1}{x}\right)}}\]
    5. Simplified5.9

      \[\leadsto e^{\color{blue}{\mathsf{fma}\left(0.18518518518518517, \frac{1}{{x}^{2}}, \left(\log \left(\frac{1}{x}\right) + \log \left(0.333333333333333315 \cdot {x}^{\frac{1}{3}}\right)\right) - \mathsf{fma}\left(0.006172839506172839, \frac{1}{{x}^{2} \cdot {0.333333333333333315}^{2}}, 0.333333333333333315 \cdot \frac{1}{x}\right)\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification12.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.45593027296653583 \cdot 10^{61}:\\ \;\;\;\;e^{\log \left(\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)\right)}\\ \mathbf{elif}\;x \le 3103.3891723919032:\\ \;\;\;\;e^{\log \left(\frac{\sqrt[3]{x \cdot x - 1 \cdot 1}}{\sqrt[3]{x - 1}} - \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\mathsf{fma}\left(0.18518518518518517, \frac{1}{{x}^{2}}, \left(\log \left(\frac{1}{x}\right) + \log \left(0.333333333333333315 \cdot {x}^{\frac{1}{3}}\right)\right) - \mathsf{fma}\left(0.006172839506172839, \frac{1}{{x}^{2} \cdot {0.333333333333333315}^{2}}, 0.333333333333333315 \cdot \frac{1}{x}\right)\right)}\\ \end{array}\]

Reproduce

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