?

Average Accuracy: 53.2% → 99.2%
Time: 11.9s
Precision: binary64
Cost: 39296

?

\[\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, \frac{1}{{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) (/ 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), (cbrt(x) + t_0), (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(cbrt(x) + t_0), Float64(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[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[(1.0 / N[Power[t$95$0, -2.0], $MachinePrecision]), $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, \frac{1}{{t_0}^{-2}}\right)}
\end{array}

Error?

Derivation?

  1. Initial program 53.2%

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

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

    [Start]53.2

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

    flip3-- [=>]53.2

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

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

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

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

    pow2 [=>]54.2

    \[ \left(\left(x + 1\right) - x\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt[3]{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.2

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

    +-commutative [<=]54.2

    \[ \left(\left(x + 1\right) - x\right) \cdot \frac{1}{{\left(\sqrt[3]{x + 1}\right)}^{2} + \sqrt[3]{x} \cdot \color{blue}{\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.2

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

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

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

    \[ \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-rr76.0%

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\color{blue}{\left(\frac{\sqrt[3]{1 - x \cdot x}}{\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}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \]

    flip-+ [=>]75.9

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

    cbrt-div [=>]76.0

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

    metadata-eval [=>]76.0

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

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

    [Start]76.0

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

    clear-num [=>]76.0

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

    inv-pow [=>]76.0

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

    clear-num [=>]76.0

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

    cbrt-undiv [=>]75.9

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

    metadata-eval [<=]75.9

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

    flip-+ [<=]99.2

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

    \[\leadsto \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \color{blue}{\frac{1}{{\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}, {\left({\left(\frac{1}{\sqrt[3]{1 + x}}\right)}^{-1}\right)}^{2}\right)} \]

    unpow2 [=>]99.2

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

    unpow-1 [=>]99.2

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

    unpow-1 [=>]99.2

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

    frac-times [=>]99.2

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

    metadata-eval [=>]99.2

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

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

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

    metadata-eval [<=]99.2

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

    associate-/r/ [<=]99.2

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

    metadata-eval [<=]99.2

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

    metadata-eval [<=]99.2

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

    frac-times [<=]99.2

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

    unpow-1 [<=]99.2

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

    unpow-1 [<=]99.2

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

    frac-times [<=]99.2

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

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

Alternatives

Alternative 1
Accuracy99.2%
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 2
Accuracy60.7%
Cost39108
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_1\right)\right)\\ \end{array} \]
Alternative 3
Accuracy87.7%
Cost33096
\[\begin{array}{l} t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_0}\\ \mathbf{elif}\;x \leq -1:\\ \;\;\;\;\frac{1}{t_0 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 + e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}}\\ \end{array} \]
Alternative 4
Accuracy60.7%
Cost33092
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := t_0 - \sqrt[3]{x}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Accuracy99.2%
Cost32896
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ \frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)} \end{array} \]
Alternative 6
Accuracy77.4%
Cost26829
\[\begin{array}{l} t_0 := \sqrt[3]{1 + x}\\ t_1 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_1}\\ \mathbf{elif}\;x \leq -32000000 \lor \neg \left(x \leq 32000000\right):\\ \;\;\;\;\frac{1}{t_1 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0 - \sqrt[3]{x}\right)\right)\\ \end{array} \]
Alternative 7
Accuracy87.6%
Cost26760
\[\begin{array}{l} t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{1 + t_0}\\ \mathbf{elif}\;x \leq -1:\\ \;\;\;\;\frac{1}{t_0 + \sqrt[3]{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 + {\left(1 + x\right)}^{0.6666666666666666}}\\ \end{array} \]
Alternative 8
Accuracy53.2%
Cost13120
\[\sqrt[3]{1 + x} - \sqrt[3]{x} \]
Alternative 9
Accuracy3.6%
Cost64
\[0 \]
Alternative 10
Accuracy49.7%
Cost64
\[1 \]

Error

Reproduce?

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