?

Average Error: 30.0 → 0.3
Time: 9.1s
Precision: binary64
Cost: 52928

?

\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := {t_0}^{2}\\ \frac{1}{t_1 + \sqrt[3]{x} \cdot \frac{x + \left(1 + x\right)}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - t_0\right)}} \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 (pow t_0 2.0)))
   (/
    1.0
    (+
     t_1
     (* (cbrt x) (/ (+ x (+ 1.0 x)) (+ t_1 (* (cbrt x) (- (cbrt x) t_0)))))))))
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 = pow(t_0, 2.0);
	return 1.0 / (t_1 + (cbrt(x) * ((x + (1.0 + x)) / (t_1 + (cbrt(x) * (cbrt(x) - t_0))))));
}
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 = Math.pow(t_0, 2.0);
	return 1.0 / (t_1 + (Math.cbrt(x) * ((x + (1.0 + x)) / (t_1 + (Math.cbrt(x) * (Math.cbrt(x) - t_0))))));
}
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 = t_0 ^ 2.0
	return Float64(1.0 / Float64(t_1 + Float64(cbrt(x) * Float64(Float64(x + Float64(1.0 + x)) / Float64(t_1 + Float64(cbrt(x) * Float64(cbrt(x) - t_0)))))))
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[Power[t$95$0, 2.0], $MachinePrecision]}, N[(1.0 / N[(t$95$1 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[(x + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := {t_0}^{2}\\
\frac{1}{t_1 + \sqrt[3]{x} \cdot \frac{x + \left(1 + x\right)}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - t_0\right)}}
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 30.0

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Applied egg-rr29.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.5

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

    \[\leadsto \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\frac{x + \left(x + 1\right)}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{x + 1}\right)}{\sqrt[3]{x}}}}} \]
  5. Simplified0.3

    \[\leadsto \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\frac{x + \left(1 + x\right)}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{1 + x}\right)} \cdot \sqrt[3]{x}}} \]
    Proof

    [Start]0.3

    \[ \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \frac{x + \left(x + 1\right)}{\frac{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{x + 1}\right)}{\sqrt[3]{x}}}} \]

    associate-/r/ [=>]0.3

    \[ \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \color{blue}{\frac{x + \left(x + 1\right)}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{x + 1}\right)} \cdot \sqrt[3]{x}}} \]

    +-commutative [=>]0.3

    \[ \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \frac{x + \color{blue}{\left(1 + x\right)}}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{x + 1}\right)} \cdot \sqrt[3]{x}} \]

    +-commutative [=>]0.3

    \[ \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \frac{x + \left(1 + x\right)}{{\left(\sqrt[3]{\color{blue}{1 + x}}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{x + 1}\right)} \cdot \sqrt[3]{x}} \]

    +-commutative [=>]0.3

    \[ \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \frac{x + \left(1 + x\right)}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{\color{blue}{1 + x}}\right)} \cdot \sqrt[3]{x}} \]
  6. Final simplification0.3

    \[\leadsto \frac{1}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \frac{x + \left(1 + x\right)}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} - \sqrt[3]{1 + x}\right)}} \]

Alternatives

Alternative 1
Error0.5
Cost39168
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0 + \sqrt[3]{x}, {t_0}^{2}\right)} \end{array} \]
Alternative 2
Error25.2
Cost39108
\[\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}:\\ \;\;\;\;e^{\log t_1}\\ \end{array} \]
Alternative 3
Error7.2
Cost33096
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_1}\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_1 + e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}}\\ \end{array} \]
Alternative 4
Error25.2
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 5
Error7.2
Cost33032
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 + \sqrt[3]{x}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot t_1}\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 6
Error0.5
Cost33024
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{t_0}^{2} + \frac{\sqrt[3]{x}}{\frac{1}{t_0 + \sqrt[3]{x}}}} \end{array} \]
Alternative 7
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 8
Error12.6
Cost26889
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154} \lor \neg \left(x \leq 1.32 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \end{array} \]
Alternative 9
Error30.0
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 10
Error61.7
Cost64
\[0 \]
Alternative 11
Error32.3
Cost64
\[1 \]

Error

Reproduce?

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