?

Average Error: 1.8 → 0.1
Time: 10.4s
Precision: binary64
Cost: 85248

?

\[0 \leq x \land x \leq 10^{+18}\]
\[{\left(x + 1\right)}^{\left(\frac{1}{3}\right)} - {x}^{\left(\frac{1}{3}\right)} \]
\[\begin{array}{l} t_0 := \sqrt[3]{x + 1}\\ \frac{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x}, t_0 \cdot \left(\sqrt[3]{x} - t_0\right)\right)}{\left(x + t_0 \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right) \cdot \left(\sqrt[3]{x} + t_0\right) - {t_0}^{4}} \end{array} \]
(FPCore (x)
 :precision binary64
 (- (pow (+ x 1.0) (/ 1.0 3.0)) (pow x (/ 1.0 3.0))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (cbrt (+ x 1.0))))
   (/
    (fma (cbrt x) (cbrt x) (* t_0 (- (cbrt x) t_0)))
    (-
     (* (+ x (* t_0 (* (cbrt x) (cbrt x)))) (+ (cbrt x) t_0))
     (pow t_0 4.0)))))
double code(double x) {
	return pow((x + 1.0), (1.0 / 3.0)) - pow(x, (1.0 / 3.0));
}
double code(double x) {
	double t_0 = cbrt((x + 1.0));
	return fma(cbrt(x), cbrt(x), (t_0 * (cbrt(x) - t_0))) / (((x + (t_0 * (cbrt(x) * cbrt(x)))) * (cbrt(x) + t_0)) - pow(t_0, 4.0));
}
function code(x)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / 3.0)) - (x ^ Float64(1.0 / 3.0)))
end
function code(x)
	t_0 = cbrt(Float64(x + 1.0))
	return Float64(fma(cbrt(x), cbrt(x), Float64(t_0 * Float64(cbrt(x) - t_0))) / Float64(Float64(Float64(x + Float64(t_0 * Float64(cbrt(x) * cbrt(x)))) * Float64(cbrt(x) + t_0)) - (t_0 ^ 4.0)))
end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / 3.0), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / 3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision] + N[(t$95$0 * N[(N[Power[x, 1/3], $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(x + N[(t$95$0 * N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] - N[Power[t$95$0, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
{\left(x + 1\right)}^{\left(\frac{1}{3}\right)} - {x}^{\left(\frac{1}{3}\right)}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x}, t_0 \cdot \left(\sqrt[3]{x} - t_0\right)\right)}{\left(x + t_0 \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right) \cdot \left(\sqrt[3]{x} + t_0\right) - {t_0}^{4}}
\end{array}

Error?

Derivation?

  1. Initial program 1.8

    \[{\left(x + 1\right)}^{\left(\frac{1}{3}\right)} - {x}^{\left(\frac{1}{3}\right)} \]
  2. Simplified1.9

    \[\leadsto \color{blue}{\sqrt[3]{x + 1} - \sqrt[3]{x}} \]
    Proof

    [Start]1.8

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

    metadata-eval [=>]1.8

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

    unpow1/3 [=>]1.9

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

    metadata-eval [=>]1.9

    \[ \sqrt[3]{x + 1} - {x}^{\color{blue}{0.3333333333333333}} \]

    unpow1/3 [=>]1.9

    \[ \sqrt[3]{x + 1} - \color{blue}{\sqrt[3]{x}} \]
  3. Applied egg-rr0.6

    \[\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)}} \]
  4. Simplified0.2

    \[\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]0.6

    \[ \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/ [=>]0.6

    \[ \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 [=>]0.6

    \[ \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 [=>]0.6

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

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

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

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

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

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

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

    \[ \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)} \]
  5. Applied egg-rr0.1

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

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

    [Start]0.1

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

    associate-*l/ [=>]0.1

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

    *-lft-identity [=>]0.1

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

    distribute-lft-in [=>]0.1

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

    associate--l+ [=>]0.1

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

    fma-def [=>]0.1

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

    unpow2 [=>]0.1

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

    distribute-rgt-out-- [=>]0.1

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

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

Alternatives

Alternative 1
Error0.1
Cost39168
\[\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x + 1}, \sqrt[3]{{\left(x + 1\right)}^{2}}\right)} \]
Alternative 2
Error0.2
Cost39104
\[\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x + 1}, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)} \]
Alternative 3
Error0.6
Cost33088
\[\frac{x + \left(1 - x\right)}{e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{x + 1}\right)} \]
Alternative 4
Error1.8
Cost13248
\[{\left(x + 1\right)}^{0.3333333333333333} - {x}^{0.3333333333333333} \]
Alternative 5
Error1.9
Cost13184
\[\sqrt[3]{x + 1} - {x}^{0.3333333333333333} \]
Alternative 6
Error1.9
Cost13120
\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
Alternative 7
Error6.9
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 1 
(FPCore (x)
  :name "pow(x+1, 1/3) - pow(x, 1/3)"
  :precision binary64
  :pre (and (<= 0.0 x) (<= x 1e+18))
  (- (pow (+ x 1.0) (/ 1.0 3.0)) (pow x (/ 1.0 3.0))))