| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 45504 |
\[\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
{\left(\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)\right)}^{-1}
\end{array}
\]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (cbrt t_0))) (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (* (pow t_1 2.0) (* t_0 t_1))))))
double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = cbrt(t_0);
return 1.0 / fma(cbrt(x), (cbrt(x) + t_0), (pow(t_1, 2.0) * (t_0 * t_1)));
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = cbrt(t_0) return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), Float64((t_1 ^ 2.0) * Float64(t_0 * t_1)))) 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]}, Block[{t$95$1 = N[Power[t$95$0, 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[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := \sqrt[3]{t_0}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_1}^{2} \cdot \left(t_0 \cdot t_1\right)\right)}
\end{array}
Initial program 29.8
Applied egg-rr29.0
Simplified0.5
[Start]29.0 | \[ \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/ [=>]29.0 | \[ \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 [=>]29.0 | \[ \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 [=>]29.0 | \[ \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.6 | \[ \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.6 | \[ \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.6 | \[ \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.6 | \[ \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.5 | \[ \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.5 | \[ \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.5 | \[ \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)}
\] |
Applied egg-rr0.6
Final simplification0.6
| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 45504 |
| Alternative 2 | |
|---|---|
| Error | 25.1 |
| Cost | 39364 |
| Alternative 3 | |
|---|---|
| Error | 0.5 |
| Cost | 39168 |
| Alternative 4 | |
|---|---|
| Error | 0.6 |
| Cost | 33152 |
| Alternative 5 | |
|---|---|
| Error | 14.0 |
| Cost | 32964 |
| Alternative 6 | |
|---|---|
| Error | 25.0 |
| Cost | 32904 |
| Alternative 7 | |
|---|---|
| Error | 14.0 |
| Cost | 32900 |
| Alternative 8 | |
|---|---|
| Error | 25.0 |
| Cost | 27016 |
| Alternative 9 | |
|---|---|
| Error | 29.8 |
| Cost | 13120 |
| Alternative 10 | |
|---|---|
| Error | 31.5 |
| Cost | 6848 |
| Alternative 11 | |
|---|---|
| Error | 31.5 |
| Cost | 6592 |
| Alternative 12 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |
| Alternative 13 | |
|---|---|
| Error | 32.0 |
| Cost | 64 |
herbie shell --seed 2023088
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))