
(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 12 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)))) (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (/ t_0 (/ 1.0 t_0))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / fma(cbrt(x), (cbrt(x) + t_0), (t_0 / (1.0 / t_0)));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), Float64(t_0 / Float64(1.0 / 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[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[(t$95$0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, \frac{t_0}{\frac{1}{t_0}}\right)}
\end{array}
\end{array}
Initial program 54.6%
flip3--54.8%
div-inv54.8%
rem-cube-cbrt54.6%
rem-cube-cbrt55.5%
cbrt-unprod55.5%
pow255.5%
distribute-rgt-out55.5%
+-commutative55.5%
Applied egg-rr55.5%
associate-*r/55.5%
*-rgt-identity55.5%
+-commutative55.5%
associate--l+73.6%
+-inverses73.6%
metadata-eval73.6%
+-commutative73.6%
fma-def73.6%
+-commutative73.6%
+-commutative73.6%
Simplified73.6%
Applied egg-rr99.3%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x))))
(if (<= t_1 1e-7)
(/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (cbrt (* x x))))
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 <= 1e-7) {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), cbrt((x * x)));
} 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 <= 1e-7) tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), cbrt(Float64(x * x)))); 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, 1e-7], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $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 10^{-7}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, \sqrt[3]{x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 9.9999999999999995e-8Initial program 5.0%
flip3--5.5%
div-inv5.5%
rem-cube-cbrt5.0%
rem-cube-cbrt6.7%
cbrt-unprod6.7%
pow26.7%
distribute-rgt-out6.7%
+-commutative6.7%
Applied egg-rr6.7%
associate-*r/6.7%
*-rgt-identity6.7%
+-commutative6.7%
associate--l+44.8%
+-inverses44.8%
metadata-eval44.8%
+-commutative44.8%
fma-def44.8%
+-commutative44.8%
+-commutative44.8%
Simplified44.8%
add-exp-log43.5%
pow1/343.1%
log-pow43.0%
log-pow45.0%
log1p-udef45.0%
Applied egg-rr45.0%
associate-*r*45.0%
metadata-eval45.0%
Simplified45.0%
Taylor expanded in x around inf 42.7%
unpow1/344.6%
unpow244.6%
Simplified44.6%
if 9.9999999999999995e-8 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.7%
Final simplification73.4%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x)))) (if (<= t_1 5e-11) (/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) 1.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 <= 5e-11) {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), 1.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 <= 5e-11) tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), 1.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, 5e-11], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + 1.0), $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 5 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 5.00000000000000018e-11Initial program 4.4%
flip3--4.4%
div-inv4.4%
rem-cube-cbrt3.9%
rem-cube-cbrt5.2%
cbrt-unprod5.2%
pow25.2%
distribute-rgt-out5.2%
+-commutative5.2%
Applied egg-rr5.2%
associate-*r/5.2%
*-rgt-identity5.2%
+-commutative5.2%
associate--l+43.9%
+-inverses43.9%
metadata-eval43.9%
+-commutative43.9%
fma-def43.9%
+-commutative43.9%
+-commutative43.9%
Simplified43.9%
Taylor expanded in x around 0 19.9%
if 5.00000000000000018e-11 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 98.8%
Final simplification61.8%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (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 / fma(cbrt(x), (cbrt(x) + t_0), pow(t_0, 2.0));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / 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[(1.0 / 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}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {t_0}^{2}\right)}
\end{array}
\end{array}
Initial program 54.6%
flip3--54.8%
div-inv54.8%
rem-cube-cbrt54.6%
rem-cube-cbrt55.5%
cbrt-unprod55.5%
pow255.5%
distribute-rgt-out55.5%
+-commutative55.5%
Applied egg-rr55.5%
associate-*r/55.5%
*-rgt-identity55.5%
+-commutative55.5%
associate--l+73.6%
+-inverses73.6%
metadata-eval73.6%
+-commutative73.6%
fma-def73.6%
+-commutative73.6%
+-commutative73.6%
Simplified73.6%
expm1-log1p-u73.0%
expm1-udef73.0%
pow1/372.8%
pow-pow73.4%
pow-sqr73.4%
+-commutative73.4%
pow1/373.5%
+-commutative73.5%
pow1/397.1%
pow297.1%
+-commutative97.1%
Applied egg-rr97.1%
expm1-def97.0%
expm1-log1p99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (+ (cbrt x) t_0)))
(if (<= x -1.35e+154)
(/ 1.0 (fma (cbrt x) t_1 1.0))
(if (<= x 1.35e+154)
(/ 1.0 (+ (+ (pow t_0 2.0) (cbrt (* x x))) (cbrt (fma x x x))))
(/ 1.0 (fma (cbrt x) t_1 (pow (+ 1.0 x) 0.6666666666666666)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = cbrt(x) + t_0;
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / fma(cbrt(x), t_1, 1.0);
} else if (x <= 1.35e+154) {
tmp = 1.0 / ((pow(t_0, 2.0) + cbrt((x * x))) + cbrt(fma(x, x, x)));
} else {
tmp = 1.0 / fma(cbrt(x), t_1, pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = Float64(cbrt(x) + t_0) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / fma(cbrt(x), t_1, 1.0)); elseif (x <= 1.35e+154) tmp = Float64(1.0 / Float64(Float64((t_0 ^ 2.0) + cbrt(Float64(x * x))) + cbrt(fma(x, x, x)))); else tmp = Float64(1.0 / fma(cbrt(x), t_1, (Float64(1.0 + x) ^ 0.6666666666666666))); 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[x, -1.35e+154], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[(1.0 / N[(N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(x * x + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
t_1 := \sqrt[3]{x} + t_0\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, 1\right)}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\left({t_0}^{2} + \sqrt[3]{x \cdot x}\right) + \sqrt[3]{\mathsf{fma}\left(x, x, x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 4.8%
flip3--4.8%
div-inv4.8%
rem-cube-cbrt3.6%
rem-cube-cbrt4.8%
cbrt-unprod4.8%
pow24.8%
distribute-rgt-out4.8%
+-commutative4.8%
Applied egg-rr4.8%
associate-*r/4.8%
*-rgt-identity4.8%
+-commutative4.8%
associate--l+4.8%
+-inverses4.8%
metadata-eval4.8%
+-commutative4.8%
fma-def4.8%
+-commutative4.8%
+-commutative4.8%
Simplified4.8%
Taylor expanded in x around 0 20.0%
if -1.35000000000000003e154 < x < 1.35000000000000003e154Initial program 73.3%
flip3--73.7%
div-inv73.7%
rem-cube-cbrt73.9%
rem-cube-cbrt74.6%
cbrt-unprod74.6%
pow274.6%
distribute-rgt-out74.6%
+-commutative74.6%
Applied egg-rr74.6%
associate-*r/74.6%
*-rgt-identity74.6%
+-commutative74.6%
associate--l+99.6%
+-inverses99.6%
metadata-eval99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
+-commutative99.6%
Simplified99.6%
fma-udef99.6%
pow1/398.3%
unpow298.3%
pow-prod-down85.2%
+-commutative85.2%
pow1/385.4%
+-commutative85.4%
pow1/399.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
distribute-rgt-in99.4%
associate-+r+99.4%
Applied egg-rr99.6%
if 1.35000000000000003e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.0%
rem-cube-cbrt4.7%
cbrt-unprod4.7%
pow24.7%
distribute-rgt-out4.7%
+-commutative4.7%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+4.7%
+-inverses4.7%
metadata-eval4.7%
+-commutative4.7%
fma-def4.7%
+-commutative4.7%
+-commutative4.7%
Simplified4.7%
pow1/34.7%
pow-pow91.6%
metadata-eval91.6%
Applied egg-rr91.6%
Final simplification86.8%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (cbrt x) (cbrt (+ 1.0 x)))))
(if (<= x -1.35e+154)
(/ 1.0 (fma (cbrt x) t_0 1.0))
(if (<= x -1.0)
(/ 1.0 (fma (cbrt x) t_0 (cbrt (* x x))))
(/ 1.0 (fma (cbrt x) t_0 (pow (+ 1.0 x) 0.6666666666666666)))))))
double code(double x) {
double t_0 = cbrt(x) + cbrt((1.0 + x));
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / fma(cbrt(x), t_0, 1.0);
} else if (x <= -1.0) {
tmp = 1.0 / fma(cbrt(x), t_0, cbrt((x * x)));
} else {
tmp = 1.0 / fma(cbrt(x), t_0, pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(x) + cbrt(Float64(1.0 + x))) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / fma(cbrt(x), t_0, 1.0)); elseif (x <= -1.0) tmp = Float64(1.0 / fma(cbrt(x), t_0, cbrt(Float64(x * x)))); else tmp = Float64(1.0 / fma(cbrt(x), t_0, (Float64(1.0 + x) ^ 0.6666666666666666))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0 + N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0 + N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x} + \sqrt[3]{1 + x}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0, 1\right)}\\
\mathbf{elif}\;x \leq -1:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0, \sqrt[3]{x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 4.8%
flip3--4.8%
div-inv4.8%
rem-cube-cbrt3.6%
rem-cube-cbrt4.8%
cbrt-unprod4.8%
pow24.8%
distribute-rgt-out4.8%
+-commutative4.8%
Applied egg-rr4.8%
associate-*r/4.8%
*-rgt-identity4.8%
+-commutative4.8%
associate--l+4.8%
+-inverses4.8%
metadata-eval4.8%
+-commutative4.8%
fma-def4.8%
+-commutative4.8%
+-commutative4.8%
Simplified4.8%
Taylor expanded in x around 0 20.0%
if -1.35000000000000003e154 < x < -1Initial program 8.8%
flip3--8.9%
div-inv8.9%
rem-cube-cbrt10.0%
rem-cube-cbrt11.0%
cbrt-unprod10.9%
pow210.9%
distribute-rgt-out10.9%
+-commutative10.9%
Applied egg-rr10.9%
associate-*r/10.9%
*-rgt-identity10.9%
+-commutative10.9%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
+-commutative98.6%
fma-def98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
add-exp-log95.6%
pow1/394.5%
log-pow94.5%
log-pow0.0%
log1p-udef0.0%
Applied egg-rr0.0%
associate-*r*0.0%
metadata-eval0.0%
Simplified0.0%
Taylor expanded in x around inf 90.4%
unpow1/394.8%
unpow294.8%
Simplified94.8%
if -1 < x Initial program 70.6%
flip3--70.9%
div-inv70.9%
rem-cube-cbrt70.7%
rem-cube-cbrt71.5%
cbrt-unprod71.6%
pow271.6%
distribute-rgt-out71.6%
+-commutative71.6%
Applied egg-rr71.6%
associate-*r/71.6%
*-rgt-identity71.6%
+-commutative71.6%
associate--l+83.9%
+-inverses83.9%
metadata-eval83.9%
+-commutative83.9%
fma-def83.9%
+-commutative83.9%
+-commutative83.9%
Simplified83.9%
pow1/383.3%
pow-pow97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Final simplification85.9%
(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 54.6%
flip3--54.8%
div-inv54.8%
rem-cube-cbrt54.6%
rem-cube-cbrt55.5%
cbrt-unprod55.5%
pow255.5%
distribute-rgt-out55.5%
+-commutative55.5%
Applied egg-rr55.5%
associate-*r/55.5%
*-rgt-identity55.5%
+-commutative55.5%
associate--l+73.6%
+-inverses73.6%
metadata-eval73.6%
+-commutative73.6%
fma-def73.6%
+-commutative73.6%
+-commutative73.6%
Simplified73.6%
add-sqr-sqrt73.6%
pow273.6%
+-commutative73.6%
pow1/372.7%
pow-pow73.3%
pow-sqr73.3%
+-commutative73.3%
pow1/373.6%
+-commutative73.6%
pow1/399.1%
pow299.1%
+-commutative99.1%
Applied egg-rr99.1%
unpow299.1%
add-sqr-sqrt99.2%
fma-udef99.2%
+-commutative99.2%
+-commutative99.2%
+-commutative99.2%
+-commutative99.2%
distribute-rgt-in99.2%
+-commutative99.2%
pow299.2%
fma-def99.2%
Applied egg-rr99.2%
fma-udef99.2%
unpow299.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(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 54.6%
Final simplification54.6%
(FPCore (x) :precision binary64 (+ 1.0 (- (* x 0.3333333333333333) (cbrt x))))
double code(double x) {
return 1.0 + ((x * 0.3333333333333333) - cbrt(x));
}
public static double code(double x) {
return 1.0 + ((x * 0.3333333333333333) - Math.cbrt(x));
}
function code(x) return Float64(1.0 + Float64(Float64(x * 0.3333333333333333) - cbrt(x))) end
code[x_] := N[(1.0 + N[(N[(x * 0.3333333333333333), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)
\end{array}
Initial program 54.6%
add-cube-cbrt54.2%
pow354.1%
Applied egg-rr54.1%
Taylor expanded in x around 0 27.3%
associate--l+27.3%
*-commutative27.3%
metadata-eval27.3%
pow-base-127.3%
unpow1/352.3%
*-lft-identity52.3%
Simplified52.3%
Final simplification52.3%
(FPCore (x) :precision binary64 (- 1.0 (cbrt x)))
double code(double x) {
return 1.0 - cbrt(x);
}
public static double code(double x) {
return 1.0 - Math.cbrt(x);
}
function code(x) return Float64(1.0 - cbrt(x)) end
code[x_] := N[(1.0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \sqrt[3]{x}
\end{array}
Initial program 54.6%
add-cube-cbrt54.2%
pow354.1%
Applied egg-rr54.1%
Taylor expanded in x around 0 26.6%
metadata-eval26.6%
pow-base-126.6%
unpow1/352.1%
*-lft-identity52.1%
Simplified52.1%
Final simplification52.1%
(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 54.6%
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 54.6%
Taylor expanded in x around 0 50.7%
Final simplification50.7%
herbie shell --seed 2023238
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))