
(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 15 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 (+ t_0 (cbrt x)) (cbrt x) (pow t_0 2.0)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / fma((t_0 + cbrt(x)), cbrt(x), pow(t_0, 2.0));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / fma(Float64(t_0 + cbrt(x)), cbrt(x), (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[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[x, 1/3], $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(t_0 + \sqrt[3]{x}, \sqrt[3]{x}, {t_0}^{2}\right)}
\end{array}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt54.3%
cbrt-unprod54.3%
pow254.3%
distribute-rgt-out54.3%
+-commutative54.3%
Applied egg-rr54.3%
associate-*r/54.3%
*-rgt-identity54.3%
+-commutative54.3%
associate--l+77.0%
+-inverses77.0%
metadata-eval77.0%
+-commutative77.0%
fma-def77.0%
+-commutative77.0%
+-commutative77.0%
Simplified77.0%
fma-udef77.0%
pow1/375.8%
unpow275.8%
pow-prod-down72.4%
+-commutative72.4%
pow1/372.8%
+-commutative72.8%
pow1/399.2%
+-commutative99.2%
pow299.2%
+-commutative99.2%
pow1/349.4%
metadata-eval49.4%
pow-pow49.4%
*-commutative49.4%
pow-pow49.4%
metadata-eval49.4%
pow1/399.2%
Applied egg-rr99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 2e-8)
(/ 1.0 (fma (cbrt x) (+ t_0 (cbrt x)) (cbrt (* x x))))
(- (/ (cbrt (+ 1.0 (pow x 3.0))) (cbrt (fma x x (- 1.0 x)))) (cbrt x)))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 2e-8) {
tmp = 1.0 / fma(cbrt(x), (t_0 + cbrt(x)), cbrt((x * x)));
} else {
tmp = (cbrt((1.0 + pow(x, 3.0))) / cbrt(fma(x, x, (1.0 - x)))) - cbrt(x);
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 2e-8) tmp = Float64(1.0 / fma(cbrt(x), Float64(t_0 + cbrt(x)), cbrt(Float64(x * x)))); else tmp = Float64(Float64(cbrt(Float64(1.0 + (x ^ 3.0))) / cbrt(fma(x, x, Float64(1.0 - x)))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 2e-8], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(1.0 + N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(x * x + N[(1.0 - x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0 + \sqrt[3]{x}, \sqrt[3]{x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{\mathsf{fma}\left(x, x, 1 - x\right)}} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2e-8Initial program 5.2%
flip3--5.2%
div-inv5.2%
rem-cube-cbrt5.2%
rem-cube-cbrt8.1%
cbrt-unprod8.1%
pow28.1%
distribute-rgt-out8.1%
+-commutative8.1%
Applied egg-rr8.1%
associate-*r/8.1%
*-rgt-identity8.1%
+-commutative8.1%
associate--l+53.7%
+-inverses53.7%
metadata-eval53.7%
+-commutative53.7%
fma-def53.8%
+-commutative53.8%
+-commutative53.8%
Simplified53.8%
pow1/351.3%
pow-pow46.1%
metadata-eval46.1%
Applied egg-rr46.1%
Taylor expanded in x around inf 50.9%
unpow1/353.3%
unpow253.3%
Simplified53.3%
if 2e-8 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.7%
flip3-+99.7%
cbrt-div99.7%
pow399.7%
metadata-eval99.7%
+-commutative99.7%
pow399.7%
fma-def99.7%
metadata-eval99.7%
*-rgt-identity99.7%
Applied egg-rr99.7%
Final simplification76.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (- t_0 (cbrt x))))
(if (<= t_1 2e-8)
(/ 1.0 (fma (cbrt x) (+ t_0 (cbrt x)) (cbrt (* x x))))
(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 <= 2e-8) {
tmp = 1.0 / fma(cbrt(x), (t_0 + cbrt(x)), cbrt((x * x)));
} else {
tmp = pow(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 <= 2e-8) tmp = Float64(1.0 / fma(cbrt(x), Float64(t_0 + cbrt(x)), cbrt(Float64(x * x)))); 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, 2e-8], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $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 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_0 + \sqrt[3]{x}, \sqrt[3]{x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({t_1}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2e-8Initial program 5.2%
flip3--5.2%
div-inv5.2%
rem-cube-cbrt5.2%
rem-cube-cbrt8.1%
cbrt-unprod8.1%
pow28.1%
distribute-rgt-out8.1%
+-commutative8.1%
Applied egg-rr8.1%
associate-*r/8.1%
*-rgt-identity8.1%
+-commutative8.1%
associate--l+53.7%
+-inverses53.7%
metadata-eval53.7%
+-commutative53.7%
fma-def53.8%
+-commutative53.8%
+-commutative53.8%
Simplified53.8%
pow1/351.3%
pow-pow46.1%
metadata-eval46.1%
Applied egg-rr46.1%
Taylor expanded in x around inf 50.9%
unpow1/353.3%
unpow253.3%
Simplified53.3%
if 2e-8 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.7%
add-cbrt-cube99.6%
pow1/399.7%
pow399.7%
Applied egg-rr99.7%
Final simplification76.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (cbrt x) (+ (cbrt (+ 1.0 x)) (cbrt x)))))
(if (<= x -1.35e+154)
(/ 1.0 (+ 1.0 t_0))
(if (<= x 1.32e+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((1.0 + x)) + cbrt(x));
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + t_0);
} else if (x <= 1.32e+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((1.0 + x)) + Math.cbrt(x));
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + t_0);
} else if (x <= 1.32e+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(Float64(1.0 + x)) + cbrt(x))) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / Float64(1.0 + t_0)); elseif (x <= 1.32e+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[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.32e+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]{1 + x} + \sqrt[3]{x}\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + t_0}\\
\mathbf{elif}\;x \leq 1.32 \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.35000000000000003e154Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.3%
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%
fma-udef4.7%
pow1/34.7%
unpow24.7%
pow-prod-down0.0%
+-commutative0.0%
pow1/30.0%
+-commutative0.0%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/30.0%
metadata-eval0.0%
pow-pow0.0%
*-commutative0.0%
pow-pow0.0%
metadata-eval0.0%
pow1/398.5%
Applied egg-rr98.5%
Taylor expanded in x around 0 20.0%
if -1.35000000000000003e154 < x < 1.31999999999999998e154Initial program 67.8%
flip3--67.8%
div-inv67.8%
rem-cube-cbrt68.2%
rem-cube-cbrt69.8%
cbrt-unprod69.8%
pow269.8%
distribute-rgt-out69.8%
+-commutative69.8%
Applied egg-rr69.8%
associate-*r/69.8%
*-rgt-identity69.8%
+-commutative69.8%
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.0%
unpow298.0%
pow-prod-down81.0%
+-commutative81.0%
pow1/381.3%
+-commutative81.3%
pow1/399.4%
+-commutative99.4%
pow299.4%
+-commutative99.4%
pow1/350.8%
metadata-eval50.8%
pow-pow50.8%
*-commutative50.8%
pow-pow50.8%
metadata-eval50.8%
pow1/399.4%
Applied egg-rr99.4%
unpow299.4%
cbrt-unprod99.6%
pow299.6%
Applied egg-rr99.6%
if 1.31999999999999998e154 < x Initial program 4.8%
flip3--4.8%
div-inv4.8%
rem-cube-cbrt3.3%
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%
pow1/34.8%
pow-pow91.6%
metadata-eval91.6%
Applied egg-rr91.6%
fma-udef91.6%
add-exp-log92.8%
log-pow92.2%
log1p-udef92.2%
Applied egg-rr92.2%
Final simplification89.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (cbrt (+ 1.0 x)) (cbrt x))) (t_1 (* (cbrt x) t_0)))
(if (<= x -1.35e+154)
(/ 1.0 (+ 1.0 t_1))
(if (<= x -1.0)
(/ 1.0 (fma (cbrt x) t_0 (cbrt (* x x))))
(/ 1.0 (+ t_1 (exp (* 0.6666666666666666 (log1p x)))))))))
double code(double x) {
double t_0 = cbrt((1.0 + x)) + cbrt(x);
double t_1 = cbrt(x) * t_0;
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + t_1);
} else if (x <= -1.0) {
tmp = 1.0 / fma(cbrt(x), t_0, cbrt((x * x)));
} else {
tmp = 1.0 / (t_1 + exp((0.6666666666666666 * log1p(x))));
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(1.0 + x)) + cbrt(x)) t_1 = Float64(cbrt(x) * t_0) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / Float64(1.0 + t_1)); elseif (x <= -1.0) tmp = Float64(1.0 / fma(cbrt(x), t_0, cbrt(Float64(x * x)))); else tmp = Float64(1.0 / Float64(t_1 + exp(Float64(0.6666666666666666 * log1p(x))))); end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $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[(1.0 + t$95$1), $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[(t$95$1 + N[Exp[N[(0.6666666666666666 * N[Log[1 + x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} + \sqrt[3]{x}\\
t_1 := \sqrt[3]{x} \cdot t_0\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + t_1}\\
\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}{t_1 + e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.3%
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%
fma-udef4.7%
pow1/34.7%
unpow24.7%
pow-prod-down0.0%
+-commutative0.0%
pow1/30.0%
+-commutative0.0%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/30.0%
metadata-eval0.0%
pow-pow0.0%
*-commutative0.0%
pow-pow0.0%
metadata-eval0.0%
pow1/398.5%
Applied egg-rr98.5%
Taylor expanded in x around 0 20.0%
if -1.35000000000000003e154 < x < -1Initial program 9.6%
flip3--9.6%
div-inv9.6%
rem-cube-cbrt11.2%
rem-cube-cbrt14.9%
cbrt-unprod15.0%
pow215.0%
distribute-rgt-out15.0%
+-commutative15.0%
Applied egg-rr15.0%
associate-*r/15.0%
*-rgt-identity15.0%
+-commutative15.0%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
+-commutative98.8%
fma-def99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
pow1/394.5%
pow-pow0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 90.6%
unpow1/394.9%
unpow294.9%
Simplified94.9%
if -1 < x Initial program 68.6%
flip3--68.6%
div-inv68.6%
rem-cube-cbrt68.4%
rem-cube-cbrt69.7%
cbrt-unprod69.7%
pow269.7%
distribute-rgt-out69.7%
+-commutative69.7%
Applied egg-rr69.7%
associate-*r/69.7%
*-rgt-identity69.7%
+-commutative69.7%
associate--l+84.7%
+-inverses84.7%
metadata-eval84.7%
+-commutative84.7%
fma-def84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
pow1/383.9%
pow-pow97.6%
metadata-eval97.6%
Applied egg-rr97.6%
fma-udef97.6%
add-exp-log97.8%
log-pow97.7%
log1p-udef97.7%
Applied egg-rr97.7%
Final simplification87.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (+ (cbrt (+ 1.0 x)) (cbrt x))))
(if (<= x -1.35e+154)
(/ 1.0 (+ 1.0 (* (cbrt x) t_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((1.0 + x)) + cbrt(x);
double tmp;
if (x <= -1.35e+154) {
tmp = 1.0 / (1.0 + (cbrt(x) * t_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(Float64(1.0 + x)) + cbrt(x)) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * t_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[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0), $MachinePrecision]), $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]{1 + x} + \sqrt[3]{x}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot t_0}\\
\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.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.3%
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%
fma-udef4.7%
pow1/34.7%
unpow24.7%
pow-prod-down0.0%
+-commutative0.0%
pow1/30.0%
+-commutative0.0%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/30.0%
metadata-eval0.0%
pow-pow0.0%
*-commutative0.0%
pow-pow0.0%
metadata-eval0.0%
pow1/398.5%
Applied egg-rr98.5%
Taylor expanded in x around 0 20.0%
if -1.35000000000000003e154 < x < -1Initial program 9.6%
flip3--9.6%
div-inv9.6%
rem-cube-cbrt11.2%
rem-cube-cbrt14.9%
cbrt-unprod15.0%
pow215.0%
distribute-rgt-out15.0%
+-commutative15.0%
Applied egg-rr15.0%
associate-*r/15.0%
*-rgt-identity15.0%
+-commutative15.0%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
+-commutative98.8%
fma-def99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
pow1/394.5%
pow-pow0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 90.6%
unpow1/394.9%
unpow294.9%
Simplified94.9%
if -1 < x Initial program 68.6%
flip3--68.6%
div-inv68.6%
rem-cube-cbrt68.4%
rem-cube-cbrt69.7%
cbrt-unprod69.7%
pow269.7%
distribute-rgt-out69.7%
+-commutative69.7%
Applied egg-rr69.7%
associate-*r/69.7%
*-rgt-identity69.7%
+-commutative69.7%
associate--l+84.7%
+-inverses84.7%
metadata-eval84.7%
+-commutative84.7%
fma-def84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
pow1/383.9%
pow-pow97.6%
metadata-eval97.6%
Applied egg-rr97.6%
Final simplification87.8%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ 1.0 x)))) (/ 1.0 (+ (pow t_0 2.0) (* (cbrt x) (+ t_0 (cbrt x)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
return 1.0 / (pow(t_0, 2.0) + (cbrt(x) * (t_0 + cbrt(x))));
}
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) * (t_0 + Math.cbrt(x))));
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) return Float64(1.0 / Float64((t_0 ^ 2.0) + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))) 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[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $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(t_0 + \sqrt[3]{x}\right)}
\end{array}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt54.3%
cbrt-unprod54.3%
pow254.3%
distribute-rgt-out54.3%
+-commutative54.3%
Applied egg-rr54.3%
associate-*r/54.3%
*-rgt-identity54.3%
+-commutative54.3%
associate--l+77.0%
+-inverses77.0%
metadata-eval77.0%
+-commutative77.0%
fma-def77.0%
+-commutative77.0%
+-commutative77.0%
Simplified77.0%
fma-udef77.0%
pow1/375.8%
unpow275.8%
pow-prod-down72.4%
+-commutative72.4%
pow1/372.8%
+-commutative72.8%
pow1/399.2%
+-commutative99.2%
pow299.2%
+-commutative99.2%
pow1/349.4%
metadata-eval49.4%
pow-pow49.4%
*-commutative49.4%
pow-pow49.4%
metadata-eval49.4%
pow1/399.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x)
:precision binary64
(if (or (<= x -1.0) (not (<= x 1.32e+154)))
(/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt (+ 1.0 x)) (cbrt x)))))
(/
1.0
(+
(+ (exp (* 0.6666666666666666 (log1p x))) (cbrt (* x x)))
(cbrt (* x (+ 1.0 x)))))))
double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 1.32e+154)) {
tmp = 1.0 / (1.0 + (cbrt(x) * (cbrt((1.0 + x)) + cbrt(x))));
} else {
tmp = 1.0 / ((exp((0.6666666666666666 * log1p(x))) + cbrt((x * x))) + cbrt((x * (1.0 + x))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 1.32e+154)) {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt((1.0 + x)) + Math.cbrt(x))));
} else {
tmp = 1.0 / ((Math.exp((0.6666666666666666 * Math.log1p(x))) + Math.cbrt((x * x))) + Math.cbrt((x * (1.0 + x))));
}
return tmp;
}
function code(x) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.32e+154)) tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(Float64(1.0 + x)) + cbrt(x))))); else tmp = Float64(1.0 / Float64(Float64(exp(Float64(0.6666666666666666 * log1p(x))) + cbrt(Float64(x * x))) + cbrt(Float64(x * Float64(1.0 + x))))); end return tmp end
code[x_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 1.32e+154]], $MachinePrecision]], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[Exp[N[(0.6666666666666666 * N[Log[1 + x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Power[N[(x * x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1.32 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)} + \sqrt[3]{x \cdot x}\right) + \sqrt[3]{x \cdot \left(1 + x\right)}}\\
\end{array}
\end{array}
if x < -1 or 1.31999999999999998e154 < x Initial program 6.5%
flip3--6.5%
div-inv6.5%
rem-cube-cbrt6.2%
rem-cube-cbrt8.5%
cbrt-unprod8.5%
pow28.5%
distribute-rgt-out8.5%
+-commutative8.5%
Applied egg-rr8.5%
associate-*r/8.5%
*-rgt-identity8.5%
+-commutative8.5%
associate--l+39.1%
+-inverses39.1%
metadata-eval39.1%
+-commutative39.1%
fma-def39.1%
+-commutative39.1%
+-commutative39.1%
Simplified39.1%
fma-udef39.1%
pow1/337.5%
unpow237.5%
pow-prod-down28.6%
+-commutative28.6%
pow1/329.1%
+-commutative29.1%
pow1/398.4%
+-commutative98.4%
pow298.4%
+-commutative98.4%
pow1/328.6%
metadata-eval28.6%
pow-pow28.6%
*-commutative28.6%
pow-pow28.6%
metadata-eval28.6%
pow1/398.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 20.0%
if -1 < x < 1.31999999999999998e154Initial program 80.6%
flip3--80.5%
div-inv80.5%
rem-cube-cbrt80.7%
rem-cube-cbrt81.8%
cbrt-unprod81.8%
pow281.8%
distribute-rgt-out81.8%
+-commutative81.8%
Applied egg-rr81.8%
associate-*r/81.8%
*-rgt-identity81.8%
+-commutative81.8%
associate--l+99.7%
+-inverses99.7%
metadata-eval99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
pow1/398.7%
pow-pow98.7%
metadata-eval98.7%
Applied egg-rr98.7%
fma-udef98.7%
metadata-eval98.7%
pow-pow98.7%
pow1/399.6%
+-commutative99.6%
+-commutative99.6%
distribute-rgt-in99.6%
associate-+r+99.6%
pow1/398.7%
pow-pow98.7%
metadata-eval98.7%
add-exp-log98.8%
log-pow98.7%
log1p-udef98.7%
cbrt-unprod98.7%
Applied egg-rr98.7%
Final simplification69.2%
(FPCore (x) :precision binary64 (let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x)))) (if (<= t_0 0.0) (cbrt (/ (/ 1.0 x) x)) t_0)))
double code(double x) {
double t_0 = cbrt((1.0 + x)) - cbrt(x);
double tmp;
if (t_0 <= 0.0) {
tmp = cbrt(((1.0 / x) / x));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x)) - Math.cbrt(x);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.cbrt(((1.0 / x) / x));
} else {
tmp = t_0;
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) tmp = 0.0 if (t_0 <= 0.0) tmp = cbrt(Float64(Float64(1.0 / x) / x)); else tmp = t_0; end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Power[N[(N[(1.0 / x), $MachinePrecision] / x), $MachinePrecision], 1/3], $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt[3]{\frac{\frac{1}{x}}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\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.1%
rem-cube-cbrt5.1%
cbrt-unprod5.1%
pow25.1%
distribute-rgt-out5.1%
+-commutative5.1%
Applied egg-rr5.1%
associate-*r/5.1%
*-rgt-identity5.1%
+-commutative5.1%
associate--l+52.2%
+-inverses52.2%
metadata-eval52.2%
+-commutative52.2%
fma-def52.3%
+-commutative52.3%
+-commutative52.3%
Simplified52.3%
fma-udef52.2%
pow1/349.8%
unpow249.8%
pow-prod-down46.0%
+-commutative46.0%
pow1/346.8%
+-commutative46.8%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/346.0%
metadata-eval46.0%
pow-pow46.0%
*-commutative46.0%
pow-pow46.0%
metadata-eval46.0%
pow1/398.5%
Applied egg-rr98.5%
+-commutative98.5%
fma-def98.6%
Simplified98.6%
add-cube-cbrt97.7%
pow397.6%
Applied egg-rr46.2%
Taylor expanded in x around inf 11.3%
metadata-eval11.3%
pow-base-111.3%
*-lft-identity11.3%
unpow1/311.3%
unpow211.3%
associate-/r*11.6%
Simplified11.6%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.8%
Final simplification56.4%
(FPCore (x) :precision binary64 (/ 1.0 (+ 1.0 (* (cbrt x) (+ (cbrt (+ 1.0 x)) (cbrt x))))))
double code(double x) {
return 1.0 / (1.0 + (cbrt(x) * (cbrt((1.0 + x)) + cbrt(x))));
}
public static double code(double x) {
return 1.0 / (1.0 + (Math.cbrt(x) * (Math.cbrt((1.0 + x)) + Math.cbrt(x))));
}
function code(x) return Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(cbrt(Float64(1.0 + x)) + cbrt(x))))) end
code[x_] := N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{1 + x} + \sqrt[3]{x}\right)}
\end{array}
Initial program 52.8%
flip3--52.8%
div-inv52.8%
rem-cube-cbrt52.7%
rem-cube-cbrt54.3%
cbrt-unprod54.3%
pow254.3%
distribute-rgt-out54.3%
+-commutative54.3%
Applied egg-rr54.3%
associate-*r/54.3%
*-rgt-identity54.3%
+-commutative54.3%
associate--l+77.0%
+-inverses77.0%
metadata-eval77.0%
+-commutative77.0%
fma-def77.0%
+-commutative77.0%
+-commutative77.0%
Simplified77.0%
fma-udef77.0%
pow1/375.8%
unpow275.8%
pow-prod-down72.4%
+-commutative72.4%
pow1/372.8%
+-commutative72.8%
pow1/399.2%
+-commutative99.2%
pow299.2%
+-commutative99.2%
pow1/349.4%
metadata-eval49.4%
pow-pow49.4%
*-commutative49.4%
pow-pow49.4%
metadata-eval49.4%
pow1/399.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 59.1%
Final simplification59.1%
(FPCore (x) :precision binary64 (if (or (<= x -0.95) (not (<= x 2.7))) (cbrt (/ (/ 1.0 x) x)) (+ 1.0 (- (* x 0.3333333333333333) (cbrt x)))))
double code(double x) {
double tmp;
if ((x <= -0.95) || !(x <= 2.7)) {
tmp = cbrt(((1.0 / x) / x));
} else {
tmp = 1.0 + ((x * 0.3333333333333333) - cbrt(x));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x <= -0.95) || !(x <= 2.7)) {
tmp = Math.cbrt(((1.0 / x) / x));
} else {
tmp = 1.0 + ((x * 0.3333333333333333) - Math.cbrt(x));
}
return tmp;
}
function code(x) tmp = 0.0 if ((x <= -0.95) || !(x <= 2.7)) tmp = cbrt(Float64(Float64(1.0 / x) / x)); else tmp = Float64(1.0 + Float64(Float64(x * 0.3333333333333333) - cbrt(x))); end return tmp end
code[x_] := If[Or[LessEqual[x, -0.95], N[Not[LessEqual[x, 2.7]], $MachinePrecision]], N[Power[N[(N[(1.0 / x), $MachinePrecision] / x), $MachinePrecision], 1/3], $MachinePrecision], N[(1.0 + N[(N[(x * 0.3333333333333333), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.95 \lor \neg \left(x \leq 2.7\right):\\
\;\;\;\;\sqrt[3]{\frac{\frac{1}{x}}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot 0.3333333333333333 - \sqrt[3]{x}\right)\\
\end{array}
\end{array}
if x < -0.94999999999999996 or 2.7000000000000002 < x Initial program 6.4%
flip3--6.4%
div-inv6.4%
rem-cube-cbrt6.3%
rem-cube-cbrt9.5%
cbrt-unprod9.5%
pow29.5%
distribute-rgt-out9.5%
+-commutative9.5%
Applied egg-rr9.5%
associate-*r/9.5%
*-rgt-identity9.5%
+-commutative9.5%
associate--l+54.4%
+-inverses54.4%
metadata-eval54.4%
+-commutative54.4%
fma-def54.5%
+-commutative54.5%
+-commutative54.5%
Simplified54.5%
fma-udef54.4%
pow1/352.0%
unpow252.0%
pow-prod-down45.4%
+-commutative45.4%
pow1/346.2%
+-commutative46.2%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/345.4%
metadata-eval45.4%
pow-pow45.4%
*-commutative45.4%
pow-pow45.4%
metadata-eval45.4%
pow1/398.5%
Applied egg-rr98.5%
+-commutative98.5%
fma-def98.6%
Simplified98.6%
add-cube-cbrt97.7%
pow397.6%
Applied egg-rr45.6%
Taylor expanded in x around inf 11.6%
metadata-eval11.6%
pow-base-111.6%
*-lft-identity11.6%
unpow1/311.6%
unpow211.6%
associate-/r*11.9%
Simplified11.9%
if -0.94999999999999996 < x < 2.7000000000000002Initial program 100.0%
add-sqr-sqrt53.5%
pow253.5%
pow1/353.5%
sqrt-pow153.5%
metadata-eval53.5%
Applied egg-rr53.5%
Taylor expanded in x around 0 53.2%
unpow1/399.6%
*-lft-identity99.6%
pow-base-199.6%
metadata-eval99.6%
unpow1/353.2%
associate--l+53.2%
*-commutative53.2%
metadata-eval53.2%
pow-base-153.2%
unpow1/399.6%
*-lft-identity99.6%
Simplified99.6%
Final simplification55.4%
(FPCore (x) :precision binary64 (if (or (<= x -0.43) (not (<= x 0.8))) (cbrt (/ (/ 1.0 x) x)) (- 1.0 (cbrt x))))
double code(double x) {
double tmp;
if ((x <= -0.43) || !(x <= 0.8)) {
tmp = cbrt(((1.0 / x) / x));
} else {
tmp = 1.0 - cbrt(x);
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x <= -0.43) || !(x <= 0.8)) {
tmp = Math.cbrt(((1.0 / x) / x));
} else {
tmp = 1.0 - Math.cbrt(x);
}
return tmp;
}
function code(x) tmp = 0.0 if ((x <= -0.43) || !(x <= 0.8)) tmp = cbrt(Float64(Float64(1.0 / x) / x)); else tmp = Float64(1.0 - cbrt(x)); end return tmp end
code[x_] := If[Or[LessEqual[x, -0.43], N[Not[LessEqual[x, 0.8]], $MachinePrecision]], N[Power[N[(N[(1.0 / x), $MachinePrecision] / x), $MachinePrecision], 1/3], $MachinePrecision], N[(1.0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.43 \lor \neg \left(x \leq 0.8\right):\\
\;\;\;\;\sqrt[3]{\frac{\frac{1}{x}}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt[3]{x}\\
\end{array}
\end{array}
if x < -0.429999999999999993 or 0.80000000000000004 < x Initial program 6.4%
flip3--6.4%
div-inv6.4%
rem-cube-cbrt6.3%
rem-cube-cbrt9.5%
cbrt-unprod9.5%
pow29.5%
distribute-rgt-out9.5%
+-commutative9.5%
Applied egg-rr9.5%
associate-*r/9.5%
*-rgt-identity9.5%
+-commutative9.5%
associate--l+54.4%
+-inverses54.4%
metadata-eval54.4%
+-commutative54.4%
fma-def54.5%
+-commutative54.5%
+-commutative54.5%
Simplified54.5%
fma-udef54.4%
pow1/352.0%
unpow252.0%
pow-prod-down45.4%
+-commutative45.4%
pow1/346.2%
+-commutative46.2%
pow1/398.5%
+-commutative98.5%
pow298.5%
+-commutative98.5%
pow1/345.4%
metadata-eval45.4%
pow-pow45.4%
*-commutative45.4%
pow-pow45.4%
metadata-eval45.4%
pow1/398.5%
Applied egg-rr98.5%
+-commutative98.5%
fma-def98.6%
Simplified98.6%
add-cube-cbrt97.7%
pow397.6%
Applied egg-rr45.6%
Taylor expanded in x around inf 11.6%
metadata-eval11.6%
pow-base-111.6%
*-lft-identity11.6%
unpow1/311.6%
unpow211.6%
associate-/r*11.9%
Simplified11.9%
if -0.429999999999999993 < x < 0.80000000000000004Initial program 100.0%
add-sqr-sqrt53.5%
pow253.5%
pow1/353.5%
sqrt-pow153.5%
metadata-eval53.5%
Applied egg-rr53.5%
Taylor expanded in x around 0 52.7%
unpow1/399.0%
Simplified99.0%
Final simplification55.1%
(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 52.8%
add-sqr-sqrt27.9%
pow227.9%
pow1/328.2%
sqrt-pow128.2%
metadata-eval28.2%
Applied egg-rr28.2%
Taylor expanded in x around 0 26.6%
unpow1/350.9%
Simplified50.9%
Final simplification50.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.8%
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 52.8%
Taylor expanded in x around 0 49.6%
Final simplification49.6%
herbie shell --seed 2023201
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))