Average Error: 29.6 → 0.5
Time: 8.2s
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.6

    \[\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]{x + 1} + \sqrt[3]{x}, {\left(\sqrt[3]{x + 1}\right)}^{2}\right)}} \]
    Proof
    (/.f64 1 (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (Rewrite<= metadata-eval (+.f64 1 0)) (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (+.f64 1 (Rewrite<= +-inverses_binary64 (-.f64 x x))) (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 1 x) x)) (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 118 points increase in error, 0 points decrease in error
    (/.f64 (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 x 1)) x) (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (-.f64 (+.f64 x 1) x) 1)) (fma.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (*.f64 (-.f64 (+.f64 x 1) x) 1) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))) (pow.f64 (cbrt.f64 (+.f64 x 1)) 2)))): 0 points increase in error, 0 points decrease in error
    (/.f64 (*.f64 (-.f64 (+.f64 x 1) x) 1) (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 (cbrt.f64 (+.f64 x 1)) 2) (*.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)))))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-*r/_binary64 (*.f64 (-.f64 (+.f64 x 1) x) (/.f64 1 (+.f64 (pow.f64 (cbrt.f64 (+.f64 x 1)) 2) (*.f64 (cbrt.f64 x) (+.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x))))))): 0 points increase in error, 1 points decrease in error
  4. 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
Error8.4
Cost39300
\[\begin{array}{l} t_0 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}\\ \end{array} \]
Alternative 2
Error15.4
Cost39236
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ \mathbf{if}\;x \leq -2:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{{t_0}^{2} + \sqrt[3]{x} \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}\right)}\\ \end{array} \]
Alternative 3
Error15.5
Cost33284
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} + t_0\\ \mathbf{if}\;x \leq -2:\\ \;\;\;\;\frac{\left(1 + x\right) - x}{{t_0}^{2} + \sqrt[3]{x} \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 4
Error15.7
Cost32900
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq 0.01:\\ \;\;\;\;e^{\log \left(t_0 - \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 5
Error29.6
Cost25920
\[e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)} \]
Alternative 6
Error32.9
Cost13120
\[\sqrt[3]{x} + \sqrt[3]{1 + x} \]
Alternative 7
Error29.6
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]

Error

Reproduce

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