| Alternative 1 | |
|---|---|
| Error | 0.6 |
| Cost | 46208 |
\[\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{-1}{\frac{-1 + x \cdot -2}{\frac{\mathsf{fma}\left(2, x, 1\right)}{\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 (+ x 1.0))))
(*
(/ (fma 2.0 x 1.0) (fma (cbrt x) (+ (cbrt x) t_0) (pow t_0 2.0)))
(/ 1.0 (fma 2.0 x 1.0)))))double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
double t_0 = cbrt((x + 1.0));
return (fma(2.0, x, 1.0) / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0))) * (1.0 / fma(2.0, x, 1.0));
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
function code(x) t_0 = cbrt(Float64(x + 1.0)) return Float64(Float64(fma(2.0, x, 1.0) / fma(cbrt(x), Float64(cbrt(x) + t_0), (t_0 ^ 2.0))) * Float64(1.0 / fma(2.0, x, 1.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[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[(N[(2.0 * x + 1.0), $MachinePrecision] / 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] * N[(1.0 / N[(2.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{\mathsf{fma}\left(2, x, 1\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)} \cdot \frac{1}{\mathsf{fma}\left(2, x, 1\right)}
\end{array}
Initial program 30.0
Applied egg-rr30.0
Applied egg-rr30.6
Simplified12.7
[Start]30.6 | \[ \frac{{\left(1 + x\right)}^{2} - x \cdot x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
|---|---|
unpow2 [=>]30.6 | \[ \frac{\color{blue}{\left(1 + x\right) \cdot \left(1 + x\right)} - x \cdot x}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
difference-of-squares [=>]29.2 | \[ \frac{\color{blue}{\left(\left(1 + x\right) + x\right) \cdot \left(\left(1 + x\right) - x\right)}}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
associate-+r+ [<=]29.2 | \[ \frac{\color{blue}{\left(1 + \left(x + x\right)\right)} \cdot \left(\left(1 + x\right) - x\right)}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
associate-+r- [<=]12.7 | \[ \frac{\left(1 + \left(x + x\right)\right) \cdot \color{blue}{\left(1 + \left(x - x\right)\right)}}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
+-commutative [=>]12.7 | \[ \frac{\left(1 + \left(x + x\right)\right) \cdot \color{blue}{\left(\left(x - x\right) + 1\right)}}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
+-inverses [=>]12.7 | \[ \frac{\left(1 + \left(x + x\right)\right) \cdot \left(\color{blue}{0} + 1\right)}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
metadata-eval [=>]12.7 | \[ \frac{\left(1 + \left(x + x\right)\right) \cdot \color{blue}{1}}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
+-commutative [=>]12.7 | \[ \frac{\color{blue}{\left(\left(x + x\right) + 1\right)} \cdot 1}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
count-2 [=>]12.7 | \[ \frac{\left(\color{blue}{2 \cdot x} + 1\right) \cdot 1}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
fma-def [=>]12.7 | \[ \frac{\color{blue}{\mathsf{fma}\left(2, x, 1\right)} \cdot 1}{\left({\left(\sqrt[3]{1 + x}\right)}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)\right) \cdot \left(1 + \left(x + x\right)\right)}
\] |
+-commutative [=>]12.7 | \[ \frac{\mathsf{fma}\left(2, x, 1\right) \cdot 1}{\color{blue}{\left(\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \cdot \left(1 + \left(x + x\right)\right)}
\] |
fma-def [=>]12.7 | \[ \frac{\mathsf{fma}\left(2, x, 1\right) \cdot 1}{\color{blue}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)} \cdot \left(1 + \left(x + x\right)\right)}
\] |
+-commutative [=>]12.7 | \[ \frac{\mathsf{fma}\left(2, x, 1\right) \cdot 1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right) \cdot \color{blue}{\left(\left(x + x\right) + 1\right)}}
\] |
count-2 [=>]12.7 | \[ \frac{\mathsf{fma}\left(2, x, 1\right) \cdot 1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right) \cdot \left(\color{blue}{2 \cdot x} + 1\right)}
\] |
fma-def [=>]12.7 | \[ \frac{\mathsf{fma}\left(2, x, 1\right) \cdot 1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right) \cdot \color{blue}{\mathsf{fma}\left(2, x, 1\right)}}
\] |
Applied egg-rr0.6
Final simplification0.6
| Alternative 1 | |
|---|---|
| Error | 0.6 |
| Cost | 46208 |
| Alternative 2 | |
|---|---|
| Error | 0.6 |
| Cost | 46208 |
| Alternative 3 | |
|---|---|
| Error | 0.5 |
| Cost | 39168 |
| Alternative 4 | |
|---|---|
| Error | 7.4 |
| Cost | 33160 |
| Alternative 5 | |
|---|---|
| Error | 0.5 |
| Cost | 33024 |
| Alternative 6 | |
|---|---|
| Error | 14.0 |
| Cost | 32964 |
| Alternative 7 | |
|---|---|
| Error | 0.5 |
| Cost | 32896 |
| Alternative 8 | |
|---|---|
| Error | 25.2 |
| Cost | 26632 |
| Alternative 9 | |
|---|---|
| Error | 25.2 |
| Cost | 26441 |
| Alternative 10 | |
|---|---|
| Error | 25.1 |
| Cost | 26185 |
| Alternative 11 | |
|---|---|
| Error | 25.1 |
| Cost | 20169 |
| Alternative 12 | |
|---|---|
| Error | 30.0 |
| Cost | 13120 |
| Alternative 13 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |
| Alternative 14 | |
|---|---|
| Error | 32.1 |
| Cost | 64 |
herbie shell --seed 2023046
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))