Average Error: 30.5 → 9.2
Time: 3.6s
Precision: binary64
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} \mathbf{if}\;x \leq -1.014706802981836:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, \sqrt[3]{\frac{1}{x \cdot x}}, \mathsf{fma}\left(0.06172839506172839, \sqrt[3]{\frac{1}{{x}^{8}}}, \sqrt[3]{\frac{1}{{x}^{5}}} \cdot -0.1111111111111111\right)\right)\\ \mathbf{elif}\;x \leq 0.00018538955778266687:\\ \;\;\;\;\mathsf{fma}\left(0.06172839506172839, {x}^{3}, \mathsf{fma}\left(x, 0.3333333333333333, 1\right)\right) - \mathsf{fma}\left(0.1111111111111111, x \cdot x, \sqrt[3]{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ \frac{1}{{x}^{0.6666666666666666} + t_0 \cdot \left(\sqrt[3]{x} + t_0\right)} \end{array}\\ \end{array} \]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \leq -1.014706802981836:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \sqrt[3]{\frac{1}{x \cdot x}}, \mathsf{fma}\left(0.06172839506172839, \sqrt[3]{\frac{1}{{x}^{8}}}, \sqrt[3]{\frac{1}{{x}^{5}}} \cdot -0.1111111111111111\right)\right)\\

\mathbf{elif}\;x \leq 0.00018538955778266687:\\
\;\;\;\;\mathsf{fma}\left(0.06172839506172839, {x}^{3}, \mathsf{fma}\left(x, 0.3333333333333333, 1\right)\right) - \mathsf{fma}\left(0.1111111111111111, x \cdot x, \sqrt[3]{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{1}{{x}^{0.6666666666666666} + t_0 \cdot \left(\sqrt[3]{x} + t_0\right)}
\end{array}\\


\end{array}
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (if (<= x -1.014706802981836)
   (fma
    0.3333333333333333
    (cbrt (/ 1.0 (* x x)))
    (fma
     0.06172839506172839
     (cbrt (/ 1.0 (pow x 8.0)))
     (* (cbrt (/ 1.0 (pow x 5.0))) -0.1111111111111111)))
   (if (<= x 0.00018538955778266687)
     (-
      (fma 0.06172839506172839 (pow x 3.0) (fma x 0.3333333333333333 1.0))
      (fma 0.1111111111111111 (* x x) (cbrt x)))
     (let* ((t_0 (cbrt (+ x 1.0))))
       (/ 1.0 (+ (pow x 0.6666666666666666) (* t_0 (+ (cbrt x) t_0))))))))
double code(double x) {
	return cbrt(x + 1.0) - cbrt(x);
}
double code(double x) {
	double tmp;
	if (x <= -1.014706802981836) {
		tmp = fma(0.3333333333333333, cbrt(1.0 / (x * x)), fma(0.06172839506172839, cbrt(1.0 / pow(x, 8.0)), (cbrt(1.0 / pow(x, 5.0)) * -0.1111111111111111)));
	} else if (x <= 0.00018538955778266687) {
		tmp = fma(0.06172839506172839, pow(x, 3.0), fma(x, 0.3333333333333333, 1.0)) - fma(0.1111111111111111, (x * x), cbrt(x));
	} else {
		double t_0 = cbrt(x + 1.0);
		tmp = 1.0 / (pow(x, 0.6666666666666666) + (t_0 * (cbrt(x) + t_0)));
	}
	return tmp;
}

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if x < -1.014706802981836

    1. Initial program 59.8

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

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} - \sqrt[3]{x} \]
    4. Applied sqrt-unprod_binary6460.6

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} - \sqrt[3]{x} \]
    5. Simplified60.6

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

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333} + 0.06172839506172839 \cdot {\left(\frac{1}{{x}^{8}}\right)}^{0.3333333333333333}\right) - 0.1111111111111111 \cdot {\left(\frac{1}{{x}^{5}}\right)}^{0.3333333333333333}} \]
    7. Simplified32.2

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

    if -1.014706802981836 < x < 1.85389557782666866e-4

    1. Initial program 0.0

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

      \[\leadsto \color{blue}{\left(1 + \left(0.3333333333333333 \cdot x + 0.06172839506172839 \cdot {x}^{3}\right)\right) - \left({x}^{0.3333333333333333} + 0.1111111111111111 \cdot {x}^{2}\right)} \]
    3. Simplified0.2

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

    if 1.85389557782666866e-4 < x

    1. Initial program 59.0

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

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

      \[\leadsto \frac{1}{\color{blue}{{x}^{0.6666666666666666} + \sqrt[3]{1 + x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.014706802981836:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, \sqrt[3]{\frac{1}{x \cdot x}}, \mathsf{fma}\left(0.06172839506172839, \sqrt[3]{\frac{1}{{x}^{8}}}, \sqrt[3]{\frac{1}{{x}^{5}}} \cdot -0.1111111111111111\right)\right)\\ \mathbf{elif}\;x \leq 0.00018538955778266687:\\ \;\;\;\;\mathsf{fma}\left(0.06172839506172839, {x}^{3}, \mathsf{fma}\left(x, 0.3333333333333333, 1\right)\right) - \mathsf{fma}\left(0.1111111111111111, x \cdot x, \sqrt[3]{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{0.6666666666666666} + \sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)}\\ \end{array} \]

Reproduce

herbie shell --seed 2021211 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1.0)) (cbrt x)))