| Alternative 1 | |
|---|---|
| Error | 29.7 |
| Cost | 13120 |
\[\sqrt[3]{x + 1} - \sqrt[3]{x}
\]
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ x 1.0)))) (- (/ (- t_0 (cbrt x)) 2.0) (+ (* (+ (cbrt x) t_0) -0.5) (cbrt x)))))
double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
double t_0 = cbrt((x + 1.0));
return ((t_0 - cbrt(x)) / 2.0) - (((cbrt(x) + t_0) * -0.5) + cbrt(x));
}
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((x + 1.0));
return ((t_0 - Math.cbrt(x)) / 2.0) - (((Math.cbrt(x) + t_0) * -0.5) + Math.cbrt(x));
}
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(Float64(t_0 - cbrt(x)) / 2.0) - Float64(Float64(Float64(cbrt(x) + t_0) * -0.5) + cbrt(x))) 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[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] * -0.5), $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{t_0 - \sqrt[3]{x}}{2} - \left(\left(\sqrt[3]{x} + t_0\right) \cdot -0.5 + \sqrt[3]{x}\right)
\end{array}
Results
Initial program 29.7
Applied egg-rr29.7
Applied egg-rr29.7
Applied egg-rr29.7
Final simplification29.7
| Alternative 1 | |
|---|---|
| Error | 29.7 |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |
| Alternative 3 | |
|---|---|
| Error | 31.8 |
| Cost | 64 |
herbie shell --seed 2023099
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))