Average Error: 29.5 → 0.6
Time: 8.3s
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 -3.882616260321554 \cdot 10^{+157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.0630326178587311 \cdot 10^{+153}:\\ \;\;\;\;\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 -3.882616260321554e+157)
     t_1
     (if (<= x 1.0630326178587311e+153)
       (/ 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 <= -3.882616260321554e+157) {
		tmp = t_1;
	} else if (x <= 1.0630326178587311e+153) {
		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 <= -3.882616260321554e+157) {
		tmp = t_1;
	} else if (x <= 1.0630326178587311e+153) {
		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 <= -3.882616260321554e+157)
		tmp = t_1;
	elseif (x <= 1.0630326178587311e+153)
		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, -3.882616260321554e+157], t$95$1, If[LessEqual[x, 1.0630326178587311e+153], 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 -3.882616260321554 \cdot 10^{+157}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.0630326178587311 \cdot 10^{+153}:\\
\;\;\;\;\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 < -3.88261626032155428e157 or 1.0630326178587311e153 < 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 33.4

      \[\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)): 128 points increase in error, 128 points decrease in error

    if -3.88261626032155428e157 < x < 1.0630326178587311e153

    1. Initial program 19.3

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.882616260321554 \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 1.0630326178587311 \cdot 10^{+153}:\\ \;\;\;\;\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
Error0.9
Cost33032
\[\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 -42991886946440:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 144435.38971176354:\\ \;\;\;\;t_0 - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
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 3
Error25.9
Cost26368
\[\frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(1 + \sqrt[3]{x}\right)} \]
Alternative 4
Error29.5
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 5
Error31.2
Cost6592
\[1 - \sqrt[3]{x} \]
Alternative 6
Error31.8
Cost64
\[1 \]

Error

Reproduce

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