?

Average Accuracy: 52.9% → 99.2%
Time: 12.8s
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 52.9%

    \[\sqrt[3]{x + 1} - \sqrt[3]{x} \]
  2. Applied egg-rr54.0%

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

    [Start]52.9

    \[ \sqrt[3]{x + 1} - \sqrt[3]{x} \]

    flip3-- [=>]53.0

    \[ \color{blue}{\frac{{\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)}} \]

    div-inv [=>]53.0

    \[ \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)}} \]

    rem-cube-cbrt [=>]52.8

    \[ \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)} \]

    rem-cube-cbrt [=>]54.0

    \[ \left(\left(x + 1\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)} \]

    cbrt-unprod [=>]54.0

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

    pow2 [=>]54.0

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

    distribute-rgt-out [=>]54.0

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

    +-commutative [<=]54.0

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

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

    [Start]54.0

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

    associate-*r/ [=>]54.0

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

    *-rgt-identity [=>]54.0

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

    +-commutative [=>]54.0

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

    associate--l+ [=>]76.0

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

    +-inverses [=>]76.0

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

    metadata-eval [=>]76.0

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

    +-commutative [=>]76.0

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

    fma-def [=>]76.0

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

    +-commutative [=>]76.0

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

    +-commutative [=>]76.0

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

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

    [Start]76.0

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

    add-log-exp [=>]52.1

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

    *-un-lft-identity [=>]52.1

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

    log-prod [=>]52.1

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

    metadata-eval [=>]52.1

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

    add-log-exp [<=]76.0

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

    unpow2 [=>]76.0

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

    cbrt-prod [=>]99.2

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

    pow2 [=>]99.2

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

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

    [Start]99.2

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

    +-lft-identity [=>]99.2

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

    \[\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
Accuracy88.5%
Cost33352
\[\begin{array}{l} t_0 := 1 + \left(x - x\right)\\ t_1 := \sqrt[3]{1 + x}\\ t_2 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_1\right)\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{1 + t_2}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{{t_1}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_2 + e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}}\\ \end{array} \]
Alternative 2
Accuracy99.1%
Cost33152
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1 + \left(x - x\right)}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)} \end{array} \]
Alternative 3
Accuracy88.5%
Cost33032
\[\begin{array}{l} t_0 := 1 + \left(x - x\right)\\ t_1 := \sqrt[3]{1 + x}\\ t_2 := \sqrt[3]{x} + t_1\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{1 + \sqrt[3]{x} \cdot t_2}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{t_0}{{t_1}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_2, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\ \end{array} \]
Alternative 4
Accuracy79.8%
Cost27145
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := 1 + \left(x - x\right)\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154} \lor \neg \left(x \leq 1.35 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{t_1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{{t_0}^{2} + \left(\sqrt[3]{x \cdot \left(1 + x\right)} + \sqrt[3]{x \cdot x}\right)}\\ \end{array} \]
Alternative 5
Accuracy79.5%
Cost26572
\[\begin{array}{l} t_0 := \frac{1 + \left(x - x\right)}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)}\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -17000000:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 29000000:\\ \;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+161}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Accuracy79.5%
Cost26316
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \frac{1 + \left(x - x\right)}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -32500000:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 45000000:\\ \;\;\;\;\log \left(e^{t_0 - \sqrt[3]{x}}\right)\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+161}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Accuracy79.4%
Cost26316
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \frac{1 + \left(x - x\right)}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -9500:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 45000000:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right) - \sqrt[3]{x}\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+161}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy76.1%
Cost26308
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-6}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Accuracy79.5%
Cost20688
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \frac{1 + \left(x - x\right)}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{if}\;x \leq -1.34 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -32500000:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 45000000:\\ \;\;\;\;t_0 - \sqrt[3]{x}\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+161}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Accuracy73.9%
Cost7113
\[\begin{array}{l} \mathbf{if}\;x \leq -1.02 \lor \neg \left(x \leq 0.47\right):\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt[3]{x}\\ \end{array} \]
Alternative 11
Accuracy74.2%
Cost7112
\[\begin{array}{l} \mathbf{if}\;x \leq -1.02:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 0.47:\\ \;\;\;\;1 - \sqrt[3]{x}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \end{array} \]
Alternative 12
Accuracy74.8%
Cost7112
\[\begin{array}{l} \mathbf{if}\;x \leq -1.02:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{\frac{1}{x}}{x}}\\ \end{array} \]
Alternative 13
Accuracy50.1%
Cost6592
\[1 - \sqrt[3]{x} \]
Alternative 14
Accuracy3.6%
Cost64
\[0 \]
Alternative 15
Accuracy49.3%
Cost64
\[1 \]

Error

Reproduce?

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