?

Average Error: 30.4 → 30.4
Time: 9.4s
Precision: binary64
Cost: 33092

?

\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_0 \ne 0:\\ \;\;\;\;\frac{t_0 \cdot t_1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ x 1.0))) (t_1 (- t_0 (cbrt x))))
   (if (!= t_0 0.0) (/ (* t_0 t_1) t_0) t_1)))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt((x + 1.0));
	double t_1 = t_0 - cbrt(x);
	double tmp;
	if (t_0 != 0.0) {
		tmp = (t_0 * t_1) / t_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((x + 1.0));
	double t_1 = t_0 - Math.cbrt(x);
	double tmp;
	if (t_0 != 0.0) {
		tmp = (t_0 * t_1) / t_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(x + 1.0))
	t_1 = Float64(t_0 - cbrt(x))
	tmp = 0.0
	if (t_0 != 0.0)
		tmp = Float64(Float64(t_0 * t_1) / t_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[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[Unequal[t$95$0, 0.0], N[(N[(t$95$0 * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \ne 0:\\
\;\;\;\;\frac{t_0 \cdot t_1}{t_0}\\

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


\end{array}

Error?

Derivation?

  1. Initial program 30.4

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

    \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;\sqrt[3]{x + 1} \ne 0:\\ \;\;\;\;\frac{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}{\sqrt[3]{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{x + 1} - \sqrt[3]{x}\\ } \end{array}} \]
  3. Final simplification30.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt[3]{x + 1} \ne 0:\\ \;\;\;\;\frac{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x + 1} - \sqrt[3]{x}\right)}{\sqrt[3]{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{x + 1} - \sqrt[3]{x}\\ \end{array} \]

Alternatives

Alternative 1
Error30.4
Cost13120
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
Alternative 2
Error61.7
Cost64
\[0 \]
Alternative 3
Error32.5
Cost64
\[1 \]

Error

Reproduce?

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