Average Error: 29.7 → 11.8
Time: 5.2s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.4950236535924181 \cdot 10^{61}:\\ \;\;\;\;\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{elif}\;x \le 0.0131361152034403465:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{{x}^{3} + {1}^{3}}, \frac{1}{\frac{\sqrt[3]{{\left(x \cdot x\right)}^{3} + {\left(1 \cdot 1 - x \cdot 1\right)}^{3}}}{\sqrt[3]{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(\left(1 \cdot 1 - x \cdot 1\right) \cdot \left(1 \cdot 1 - x \cdot 1\right) - \left(x \cdot x\right) \cdot \left(1 \cdot 1 - x \cdot 1\right)\right)}}}, -\sqrt[3]{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0 + 1}{\mathsf{fma}\left(\sqrt[3]{x + 1}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {x}^{\frac{2}{3}}\right)}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.4950236535924181 \cdot 10^{61}:\\
\;\;\;\;\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{elif}\;x \le 0.0131361152034403465:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{{x}^{3} + {1}^{3}}, \frac{1}{\frac{\sqrt[3]{{\left(x \cdot x\right)}^{3} + {\left(1 \cdot 1 - x \cdot 1\right)}^{3}}}{\sqrt[3]{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(\left(1 \cdot 1 - x \cdot 1\right) \cdot \left(1 \cdot 1 - x \cdot 1\right) - \left(x \cdot x\right) \cdot \left(1 \cdot 1 - x \cdot 1\right)\right)}}}, -\sqrt[3]{x}\right)\\

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

\end{array}
double code(double x) {
	return (cbrt((x + 1.0)) - cbrt(x));
}
double code(double x) {
	double VAR;
	if ((x <= -4.495023653592418e+61)) {
		VAR = 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 <= 0.013136115203440346)) {
			VAR_1 = fma(cbrt((pow(x, 3.0) + pow(1.0, 3.0))), (1.0 / (cbrt((pow((x * x), 3.0) + pow(((1.0 * 1.0) - (x * 1.0)), 3.0))) / cbrt((((x * x) * (x * x)) + ((((1.0 * 1.0) - (x * 1.0)) * ((1.0 * 1.0) - (x * 1.0))) - ((x * x) * ((1.0 * 1.0) - (x * 1.0)))))))), -cbrt(x));
		} else {
			VAR_1 = ((0.0 + 1.0) / fma(cbrt((x + 1.0)), (cbrt((x + 1.0)) + cbrt(x)), pow(x, 0.6666666666666666)));
		}
		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.495023653592418e+61

    1. Initial program 61.2

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

      \[\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. Simplified40.3

      \[\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.495023653592418e+61 < x < 0.013136115203440346

    1. Initial program 4.6

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

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

      \[\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. Using strategy rm
    6. Applied div-inv4.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{{x}^{3} + {1}^{3}}, \frac{1}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}, -\sqrt[3]{x}\right)}\]
    8. Using strategy rm
    9. Applied flip3-+4.5

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

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

    if 0.013136115203440346 < x

    1. Initial program 59.0

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

      \[\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}{0 + 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{0 + 1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x + 1}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {x}^{\frac{2}{3}}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.8

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

Reproduce

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