Average Error: 29.9 → 0.7
Time: 8.9s
Precision: binary64
Cost: 33160
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \mathbf{if}\;x \leq -1.9801969054324128 \cdot 10^{+157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.226820418126073 \cdot 10^{+146}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right) + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x)))
        (t_1 (/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ (cbrt x) (cbrt x)))))))
   (if (<= x -1.9801969054324128e+157)
     t_1
     (if (<= x 2.226820418126073e+146)
       (/ 1.0 (+ (* (cbrt x) (+ t_0 (cbrt x))) (cbrt (pow (+ 1.0 x) 2.0))))
       t_1))))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	double t_1 = 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (cbrt(x) + cbrt(x))));
	double tmp;
	if (x <= -1.9801969054324128e+157) {
		tmp = t_1;
	} else if (x <= 2.226820418126073e+146) {
		tmp = 1.0 / ((cbrt(x) * (t_0 + cbrt(x))) + cbrt(pow((1.0 + x), 2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x) {
	return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
public static double code(double x) {
	double t_0 = Math.cbrt((1.0 + x));
	double t_1 = 1.0 / (Math.pow(t_0, 2.0) + (Math.cbrt(x) * (Math.cbrt(x) + Math.cbrt(x))));
	double tmp;
	if (x <= -1.9801969054324128e+157) {
		tmp = t_1;
	} else if (x <= 2.226820418126073e+146) {
		tmp = 1.0 / ((Math.cbrt(x) * (t_0 + Math.cbrt(x))) + Math.cbrt(Math.pow((1.0 + x), 2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x)
	return Float64(cbrt(Float64(x + 1.0)) - cbrt(x))
end
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	t_1 = Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(cbrt(x) + cbrt(x)))))
	tmp = 0.0
	if (x <= -1.9801969054324128e+157)
		tmp = t_1;
	elseif (x <= 2.226820418126073e+146)
		tmp = Float64(1.0 / Float64(Float64(cbrt(x) * Float64(t_0 + cbrt(x))) + cbrt((Float64(1.0 + x) ^ 2.0))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9801969054324128e+157], t$95$1, If[LessEqual[x, 2.226820418126073e+146], N[(1.0 / N[(N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := \frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\
\mathbf{if}\;x \leq -1.9801969054324128 \cdot 10^{+157}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.226820418126073 \cdot 10^{+146}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right) + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -1.9801969054324128e157 or 2.226820418126073e146 < x

    1. Initial program 61.0

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr61.0

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    3. Taylor expanded in x around 0 1.0

      \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    4. Applied egg-rr1.1

      \[\leadsto \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\color{blue}{{\left(\sqrt[3]{\sqrt[3]{x + 1}}\right)}^{3}} + \sqrt[3]{x}\right)} \]
    5. Taylor expanded in x around inf 34.0

      \[\leadsto \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\color{blue}{{x}^{0.3333333333333333}} + \sqrt[3]{x}\right)} \]
    6. Simplified1.0

      \[\leadsto \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\color{blue}{\sqrt[3]{x}} + \sqrt[3]{x}\right)} \]
      Proof
      (cbrt.f64 x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unpow1/3_binary64 (pow.f64 x 1/3)): 122 points increase in error, 132 points decrease in error

    if -1.9801969054324128e157 < x < 2.226820418126073e146

    1. Initial program 19.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
    2. Applied egg-rr18.3

      \[\leadsto \color{blue}{\frac{\left(x + 1\right) - x}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)}} \]
    3. Taylor expanded in x around 0 0.4

      \[\leadsto \frac{\color{blue}{1}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    4. Applied egg-rr0.4

      \[\leadsto \frac{1}{\color{blue}{\sqrt{{\left(\sqrt[3]{x + 1}\right)}^{4}}} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)} \]
    5. Applied egg-rr0.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9801969054324128 \cdot 10^{+157}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \mathbf{elif}\;x \leq 2.226820418126073 \cdot 10^{+146}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error1.1
Cost45956
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right) + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 2
Error25.1
Cost39236
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left({t_1}^{3}\right)}^{0.3333333333333333}\\ \end{array} \]
Alternative 3
Error25.1
Cost33092
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error0.5
Cost32896
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)} \end{array} \]
Alternative 5
Error14.2
Cost26628
\[\begin{array}{l} t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\\ \mathbf{if}\;x \leq -4279664386679.3286:\\ \;\;\;\;\frac{1}{1 + t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 6
Error26.1
Cost26368
\[\frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(1 + \sqrt[3]{x}\right)} \]
Alternative 7
Error29.9
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 8
Error61.7
Cost64
\[0 \]
Alternative 9
Error31.9
Cost64
\[1 \]

Error

Reproduce

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