| Alternative 1 | |
|---|---|
| Accuracy | 60.5% |
| Cost | 39236 |
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (+ (* (cbrt x) (+ (cbrt x) t_0)) (* t_0 t_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 / ((cbrt(x) * (cbrt(x) + t_0)) + (t_0 * t_0));
}
public static double code(double x) {
return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
return 1.0 / ((Math.cbrt(x) * (Math.cbrt(x) + t_0)) + (t_0 * t_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 / Float64(Float64(cbrt(x) * Float64(cbrt(x) + t_0)) + Float64(t_0 * t_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[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right) + t_0 \cdot t_0}
\end{array}
Results
Initial program 59.9%
Applied egg-rr61.3%
[Start]59.9 | \[ \sqrt[3]{x + 1} - \sqrt[3]{x}
\] |
|---|---|
flip3-- [=>]59.8 | \[ \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 [=>]59.8 | \[ \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 [=>]59.6 | \[ \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 [=>]61.3 | \[ \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 [=>]61.3 | \[ \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 [=>]61.3 | \[ \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 [=>]61.3 | \[ \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 [<=]61.3 | \[ \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)}}
\] |
Simplified79.1%
[Start]61.3 | \[ \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/ [=>]61.3 | \[ \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 [=>]61.3 | \[ \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 [=>]61.3 | \[ \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+ [=>]79.2 | \[ \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 [=>]79.2 | \[ \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 [=>]79.2 | \[ \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 [=>]79.2 | \[ \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 [=>]79.1 | \[ \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 [=>]79.1 | \[ \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 [=>]79.1 | \[ \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)}
\] |
Applied egg-rr99.2%
[Start]79.1 | \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}
\] |
|---|---|
unpow2 [=>]79.1 | \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \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}, \color{blue}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\right)}
\] |
Simplified99.2%
[Start]99.2 | \[ \frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, \sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right)}
\] |
|---|---|
unpow2 [<=]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)}
\] |
Applied egg-rr79.1%
[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)}
\] |
|---|---|
fma-udef [=>]99.2 | \[ \frac{1}{\color{blue}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(\sqrt[3]{1 + x}\right)}^{2}}}
\] |
unpow2 [=>]99.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}}
\] |
pow1/3 [=>]79.4 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{{\left(1 + x\right)}^{0.3333333333333333}} \cdot \sqrt[3]{1 + x}}
\] |
pow1/3 [=>]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(1 + x\right)}^{0.3333333333333333} \cdot \color{blue}{{\left(1 + x\right)}^{0.3333333333333333}}}
\] |
pow-prod-up [=>]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{{\left(1 + x\right)}^{\left(0.3333333333333333 + 0.3333333333333333\right)}}}
\] |
add-exp-log [=>]79.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\color{blue}{\left(e^{\log \left(1 + x\right)}\right)}}^{\left(0.3333333333333333 + 0.3333333333333333\right)}}
\] |
log1p-udef [<=]79.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(e^{\color{blue}{\mathsf{log1p}\left(x\right)}}\right)}^{\left(0.3333333333333333 + 0.3333333333333333\right)}}
\] |
pow-exp [=>]79.1 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{e^{\mathsf{log1p}\left(x\right) \cdot \left(0.3333333333333333 + 0.3333333333333333\right)}}}
\] |
metadata-eval [=>]79.1 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + e^{\mathsf{log1p}\left(x\right) \cdot \color{blue}{0.6666666666666666}}}
\] |
Applied egg-rr79.0%
[Start]79.1 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}}
\] |
|---|---|
exp-prod [=>]79.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{{\left(e^{\mathsf{log1p}\left(x\right)}\right)}^{0.6666666666666666}}}
\] |
log1p-udef [=>]79.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(e^{\color{blue}{\log \left(1 + x\right)}}\right)}^{0.6666666666666666}}
\] |
add-exp-log [<=]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\color{blue}{\left(1 + x\right)}}^{0.6666666666666666}}
\] |
+-commutative [=>]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\color{blue}{\left(x + 1\right)}}^{0.6666666666666666}}
\] |
Simplified99.2%
[Start]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(x + 1\right)}^{0.6666666666666666}}
\] |
|---|---|
metadata-eval [<=]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + {\left(x + 1\right)}^{\color{blue}{\left(2 \cdot 0.3333333333333333\right)}}}
\] |
pow-sqr [<=]79.0 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{{\left(x + 1\right)}^{0.3333333333333333} \cdot {\left(x + 1\right)}^{0.3333333333333333}}}
\] |
unpow1/3 [=>]79.4 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \color{blue}{\sqrt[3]{x + 1}} \cdot {\left(x + 1\right)}^{0.3333333333333333}}
\] |
+-commutative [=>]79.4 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \sqrt[3]{\color{blue}{1 + x}} \cdot {\left(x + 1\right)}^{0.3333333333333333}}
\] |
unpow1/3 [=>]99.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \sqrt[3]{1 + x} \cdot \color{blue}{\sqrt[3]{x + 1}}}
\] |
+-commutative [=>]99.2 | \[ \frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right) + \sqrt[3]{1 + x} \cdot \sqrt[3]{\color{blue}{1 + x}}}
\] |
Final simplification99.2%
| Alternative 1 | |
|---|---|
| Accuracy | 60.5% |
| Cost | 39236 |
| Alternative 2 | |
|---|---|
| Accuracy | 60.5% |
| Cost | 33092 |
| Alternative 3 | |
|---|---|
| Accuracy | 86.5% |
| Cost | 32964 |
| Alternative 4 | |
|---|---|
| Accuracy | 86.4% |
| Cost | 32900 |
| Alternative 5 | |
|---|---|
| Accuracy | 78.1% |
| Cost | 26828 |
| Alternative 6 | |
|---|---|
| Accuracy | 86.4% |
| Cost | 26628 |
| Alternative 7 | |
|---|---|
| Accuracy | 52.9% |
| Cost | 13376 |
| Alternative 8 | |
|---|---|
| Accuracy | 52.9% |
| Cost | 13120 |
| Alternative 9 | |
|---|---|
| Accuracy | 3.6% |
| Cost | 64 |
| Alternative 10 | |
|---|---|
| Accuracy | 49.6% |
| Cost | 64 |
herbie shell --seed 2023157
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))