| Alternative 1 | |
|---|---|
| Error | 30.4 |
| 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_1 (- t_0 (cbrt x)))) (if (!= t_0 0.0) (/ (* t_0 t_1) t_0) t_1)))
double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
double code(double x) {
double t_0 = cbrt((x + 1.0));
double t_1 = t_0 - cbrt(x);
double tmp;
if (t_0 != 0.0) {
tmp = (t_0 * t_1) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
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));
double t_1 = t_0 - Math.cbrt(x);
double tmp;
if (t_0 != 0.0) {
tmp = (t_0 * t_1) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
function code(x) t_0 = cbrt(Float64(x + 1.0)) t_1 = Float64(t_0 - cbrt(x)) tmp = 0.0 if (t_0 != 0.0) tmp = Float64(Float64(t_0 * t_1) / t_0); else tmp = t_1; end return tmp 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]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[Unequal[t$95$0, 0.0], N[(N[(t$95$0 * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]
\sqrt[3]{x + 1} - \sqrt[3]{x}
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \ne 0:\\
\;\;\;\;\frac{t_0 \cdot t_1}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Initial program 30.4
Applied egg-rr30.4
Final simplification30.4
| Alternative 1 | |
|---|---|
| Error | 30.4 |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |
| Alternative 3 | |
|---|---|
| Error | 32.5 |
| Cost | 64 |
herbie shell --seed 2023104
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))