?

Average Error: 46.23% → 0.86%
Time: 9.2s
Precision: binary64
Cost: 52032

?

\[\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, {\left(\sqrt[3]{{t_0}^{3}}\right)}^{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 (cbrt (pow t_0 3.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(cbrt(pow(t_0, 3.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), (cbrt((t_0 ^ 3.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[N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], 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, {\left(\sqrt[3]{{t_0}^{3}}\right)}^{2}\right)}
\end{array}

Error?

Derivation?

  1. Initial program 46.23

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Applied egg-rr45.18

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

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

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

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

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

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

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

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

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

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

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

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

    \[ \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-rr26.72

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\color{blue}{\left(e^{\mathsf{log1p}\left(x\right) \cdot 0.3333333333333333}\right)}}^{2}\right)} \]
  5. Simplified26.49

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

    [Start]26.72

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

    exp-prod [=>]26.66

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

    unpow1/3 [=>]26.49

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

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

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

Alternatives

Alternative 1
Error0.83%
Cost45956
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(\sqrt[3]{x} + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x \cdot x} + \frac{t_0}{\frac{1}{\sqrt[3]{x} + t_0}}}\\ \end{array} \]
Alternative 2
Error38.8%
Cost39556
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(1 + \sqrt[3]{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error0.82%
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 4
Error0.83%
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 5
Error11.53%
Cost26952
\[\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}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(1 + \sqrt[3]{x}\right)}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{\sqrt[3]{x \cdot x} + \frac{t_0}{\frac{1}{t_1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + {x}^{0.6666666666666666}}\\ \end{array} \]
Alternative 6
Error11.52%
Cost26824
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 \cdot \left(\sqrt[3]{x} + t_0\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(1 + \sqrt[3]{x}\right)}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_1 + {x}^{0.6666666666666666}}\\ \end{array} \]
Alternative 7
Error21.32%
Cost26760
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_0 \cdot \left(1 + \sqrt[3]{x}\right)}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-6}:\\ \;\;\;\;{\left({\left(t_0 - \sqrt[3]{x}\right)}^{3}\right)}^{0.3333333333333333}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot \left(\sqrt[3]{x} + t_0\right) + {x}^{0.6666666666666666}}\\ \end{array} \]
Alternative 8
Error39.86%
Cost26372
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\frac{1}{1 + {\left(\sqrt[3]{x}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error43.14%
Cost26308
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error39.87%
Cost19912
\[\begin{array}{l} \mathbf{if}\;x \leq -1.82 \cdot 10^{+15}:\\ \;\;\;\;\frac{1}{1 + {\left(\sqrt[3]{x}\right)}^{2}}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+15}:\\ \;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, 1\right)}\\ \end{array} \]
Alternative 11
Error47.2%
Cost6848
\[\frac{1}{1 + \sqrt[3]{x \cdot x}} \]
Alternative 12
Error96.36%
Cost64
\[0 \]
Alternative 13
Error49.63%
Cost64
\[1 \]

Error

Reproduce?

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