?

Average Accuracy: 53.8% → 99.2%
Time: 9.5s
Precision: binary64
Cost: 39424.00

?

\[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0 + \left(1 + \left(\sqrt[3]{x} + -1\right)\right), {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) (+ t_0 (+ 1.0 (+ (cbrt x) -1.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), (t_0 + (1.0 + (cbrt(x) + -1.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(t_0 + Float64(1.0 + Float64(cbrt(x) + -1.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[(t$95$0 + N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $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}, t_0 + \left(1 + \left(\sqrt[3]{x} + -1\right)\right), {t_0}^{2}\right)}
\end{array}

Error?

Derivation?

  1. Initial program 53.8%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Applied egg-rr54.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. Simplified99.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]54.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/ [=>]54.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 [=>]54.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 [=>]54.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+ [=>]99.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 [=>]99.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 [=>]99.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 [=>]99.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 [=>]99.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 [=>]99.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 [=>]99.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)} \]
  4. Applied egg-rr48.5%

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

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

    [Start]48.5

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

    unpow1/3 [=>]48.9

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

    unpow1/3 [=>]49.5

    \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{\sqrt{x}} \cdot \color{blue}{\sqrt[3]{\sqrt{x}}}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  6. Applied egg-rr99.2%

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

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

    [Start]99.2

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

    associate--l+ [=>]99.2

    \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \color{blue}{\left(1 + \left(\sqrt[3]{x} - 1\right)\right)}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]
  8. Final simplification99.2%

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

Alternatives

Alternative 1
Accuracy99.2%
Cost39168.00
\[\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 2
Accuracy88.7%
Cost33096.00
\[\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}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, 1\right)}\\ \mathbf{elif}\;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 3
Accuracy88.7%
Cost33032.00
\[\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}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, 1\right)}\\ \mathbf{elif}\;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 4
Accuracy99.1%
Cost32896.00
\[\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
Accuracy80.3%
Cost26825.00
\[\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} \lor \neg \left(x \leq 1.35 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_1 + \sqrt[3]{x \cdot x}}\\ \end{array} \]
Alternative 6
Accuracy59.1%
Cost26368.00
\[\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + \sqrt[3]{1 + x} \cdot \left(1 + \sqrt[3]{x}\right)} \]
Alternative 7
Accuracy59.1%
Cost26176.00
\[\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{1 + x}, 1\right)} \]
Alternative 8
Accuracy58.0%
Cost19648.00
\[\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, 1\right)} \]
Alternative 9
Accuracy60.1%
Cost13449.00
\[\begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+15} \lor \neg \left(x \leq 2.3 \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 10
Accuracy53.8%
Cost13120.00
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 11
Accuracy51.0%
Cost6592.00
\[1 - \sqrt[3]{x} \]
Alternative 12
Accuracy3.6%
Cost64.00
\[0 \]
Alternative 13
Accuracy50.2%
Cost64.00
\[1 \]

Error

Reproduce?

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