Average Error: 29.9 → 15.7
Time: 42.6s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3786.7854807477515:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\ \mathbf{elif}\;x \le 4091.212332026581:\\ \;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right), \left(\sqrt[3]{\sqrt[3]{x + 1}}\right), \left(-\sqrt[3]{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\ \end{array}\]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
\mathbf{if}\;x \le -3786.7854807477515:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\

\mathbf{elif}\;x \le 4091.212332026581:\\
\;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right), \left(\sqrt[3]{\sqrt[3]{x + 1}}\right), \left(-\sqrt[3]{x}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\

\end{array}
double f(double x) {
        double r3586719 = x;
        double r3586720 = 1.0;
        double r3586721 = r3586719 + r3586720;
        double r3586722 = cbrt(r3586721);
        double r3586723 = cbrt(r3586719);
        double r3586724 = r3586722 - r3586723;
        return r3586724;
}

double f(double x) {
        double r3586725 = x;
        double r3586726 = -3786.7854807477515;
        bool r3586727 = r3586725 <= r3586726;
        double r3586728 = -0.1111111111111111;
        double r3586729 = 1.0;
        double r3586730 = 5.0;
        double r3586731 = pow(r3586725, r3586730);
        double r3586732 = r3586729 / r3586731;
        double r3586733 = cbrt(r3586732);
        double r3586734 = 0.3333333333333333;
        double r3586735 = r3586725 * r3586725;
        double r3586736 = r3586729 / r3586735;
        double r3586737 = cbrt(r3586736);
        double r3586738 = r3586735 * r3586735;
        double r3586739 = r3586738 * r3586738;
        double r3586740 = r3586729 / r3586739;
        double r3586741 = cbrt(r3586740);
        double r3586742 = 0.06172839506172839;
        double r3586743 = r3586741 * r3586742;
        double r3586744 = fma(r3586734, r3586737, r3586743);
        double r3586745 = fma(r3586728, r3586733, r3586744);
        double r3586746 = 4091.212332026581;
        bool r3586747 = r3586725 <= r3586746;
        double r3586748 = r3586725 + r3586729;
        double r3586749 = cbrt(r3586748);
        double r3586750 = r3586749 * r3586749;
        double r3586751 = cbrt(r3586750);
        double r3586752 = cbrt(r3586749);
        double r3586753 = cbrt(r3586725);
        double r3586754 = -r3586753;
        double r3586755 = fma(r3586751, r3586752, r3586754);
        double r3586756 = r3586747 ? r3586755 : r3586745;
        double r3586757 = r3586727 ? r3586745 : r3586756;
        return r3586757;
}

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -3786.7854807477515 or 4091.212332026581 < x

    1. Initial program 60.3

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt60.4

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

      \[\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. Using strategy rm
    6. Applied add-cube-cbrt60.5

      \[\leadsto \sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}}} - \sqrt[3]{x}\]
    7. Applied cbrt-prod60.5

      \[\leadsto \sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\color{blue}{\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}}} - \sqrt[3]{x}\]
    8. Applied cbrt-prod60.6

      \[\leadsto \sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \color{blue}{\left(\sqrt[3]{\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{x + 1}}}\right)} - \sqrt[3]{x}\]
    9. Taylor expanded around inf 38.9

      \[\leadsto \color{blue}{\left(\frac{1}{3} \cdot {\left(\frac{1}{{x}^{2}}\right)}^{\frac{1}{3}} + \frac{5}{81} \cdot {\left(\frac{1}{{x}^{8}}\right)}^{\frac{1}{3}}\right) - \frac{1}{9} \cdot {\left(\frac{1}{{x}^{5}}\right)}^{\frac{1}{3}}}\]
    10. Simplified31.5

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

    if -3786.7854807477515 < x < 4091.212332026581

    1. Initial program 0.1

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

      \[\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-prod0.1

      \[\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. Using strategy rm
    6. Applied fma-neg0.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right), \left(\sqrt[3]{\sqrt[3]{x + 1}}\right), \left(-\sqrt[3]{x}\right)\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification15.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3786.7854807477515:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\ \mathbf{elif}\;x \le 4091.212332026581:\\ \;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}}\right), \left(\sqrt[3]{\sqrt[3]{x + 1}}\right), \left(-\sqrt[3]{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-1}{9}, \left(\sqrt[3]{\frac{1}{{x}^{5}}}\right), \left(\mathsf{fma}\left(\frac{1}{3}, \left(\sqrt[3]{\frac{1}{x \cdot x}}\right), \left(\sqrt[3]{\frac{1}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)}} \cdot \frac{5}{81}\right)\right)\right)\right)\\ \end{array}\]

Reproduce

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