Average Error: 30.4 → 11.7
Time: 6.8s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.4424562017088699 \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 3388.19456960033722:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{\sqrt[3]{x + 1} \cdot \sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\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)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -4.4424562017088699 \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 3388.19456960033722:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{\sqrt[3]{x + 1} \cdot \sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\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)}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\\

\end{array}
double code(double x) {
	return (cbrt((x + 1.0)) - cbrt(x));
}
double code(double x) {
	double temp;
	if ((x <= -4.44245620170887e+61)) {
		temp = 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 temp_1;
		if ((x <= 3388.194569600337)) {
			temp_1 = fma(cbrt(((cbrt((x + 1.0)) * cbrt((pow(x, 3.0) + pow(1.0, 3.0)))) / cbrt(((x * x) + ((1.0 * 1.0) - (x * 1.0)))))), cbrt(cbrt((x + 1.0))), -cbrt(x));
		} else {
			temp_1 = (fma(pow((1.0 / pow(x, 7.0)), 0.3333333333333333), 0.04938271604938271, ((0.6666666666666666 * pow((1.0 / x), 0.3333333333333333)) - (0.1111111111111111 * pow((1.0 / pow(x, 4.0)), 0.3333333333333333)))) / (cbrt((x + 1.0)) + cbrt(x)));
		}
		temp = temp_1;
	}
	return temp;
}

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.44245620170887e+61

    1. Initial program 61.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Taylor expanded around inf 38.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. Simplified38.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.44245620170887e+61 < x < 3388.194569600337

    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-neg4.9

      \[\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 flip3-+4.9

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \color{blue}{\frac{\sqrt[3]{{x}^{3} + {1}^{3}}}{\sqrt[3]{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}}}, \sqrt[3]{\sqrt[3]{x + 1}}, -\sqrt[3]{x}\right)\]
    9. Applied associate-*r/4.9

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

    if 3388.194569600337 < x

    1. Initial program 60.2

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

      \[\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. Taylor expanded around inf 5.1

      \[\leadsto \frac{\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}}}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
    5. Simplified5.1

      \[\leadsto \frac{\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)}}{\sqrt[3]{x + 1} + \sqrt[3]{x}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.7

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

Reproduce

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