Average Error: 29.9 → 0.5
Time: 8.9s
Precision: binary64
Cost: 39168
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\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} \]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ 1.0 x))))
   (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (pow t_0 2.0)))))
double code(double x) {
	return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
	double t_0 = cbrt((1.0 + x));
	return 1.0 / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x)
	return Float64(cbrt(Float64(x + 1.0)) - cbrt(x))
end
function code(x)
	t_0 = cbrt(Float64(1.0 + x))
	return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), (t_0 ^ 2.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]}, N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\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}

Error

Derivation

  1. Initial program 29.9

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

    \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{0.3333333333333333}} \]
  3. Applied egg-rr46.7

    \[\leadsto \color{blue}{{\left(x + 1\right)}^{0.3333333333333333}} - {x}^{0.3333333333333333} \]
  4. Applied egg-rr29.8

    \[\leadsto \color{blue}{\left({\left(\sqrt[3]{x + 1}\right)}^{3} - {\left(\sqrt[3]{x}\right)}^{3}\right) \cdot \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\sqrt[3]{x} \cdot \sqrt[3]{x} + \sqrt[3]{x + 1} \cdot \sqrt[3]{x}\right)}} \]
  5. 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]29.8

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

    rem-cube-cbrt [=>]30.0

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

    +-commutative [=>]30.0

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

    rem-cube-cbrt [=>]29.3

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

    associate--l+ [=>]0.5

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

    +-inverses [=>]0.5

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

    metadata-eval [=>]0.5

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

    metadata-eval [<=]0.5

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

    +-inverses [<=]0.5

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

    associate--l+ [<=]29.3

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

    +-commutative [<=]29.3

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

    rem-cube-cbrt [<=]29.9

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

    rem-cube-cbrt [<=]29.8

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

    *-lft-identity [<=]29.8

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

    associate-/l* [=>]29.8

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

    associate-*r/ [=>]29.8

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

    metadata-eval [=>]29.8

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

    associate-/l* [<=]29.8

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

    *-commutative [<=]29.8

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

    *-rgt-identity [=>]29.8

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

    rem-cube-cbrt [=>]30.0

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

    +-commutative [=>]30.0

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

    rem-cube-cbrt [=>]29.3

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

    associate--l+ [=>]0.5

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

    +-inverses [=>]0.5

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

    metadata-eval [=>]0.5

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

    +-commutative [=>]0.5

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

    distribute-rgt-out [=>]0.5

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

    +-commutative [<=]0.5

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

    fma-def [=>]0.5

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

    +-commutative [=>]0.5

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

    unpow1 [<=]0.5

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

    pow-plus [=>]0.5

    \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{{\left(\sqrt[3]{x + 1}\right)}^{\left(1 + 1\right)}}\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)}^{\left(1 + 1\right)}\right)} \]

    metadata-eval [=>]0.5

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

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

Alternatives

Alternative 1
Error0.5
Cost33280
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1 + \left(x - x\right)}{{t_0}^{2} + \frac{\sqrt[3]{x}}{\frac{1}{\sqrt[3]{x} + t_0}}} \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(\sqrt[3]{x} + t_0\right)} \end{array} \]
Alternative 3
Error7.2
Cost27336
\[\begin{array}{l} t_0 := 1 + \left(x - x\right)\\ t_1 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\ t_2 := \sqrt[3]{x} \cdot t_1\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{1 + t_2}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{\frac{\sqrt[3]{x}}{\frac{1}{t_1}} + \sqrt[3]{\left(1 + x\right) \cdot \left(1 + x\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_2 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 4
Error7.2
Cost27208
\[\begin{array}{l} t_0 := 1 + \left(x - x\right)\\ t_1 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{1 + t_1}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{t_1 + \sqrt[3]{\left(1 + x\right) \cdot \left(1 + x\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_1 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 5
Error13.8
Cost26884
\[\begin{array}{l} t_0 := 1 + \left(x - x\right)\\ t_1 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{t_0}{1 + t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_1 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 6
Error26.2
Cost26624
\[\frac{1 + \left(x - x\right)}{{\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(1 + \sqrt[3]{x}\right)} \]
Alternative 7
Error26.4
Cost20160
\[\frac{1 + \left(x - x\right)}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)} \]
Alternative 8
Error29.9
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 9
Error31.6
Cost6592
\[1 - \sqrt[3]{x} \]
Alternative 10
Error61.7
Cost64
\[0 \]
Alternative 11
Error32.1
Cost64
\[1 \]

Error

Reproduce

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