
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
public static double code(double x) {
return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{x + 1} - \sqrt[3]{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (- (cbrt (+ x 1.0)) (cbrt x)))
double code(double x) {
return cbrt((x + 1.0)) - cbrt(x);
}
public static double code(double x) {
return Math.cbrt((x + 1.0)) - Math.cbrt(x);
}
function code(x) return Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) end
code[x_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{x + 1} - \sqrt[3]{x}
\end{array}
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (pow t_0 2.0)))
(/
1.0
(+
t_1
(* (/ (cbrt x) (fma (cbrt x) (- (cbrt x) t_0) t_1)) (+ 1.0 (* x 2.0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = pow(t_0, 2.0);
return 1.0 / (t_1 + ((cbrt(x) / fma(cbrt(x), (cbrt(x) - t_0), t_1)) * (1.0 + (x * 2.0))));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = t_0 ^ 2.0 return Float64(1.0 / Float64(t_1 + Float64(Float64(cbrt(x) / fma(cbrt(x), Float64(cbrt(x) - t_0), t_1)) * Float64(1.0 + Float64(x * 2.0))))) end
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, 2.0], $MachinePrecision]}, N[(1.0 / N[(t$95$1 + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] - t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := {t_0}^{2}\\
\frac{1}{t_1 + \frac{\sqrt[3]{x}}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} - t_0, t_1\right)} \cdot \left(1 + x \cdot 2\right)}
\end{array}
\end{array}
Initial program 52.9%
pow1/350.3%
Applied egg-rr50.3%
pow1/352.9%
sub-neg52.9%
flip3-+52.9%
rem-cube-cbrt53.1%
+-commutative53.1%
pow253.1%
+-commutative53.1%
+-commutative53.1%
Applied egg-rr53.1%
associate-+l+59.8%
cube-neg59.8%
rem-cube-cbrt99.1%
unsub-neg99.1%
+-inverses99.1%
metadata-eval99.1%
sqr-neg99.1%
unpow299.1%
*-commutative99.1%
cancel-sign-sub99.1%
unpow299.1%
Simplified99.1%
flip3-+99.1%
associate-*r/86.8%
rem-cube-cbrt87.0%
rem-cube-cbrt87.1%
+-commutative87.1%
+-commutative87.1%
pow287.1%
+-commutative87.1%
distribute-rgt-out--87.1%
+-commutative87.1%
Applied egg-rr87.1%
associate-/l*99.6%
associate-/r/99.6%
+-commutative99.6%
fma-def99.6%
associate-+r+99.6%
+-commutative99.6%
count-299.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (+ (cbrt x) t_0)))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (* (cbrt x) (+ (cbrt x) t_1)))
(/ 1.0 (+ (* (cbrt x) t_1) (cbrt (pow (+ 1.0 x) 2.0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = cbrt(x) + t_0;
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (cbrt(x) * (cbrt(x) + t_1));
} else {
tmp = 1.0 / ((cbrt(x) * t_1) + cbrt(pow((1.0 + x), 2.0)));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double t_1 = Math.cbrt(x) + t_0;
double tmp;
if ((t_0 - Math.cbrt(x)) <= 0.0) {
tmp = 1.0 / (Math.cbrt(x) * (Math.cbrt(x) + t_1));
} else {
tmp = 1.0 / ((Math.cbrt(x) * t_1) + Math.cbrt(Math.pow((1.0 + x), 2.0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(cbrt(x) + t_0) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64(cbrt(x) * Float64(cbrt(x) + t_1))); else tmp = Float64(1.0 / Float64(Float64(cbrt(x) * t_1) + cbrt((Float64(1.0 + x) ^ 2.0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := \sqrt[3]{x} + t_0\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot t_1 + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
flip3--4.2%
div-inv4.2%
rem-cube-cbrt3.8%
rem-cube-cbrt4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr1.8%
associate-*r/1.8%
*-rgt-identity1.8%
+-commutative1.8%
associate--l+40.1%
+-inverses40.1%
metadata-eval40.1%
+-commutative40.1%
exp-prod39.6%
Simplified39.6%
Taylor expanded in x around inf 48.3%
unpow1/350.6%
Simplified50.6%
expm1-log1p-u50.6%
expm1-udef5.6%
+-commutative5.6%
unpow25.6%
cbrt-prod5.6%
pow25.6%
Applied egg-rr5.6%
expm1-def98.4%
expm1-log1p98.4%
fma-udef98.3%
unpow298.3%
distribute-lft-out98.4%
+-commutative98.4%
Simplified98.4%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.9%
pow1/396.0%
Applied egg-rr96.0%
pow1/397.9%
sub-neg97.9%
flip3-+97.9%
rem-cube-cbrt98.8%
+-commutative98.8%
pow298.8%
+-commutative98.8%
+-commutative98.8%
Applied egg-rr98.8%
associate-+l+98.8%
cube-neg98.8%
rem-cube-cbrt99.9%
unsub-neg99.9%
+-inverses99.9%
metadata-eval99.9%
sqr-neg99.9%
unpow299.9%
*-commutative99.9%
cancel-sign-sub99.9%
unpow299.9%
Simplified99.8%
pow1/396.9%
+-commutative96.9%
pow-pow96.9%
metadata-eval96.9%
sub-neg96.9%
flip--96.9%
metadata-eval96.9%
fma-neg96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
pow-prod-up96.9%
pow1/396.9%
pow1/399.8%
cbrt-unprod99.9%
pow299.9%
metadata-eval99.9%
fma-neg99.9%
metadata-eval99.9%
flip--99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x))))
(if (<= t_1 4e-7)
(/ 1.0 (* (cbrt x) (+ (cbrt x) (+ (cbrt x) t_0))))
(exp (log t_1)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = t_0 - cbrt(x);
double tmp;
if (t_1 <= 4e-7) {
tmp = 1.0 / (cbrt(x) * (cbrt(x) + (cbrt(x) + t_0)));
} else {
tmp = exp(log(t_1));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double t_1 = t_0 - Math.cbrt(x);
double tmp;
if (t_1 <= 4e-7) {
tmp = 1.0 / (Math.cbrt(x) * (Math.cbrt(x) + (Math.cbrt(x) + t_0)));
} else {
tmp = Math.exp(Math.log(t_1));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(t_0 - cbrt(x)) tmp = 0.0 if (t_1 <= 4e-7) tmp = Float64(1.0 / Float64(cbrt(x) * Float64(cbrt(x) + Float64(cbrt(x) + t_0)))); else tmp = exp(log(t_1)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-7], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[t$95$1], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(\sqrt[3]{x} + t_0\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\log t_1}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 3.9999999999999998e-7Initial program 5.3%
flip3--5.3%
div-inv5.3%
rem-cube-cbrt5.9%
rem-cube-cbrt7.2%
+-commutative7.2%
distribute-rgt-out7.2%
+-commutative7.2%
fma-def7.2%
add-exp-log7.2%
Applied egg-rr3.3%
associate-*r/3.3%
*-rgt-identity3.3%
+-commutative3.3%
associate--l+40.3%
+-inverses40.3%
metadata-eval40.3%
+-commutative40.3%
exp-prod39.8%
Simplified39.8%
Taylor expanded in x around inf 49.3%
unpow1/351.5%
Simplified51.5%
expm1-log1p-u51.5%
expm1-udef7.3%
+-commutative7.3%
unpow27.3%
cbrt-prod7.3%
pow27.3%
Applied egg-rr7.3%
expm1-def97.8%
expm1-log1p97.8%
fma-udef97.8%
unpow297.8%
distribute-lft-out97.8%
+-commutative97.8%
Simplified97.8%
if 3.9999999999999998e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.7%
add-exp-log99.7%
Applied egg-rr99.7%
Final simplification98.8%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ (+ 1.0 (- x x)) (fma (cbrt x) (+ (cbrt x) t_0) (pow t_0 2.0)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return (1.0 + (x - x)) / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(Float64(1.0 + Float64(x - x)) / fma(cbrt(x), Float64(cbrt(x) + t_0), (t_0 ^ 2.0))) end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[(1.0 + N[(x - x), $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1 + \left(x - x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)}
\end{array}
\end{array}
Initial program 52.9%
pow1/324.8%
Applied egg-rr24.8%
pow1/352.9%
flip3--52.9%
div-inv52.9%
pow352.8%
add-cube-cbrt53.1%
rem-cube-cbrt53.9%
pow253.9%
distribute-rgt-out53.9%
+-commutative53.9%
Applied egg-rr53.9%
associate-*r/53.9%
*-rgt-identity53.9%
+-commutative53.9%
associate--l+99.1%
+-commutative99.1%
fma-def99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x))))
(if (<= t_1 0.0)
(/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt x) t_0))))
(exp (log t_1)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = t_0 - cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * (cbrt(x) + t_0)));
} else {
tmp = exp(log(t_1));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double t_1 = t_0 - Math.cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt(x) + t_0)));
} else {
tmp = Math.exp(Math.log(t_1));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(t_0 - cbrt(x)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))); else tmp = exp(log(t_1)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[t$95$1], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\log t_1}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
pow1/30.8%
Applied egg-rr0.8%
pow1/34.2%
sub-neg4.2%
flip3-+4.2%
rem-cube-cbrt3.8%
+-commutative3.8%
pow23.8%
+-commutative3.8%
+-commutative3.8%
Applied egg-rr3.8%
associate-+l+17.7%
cube-neg17.7%
rem-cube-cbrt98.3%
unsub-neg98.3%
+-inverses98.3%
metadata-eval98.3%
sqr-neg98.3%
unpow298.3%
*-commutative98.3%
cancel-sign-sub98.3%
unpow298.3%
Simplified98.3%
Taylor expanded in x around 0 20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.9%
add-exp-log97.9%
Applied egg-rr97.9%
Final simplification60.4%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x)))) (if (<= t_1 0.0) (/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt x) t_0)))) t_1)))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = t_0 - cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (cbrt(x) * (cbrt(x) + t_0)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double t_1 = t_0 - Math.cbrt(x);
double tmp;
if (t_1 <= 0.0) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt(x) + t_0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(t_0 - cbrt(x)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))); else tmp = t_1; end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := t_0 - \sqrt[3]{x}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
pow1/30.8%
Applied egg-rr0.8%
pow1/34.2%
sub-neg4.2%
flip3-+4.2%
rem-cube-cbrt3.8%
+-commutative3.8%
pow23.8%
+-commutative3.8%
+-commutative3.8%
Applied egg-rr3.8%
associate-+l+17.7%
cube-neg17.7%
rem-cube-cbrt98.3%
unsub-neg98.3%
+-inverses98.3%
metadata-eval98.3%
sqr-neg98.3%
unpow298.3%
*-commutative98.3%
cancel-sign-sub98.3%
unpow298.3%
Simplified98.3%
Taylor expanded in x around 0 20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.9%
Final simplification60.4%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ (cbrt x) t_0))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (cbrt(x) + t_0)));
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
return 1.0 / (Math.pow(t_0, 2.0) + (Math.cbrt(x) * (Math.cbrt(x) + t_0)));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))) end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1}{{t_0}^{2} + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}
\end{array}
\end{array}
Initial program 52.9%
pow1/350.3%
Applied egg-rr50.3%
pow1/352.9%
sub-neg52.9%
flip3-+52.9%
rem-cube-cbrt53.1%
+-commutative53.1%
pow253.1%
+-commutative53.1%
+-commutative53.1%
Applied egg-rr53.1%
associate-+l+59.8%
cube-neg59.8%
rem-cube-cbrt99.1%
unsub-neg99.1%
+-inverses99.1%
metadata-eval99.1%
sqr-neg99.1%
unpow299.1%
*-commutative99.1%
cancel-sign-sub99.1%
unpow299.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x) :precision binary64 (- (cbrt (+ 1.0 x)) (cbrt x)))
double code(double x) {
return cbrt((1.0 + x)) - cbrt(x);
}
public static double code(double x) {
return Math.cbrt((1.0 + x)) - Math.cbrt(x);
}
function code(x) return Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) end
code[x_] := N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{1 + x} - \sqrt[3]{x}
\end{array}
Initial program 52.9%
Final simplification52.9%
(FPCore (x) :precision binary64 0.0)
double code(double x) {
return 0.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.0d0
end function
public static double code(double x) {
return 0.0;
}
def code(x): return 0.0
function code(x) return 0.0 end
function tmp = code(x) tmp = 0.0; end
code[x_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 52.9%
Taylor expanded in x around inf 3.7%
Final simplification3.7%
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 52.9%
Taylor expanded in x around 0 49.3%
Final simplification49.3%
herbie shell --seed 2023338
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))