Average Error: 30.0 → 12.0
Time: 6.5s
Precision: 64
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.4690392002297262 \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 3520.50261299902513:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \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)\\ \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.4690392002297262 \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 3520.50261299902513:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \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)\\

\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 f(double x) {
        double r73046 = x;
        double r73047 = 1.0;
        double r73048 = r73046 + r73047;
        double r73049 = cbrt(r73048);
        double r73050 = cbrt(r73046);
        double r73051 = r73049 - r73050;
        return r73051;
}

double f(double x) {
        double r73052 = x;
        double r73053 = -4.469039200229726e+61;
        bool r73054 = r73052 <= r73053;
        double r73055 = 1.0;
        double r73056 = 2.0;
        double r73057 = pow(r73052, r73056);
        double r73058 = r73055 / r73057;
        double r73059 = 0.3333333333333333;
        double r73060 = pow(r73058, r73059);
        double r73061 = 0.3333333333333333;
        double r73062 = 0.06172839506172839;
        double r73063 = 8.0;
        double r73064 = pow(r73052, r73063);
        double r73065 = r73055 / r73064;
        double r73066 = pow(r73065, r73059);
        double r73067 = r73062 * r73066;
        double r73068 = 0.1111111111111111;
        double r73069 = 5.0;
        double r73070 = pow(r73052, r73069);
        double r73071 = r73055 / r73070;
        double r73072 = pow(r73071, r73059);
        double r73073 = r73068 * r73072;
        double r73074 = r73067 - r73073;
        double r73075 = fma(r73060, r73061, r73074);
        double r73076 = 3520.502612999025;
        bool r73077 = r73052 <= r73076;
        double r73078 = 1.0;
        double r73079 = r73052 + r73078;
        double r73080 = cbrt(r73079);
        double r73081 = 3.0;
        double r73082 = pow(r73052, r73081);
        double r73083 = pow(r73078, r73081);
        double r73084 = r73082 + r73083;
        double r73085 = cbrt(r73084);
        double r73086 = r73052 * r73052;
        double r73087 = r73078 * r73078;
        double r73088 = r73052 * r73078;
        double r73089 = r73087 - r73088;
        double r73090 = r73086 + r73089;
        double r73091 = cbrt(r73090);
        double r73092 = r73085 / r73091;
        double r73093 = r73080 * r73092;
        double r73094 = cbrt(r73093);
        double r73095 = cbrt(r73080);
        double r73096 = cbrt(r73052);
        double r73097 = -r73096;
        double r73098 = fma(r73094, r73095, r73097);
        double r73099 = 7.0;
        double r73100 = pow(r73052, r73099);
        double r73101 = r73055 / r73100;
        double r73102 = pow(r73101, r73059);
        double r73103 = 0.04938271604938271;
        double r73104 = 0.6666666666666666;
        double r73105 = r73055 / r73052;
        double r73106 = pow(r73105, r73059);
        double r73107 = r73104 * r73106;
        double r73108 = 4.0;
        double r73109 = pow(r73052, r73108);
        double r73110 = r73055 / r73109;
        double r73111 = pow(r73110, r73059);
        double r73112 = r73068 * r73111;
        double r73113 = r73107 - r73112;
        double r73114 = fma(r73102, r73103, r73113);
        double r73115 = r73080 + r73096;
        double r73116 = r73114 / r73115;
        double r73117 = r73077 ? r73098 : r73116;
        double r73118 = r73054 ? r73075 : r73117;
        return r73118;
}

Error

Bits error versus x

Derivation

  1. Split input into 3 regimes
  2. if x < -4.469039200229726e+61

    1. Initial program 61.2

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

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

      \[\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.469039200229726e+61 < x < 3520.502612999025

    1. Initial program 5.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt5.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-prod5.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. Applied fma-neg5.1

      \[\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-+5.1

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

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

    if 3520.502612999025 < x

    1. Initial program 60.0

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

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

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

      \[\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 simplification12.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.4690392002297262 \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 3520.50261299902513:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\sqrt[3]{x + 1} \cdot \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)\\ \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 2020064 +o rules:numerics
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  :precision binary64
  (- (cbrt (+ x 1)) (cbrt x)))