
(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)))) (/ 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 53.3%
flip3--53.5%
div-inv53.5%
rem-cube-cbrt53.1%
rem-cube-cbrt54.6%
+-commutative54.6%
distribute-rgt-out54.6%
+-commutative54.6%
fma-def54.6%
add-exp-log54.6%
Applied egg-rr51.3%
associate-*r/51.3%
*-rgt-identity51.3%
+-commutative51.3%
associate--l+71.0%
+-inverses71.0%
metadata-eval71.0%
+-commutative71.0%
exp-prod70.9%
Simplified70.9%
metadata-eval70.9%
prod-exp70.9%
pow-prod-down71.2%
pow-to-exp71.1%
add-exp-log71.1%
prod-exp71.0%
rem-log-exp71.0%
log1p-udef71.0%
+-commutative71.0%
log-pow71.0%
pow1/371.1%
pow-exp71.0%
add-log-exp71.1%
log1p-udef71.1%
+-commutative71.1%
log-pow71.1%
pow1/371.1%
rem-cube-cbrt71.1%
pow-to-exp71.0%
Applied egg-rr99.1%
unpow299.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))))
(pow (pow t_1 3.0) 0.3333333333333333))))
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 = pow(pow(t_1, 3.0), 0.3333333333333333);
}
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.pow(Math.pow(t_1, 3.0), 0.3333333333333333);
}
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 ^ 3.0) ^ 0.3333333333333333; 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[Power[N[Power[t$95$1, 3.0], $MachinePrecision], 0.3333333333333333], $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}:\\
\;\;\;\;{\left({t_1}^{3}\right)}^{0.3333333333333333}\\
\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-cbrt4.0%
rem-cube-cbrt4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.0%
associate-*r/2.0%
*-rgt-identity2.0%
+-commutative2.0%
associate--l+43.7%
+-inverses43.7%
metadata-eval43.7%
+-commutative43.7%
exp-prod43.6%
Simplified43.6%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.2%
add-cbrt-cube97.2%
pow1/397.2%
pow397.2%
Applied egg-rr97.2%
Final simplification60.7%
(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%
flip3--4.2%
div-inv4.2%
rem-cube-cbrt4.0%
rem-cube-cbrt4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.0%
associate-*r/2.0%
*-rgt-identity2.0%
+-commutative2.0%
associate--l+43.7%
+-inverses43.7%
metadata-eval43.7%
+-commutative43.7%
exp-prod43.6%
Simplified43.6%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.2%
add-exp-log97.2%
Applied egg-rr97.2%
Final simplification60.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (cbrt x) (+ (cbrt x) (cbrt (+ 1.0 x))))))
(if (<= x -1.32e+154)
(/ 1.0 (+ 1.0 t_0))
(if (<= x 1.3e+154)
(/ 1.0 (+ t_0 (cbrt (pow (+ 1.0 x) 2.0))))
(/ 1.0 (+ t_0 (exp (* 0.6666666666666666 (log1p x)))))))))
double code(double x) {
double t_0 = cbrt(x) * (cbrt(x) + cbrt((1.0 + x)));
double tmp;
if (x <= -1.32e+154) {
tmp = 1.0 / (1.0 + t_0);
} else if (x <= 1.3e+154) {
tmp = 1.0 / (t_0 + cbrt(pow((1.0 + x), 2.0)));
} else {
tmp = 1.0 / (t_0 + exp((0.6666666666666666 * log1p(x))));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt(x) * (Math.cbrt(x) + Math.cbrt((1.0 + x)));
double tmp;
if (x <= -1.32e+154) {
tmp = 1.0 / (1.0 + t_0);
} else if (x <= 1.3e+154) {
tmp = 1.0 / (t_0 + Math.cbrt(Math.pow((1.0 + x), 2.0)));
} else {
tmp = 1.0 / (t_0 + Math.exp((0.6666666666666666 * Math.log1p(x))));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(x) * Float64(cbrt(x) + cbrt(Float64(1.0 + x)))) tmp = 0.0 if (x <= -1.32e+154) tmp = Float64(1.0 / Float64(1.0 + t_0)); elseif (x <= 1.3e+154) tmp = Float64(1.0 / Float64(t_0 + cbrt((Float64(1.0 + x) ^ 2.0)))); else tmp = Float64(1.0 / Float64(t_0 + exp(Float64(0.6666666666666666 * log1p(x))))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.32e+154], N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+154], N[(1.0 / N[(t$95$0 + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 + N[Exp[N[(0.6666666666666666 * N[Log[1 + x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\
\mathbf{if}\;x \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + t_0}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{t_0 + \sqrt[3]{{\left(1 + x\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_0 + e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}}\\
\end{array}
\end{array}
if x < -1.31999999999999998e154Initial program 4.6%
flip3--4.6%
div-inv4.6%
rem-cube-cbrt3.3%
rem-cube-cbrt4.6%
+-commutative4.6%
distribute-rgt-out4.6%
+-commutative4.6%
fma-def4.6%
add-exp-log4.6%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
+-commutative0.0%
associate--l+0.0%
+-inverses0.0%
metadata-eval0.0%
+-commutative0.0%
exp-prod0.0%
Simplified0.0%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if -1.31999999999999998e154 < x < 1.29999999999999994e154Initial program 70.1%
flip3--70.5%
div-inv70.5%
rem-cube-cbrt70.5%
rem-cube-cbrt72.0%
+-commutative72.0%
distribute-rgt-out71.9%
+-commutative71.9%
fma-def72.0%
add-exp-log71.9%
Applied egg-rr68.4%
associate-*r/68.4%
*-rgt-identity68.4%
+-commutative68.4%
associate--l+81.7%
+-inverses81.7%
metadata-eval81.7%
+-commutative81.7%
exp-prod81.7%
Simplified81.7%
metadata-eval81.7%
prod-exp81.7%
pow-prod-down81.9%
pow-to-exp81.8%
add-exp-log81.8%
prod-exp81.7%
rem-log-exp81.7%
log1p-udef81.7%
+-commutative81.7%
log-pow81.7%
pow1/381.7%
pow-exp81.7%
add-log-exp81.7%
log1p-udef81.7%
+-commutative81.7%
log-pow81.8%
pow1/381.8%
rem-cube-cbrt81.7%
pow-to-exp81.6%
Applied egg-rr99.4%
unpow299.4%
+-commutative99.4%
Simplified99.4%
fma-udef99.4%
+-commutative99.4%
Applied egg-rr99.4%
unpow299.4%
+-commutative99.4%
+-commutative99.4%
cbrt-unprod99.5%
pow299.5%
+-commutative99.5%
Applied egg-rr99.5%
if 1.29999999999999994e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt2.5%
rem-cube-cbrt4.7%
+-commutative4.7%
distribute-rgt-out4.7%
+-commutative4.7%
fma-def4.7%
add-exp-log4.7%
Applied egg-rr4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
+-commutative91.4%
exp-prod91.1%
Simplified91.1%
metadata-eval91.1%
prod-exp91.1%
pow-prod-down92.1%
pow-to-exp91.9%
add-exp-log91.6%
prod-exp91.4%
rem-log-exp91.4%
log1p-udef91.4%
+-commutative91.4%
log-pow91.4%
pow1/391.7%
pow-exp91.7%
add-log-exp91.7%
log1p-udef91.7%
+-commutative91.7%
log-pow92.1%
pow1/392.3%
rem-cube-cbrt92.3%
pow-to-exp92.0%
Applied egg-rr98.1%
unpow298.1%
+-commutative98.1%
Simplified98.1%
fma-udef98.1%
+-commutative98.1%
Applied egg-rr98.1%
add-exp-log92.3%
log-pow92.3%
pow1/391.8%
+-commutative91.8%
log-pow91.4%
+-commutative91.4%
log1p-udef91.4%
Applied egg-rr91.4%
associate-*r*91.4%
metadata-eval91.4%
Simplified91.4%
Final simplification87.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)))) 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%
flip3--4.2%
div-inv4.2%
rem-cube-cbrt4.0%
rem-cube-cbrt4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.0%
associate-*r/2.0%
*-rgt-identity2.0%
+-commutative2.0%
associate--l+43.7%
+-inverses43.7%
metadata-eval43.7%
+-commutative43.7%
exp-prod43.6%
Simplified43.6%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.2%
Final simplification60.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (cbrt x) (+ (cbrt x) (cbrt (+ 1.0 x))))))
(if (<= x -1.0)
(/ 1.0 (+ 1.0 t_0))
(/ 1.0 (+ t_0 (exp (* 0.6666666666666666 (log1p x))))))))
double code(double x) {
double t_0 = cbrt(x) * (cbrt(x) + cbrt((1.0 + x)));
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + t_0);
} else {
tmp = 1.0 / (t_0 + exp((0.6666666666666666 * log1p(x))));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt(x) * (Math.cbrt(x) + Math.cbrt((1.0 + x)));
double tmp;
if (x <= -1.0) {
tmp = 1.0 / (1.0 + t_0);
} else {
tmp = 1.0 / (t_0 + Math.exp((0.6666666666666666 * Math.log1p(x))));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(x) * Float64(cbrt(x) + cbrt(Float64(1.0 + x)))) tmp = 0.0 if (x <= -1.0) tmp = Float64(1.0 / Float64(1.0 + t_0)); else tmp = Float64(1.0 / Float64(t_0 + exp(Float64(0.6666666666666666 * log1p(x))))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 + N[Exp[N[(0.6666666666666666 * N[Log[1 + x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \sqrt[3]{1 + x}\right)\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{1}{1 + t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_0 + e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}}\\
\end{array}
\end{array}
if x < -1Initial program 8.5%
flip3--9.3%
div-inv9.3%
rem-cube-cbrt8.7%
rem-cube-cbrt12.3%
+-commutative12.3%
distribute-rgt-out12.3%
+-commutative12.3%
fma-def12.3%
add-exp-log12.2%
Applied egg-rr0.0%
associate-*r/0.0%
*-rgt-identity0.0%
+-commutative0.0%
associate--l+0.0%
+-inverses0.0%
metadata-eval0.0%
+-commutative0.0%
exp-prod0.0%
Simplified0.0%
Taylor expanded in x around 0 20.0%
fma-udef20.0%
Applied egg-rr20.0%
if -1 < x Initial program 70.1%
flip3--70.2%
div-inv70.2%
rem-cube-cbrt69.8%
rem-cube-cbrt70.5%
+-commutative70.5%
distribute-rgt-out70.5%
+-commutative70.5%
fma-def70.5%
add-exp-log70.6%
Applied egg-rr70.6%
associate-*r/70.6%
*-rgt-identity70.6%
+-commutative70.6%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
+-commutative97.7%
exp-prod97.6%
Simplified97.6%
metadata-eval97.6%
prod-exp97.6%
pow-prod-down98.0%
pow-to-exp97.9%
add-exp-log97.8%
prod-exp97.7%
rem-log-exp97.7%
log1p-udef97.7%
+-commutative97.7%
log-pow97.7%
pow1/397.8%
pow-exp97.8%
add-log-exp97.8%
log1p-udef97.8%
+-commutative97.8%
log-pow97.9%
pow1/397.9%
rem-cube-cbrt97.8%
pow-to-exp97.7%
Applied egg-rr99.4%
unpow299.4%
+-commutative99.4%
Simplified99.4%
fma-udef99.4%
+-commutative99.4%
Applied egg-rr99.4%
add-exp-log97.9%
log-pow97.9%
pow1/397.8%
+-commutative97.8%
log-pow97.7%
+-commutative97.7%
log1p-udef97.7%
Applied egg-rr97.7%
associate-*r*97.7%
metadata-eval97.7%
Simplified97.7%
Final simplification76.5%
(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 53.3%
flip3--53.5%
div-inv53.5%
rem-cube-cbrt53.1%
rem-cube-cbrt54.6%
+-commutative54.6%
distribute-rgt-out54.6%
+-commutative54.6%
fma-def54.6%
add-exp-log54.6%
Applied egg-rr51.3%
associate-*r/51.3%
*-rgt-identity51.3%
+-commutative51.3%
associate--l+71.0%
+-inverses71.0%
metadata-eval71.0%
+-commutative71.0%
exp-prod70.9%
Simplified70.9%
metadata-eval70.9%
prod-exp70.9%
pow-prod-down71.2%
pow-to-exp71.1%
add-exp-log71.1%
prod-exp71.0%
rem-log-exp71.0%
log1p-udef71.0%
+-commutative71.0%
log-pow71.0%
pow1/371.1%
pow-exp71.0%
add-log-exp71.1%
log1p-udef71.1%
+-commutative71.1%
log-pow71.1%
pow1/371.1%
rem-cube-cbrt71.1%
pow-to-exp71.0%
Applied egg-rr99.1%
unpow299.1%
+-commutative99.1%
Simplified99.1%
fma-udef99.1%
+-commutative99.1%
Applied egg-rr99.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 53.3%
Final simplification53.3%
(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 53.3%
Taylor expanded in x around inf 3.6%
Final simplification3.6%
(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 53.3%
Taylor expanded in x around 0 48.1%
Final simplification48.1%
herbie shell --seed 2023333
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))