Average Error: 29.8 → 11.9
Time: 7.9s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.51175018326137502 \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 3562.7236275674059:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}} - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left({\left(\frac{1}{{x}^{7}}\right)}^{\frac{1}{3}}, 0.04938271604938271, 0.66666666666666663 \cdot {\left(\frac{1}{x}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{\frac{1}{3}}\right)\right)\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.51175018326137502 \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 3562.7236275674059:\\
\;\;\;\;\frac{\sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}} - \sqrt[3]{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left({\left(\frac{1}{{x}^{7}}\right)}^{\frac{1}{3}}, 0.04938271604938271, 0.66666666666666663 \cdot {\left(\frac{1}{x}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{\frac{1}{3}}\right)\right)\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\

\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.511750183261375e+61)) {
		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 {
		double VAR_1;
		if ((x <= 3562.723627567406)) {
			VAR_1 = ((double) (((double) (((double) cbrt(((double) (((double) pow(x, 3.0)) + ((double) pow(1.0, 3.0)))))) / ((double) cbrt(((double) (((double) (x * x)) + ((double) (((double) (1.0 * 1.0)) - ((double) (x * 1.0)))))))))) - ((double) cbrt(x))));
		} else {
			VAR_1 = ((double) (((double) expm1(((double) log1p(((double) fma(((double) pow(((double) (1.0 / ((double) pow(x, 7.0)))), 0.3333333333333333)), 0.04938271604938271, ((double) (((double) (0.6666666666666666 * ((double) pow(((double) (1.0 / x)), 0.3333333333333333)))) - ((double) (0.1111111111111111 * ((double) pow(((double) (1.0 / ((double) pow(x, 4.0)))), 0.3333333333333333)))))))))))) / ((double) (((double) cbrt(((double) (x + 1.0)))) + ((double) cbrt(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.511750183261375e+61

    1. Initial program 61.2

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

      \[\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. Simplified39.9

      \[\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.511750183261375e+61 < x < 3562.723627567406

    1. Initial program 5.0

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

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

      \[\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}\]

    if 3562.723627567406 < x

    1. Initial program 60.3

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} - \sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}}\]
    4. Using strategy rm
    5. Applied expm1-log1p-u60.3

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} - \sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
    6. Taylor expanded around inf 5.1

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(0.04938271604938271 \cdot {\left(\frac{1}{{x}^{7}}\right)}^{\frac{1}{3}} + 0.66666666666666663 \cdot {\left(\frac{1}{x}\right)}^{\frac{1}{3}}\right) - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{\frac{1}{3}}}\right)\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
    7. Simplified5.1

      \[\leadsto \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left({\left(\frac{1}{{x}^{7}}\right)}^{\frac{1}{3}}, 0.04938271604938271, 0.66666666666666663 \cdot {\left(\frac{1}{x}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{\frac{1}{3}}\right)}\right)\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.51175018326137502 \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 3562.7236275674059:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}} - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left({\left(\frac{1}{{x}^{7}}\right)}^{\frac{1}{3}}, 0.04938271604938271, 0.66666666666666663 \cdot {\left(\frac{1}{x}\right)}^{\frac{1}{3}} - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{4}}\right)}^{\frac{1}{3}}\right)\right)\right)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\ \end{array}\]

Reproduce

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