?

Average Error: 29.5 → 0.3
Time: 8.9s
Precision: binary64
Cost: 52928

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 29.5

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

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

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

    [Start]28.9

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

    associate-*r/ [=>]28.9

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

    *-rgt-identity [=>]28.9

    \[ \frac{\color{blue}{\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)} \]

    +-commutative [=>]28.9

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

    associate--l+ [=>]0.5

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

    +-inverses [=>]0.5

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

    metadata-eval [=>]0.5

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

    +-commutative [=>]0.5

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

    fma-def [=>]0.5

    \[ \frac{1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]

    +-commutative [=>]0.5

    \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{\color{blue}{1 + x}} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)} \]

    +-commutative [=>]0.5

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

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

    \[\leadsto \frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + \color{blue}{e^{\log \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right) + \mathsf{log1p}\left(x\right) \cdot 0.3333333333333333}}} \]
  6. Applied egg-rr0.3

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

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

Alternatives

Alternative 1
Error24.8
Cost39364
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\ \end{array} \]
Alternative 2
Error0.5
Cost39168
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)} \end{array} \]
Alternative 3
Error8.4
Cost32964
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ \mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x} \cdot t_1 + e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}}\\ \end{array} \]
Alternative 4
Error8.4
Cost32900
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ \mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 5
Error0.5
Cost32896
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(\sqrt[3]{x} + t_0\right)} \end{array} \]
Alternative 6
Error14.7
Cost26892
\[\begin{array}{l} t_0 := \frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + \left(\sqrt[3]{x \cdot x} + \sqrt[3]{x + x \cdot x}\right)}\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 16500000:\\ \;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(-\sqrt[3]{x}\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, 1\right)}\\ \end{array} \]
Alternative 7
Error14.3
Cost26692
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ \mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, 1\right)}\\ \end{array} \]
Alternative 8
Error25.5
Cost13449
\[\begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+15} \lor \neg \left(x \leq 3.25 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{1}{1 + {\left(\sqrt[3]{x}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\ \end{array} \]
Alternative 9
Error29.5
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 10
Error31.1
Cost6848
\[1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right) \]
Alternative 11
Error31.2
Cost6592
\[1 - \sqrt[3]{x} \]
Alternative 12
Error61.7
Cost64
\[0 \]
Alternative 13
Error31.7
Cost64
\[1 \]

Error

Reproduce?

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