
(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 16 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 (+ x 1.0))) (t_1 (+ t_0 (cbrt x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (fma (cbrt x) t_1 (pow (cbrt x) 2.0)))
(/ (- (+ x 1.0) x) (fma (cbrt x) t_1 (cbrt (pow (+ x 1.0) 2.0)))))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
double t_1 = t_0 + cbrt(x);
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / fma(cbrt(x), t_1, pow(cbrt(x), 2.0));
} else {
tmp = ((x + 1.0) - x) / fma(cbrt(x), t_1, cbrt(pow((x + 1.0), 2.0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) t_1 = Float64(t_0 + cbrt(x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / fma(cbrt(x), t_1, (cbrt(x) ^ 2.0))); else tmp = Float64(Float64(Float64(x + 1.0) - x) / fma(cbrt(x), t_1, cbrt((Float64(x + 1.0) ^ 2.0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + N[Power[N[Power[N[(x + 1.0), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := t_0 + \sqrt[3]{x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(\sqrt[3]{x}\right)}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, \sqrt[3]{{\left(x + 1\right)}^{2}}\right)}\\
\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.7%
rem-cube-cbrt4.2%
reciprocal-define4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.3%
reciprocal-undefine2.3%
associate-*r/2.3%
*-rgt-identity2.3%
+-commutative2.3%
associate--l+50.0%
+-inverses50.0%
metadata-eval50.0%
reciprocal-undefine21.3%
+-commutative21.3%
exp-prod21.3%
Simplified21.3%
reciprocal-undefine49.8%
+-commutative49.8%
+-commutative49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.7%
expm1-log1p-u49.7%
expm1-udef49.7%
unpow1/350.0%
unpow250.0%
cbrt-prod93.9%
pow293.9%
Applied egg-rr93.9%
expm1-def93.9%
expm1-log1p98.6%
Simplified98.6%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 96.7%
flip3--97.8%
rem-cube-cbrt97.2%
rem-cube-cbrt99.8%
+-commutative99.8%
distribute-rgt-out99.8%
+-commutative99.8%
fma-def99.8%
add-exp-log99.8%
pow1/395.6%
pow1/395.5%
pow-prod-up95.6%
Applied egg-rr95.6%
*-commutative95.6%
log1p-udef95.6%
+-commutative95.6%
exp-to-pow95.6%
metadata-eval95.6%
pow-prod-up95.5%
pow1/395.6%
pow1/399.8%
cbrt-unprod99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.3%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))) (t_1 (+ t_0 (cbrt x))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (fma (cbrt x) t_1 (pow (cbrt x) 2.0)))
(/ (- (+ x 1.0) x) (+ (* (cbrt x) t_1) (pow t_0 2.0))))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
double t_1 = t_0 + cbrt(x);
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / fma(cbrt(x), t_1, pow(cbrt(x), 2.0));
} else {
tmp = ((x + 1.0) - x) / ((cbrt(x) * t_1) + pow(t_0, 2.0));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) t_1 = Float64(t_0 + cbrt(x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / fma(cbrt(x), t_1, (cbrt(x) ^ 2.0))); else tmp = Float64(Float64(Float64(x + 1.0) - x) / Float64(Float64(cbrt(x) * t_1) + (t_0 ^ 2.0))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1 + N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[(N[Power[x, 1/3], $MachinePrecision] * t$95$1), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := t_0 + \sqrt[3]{x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, t_1, {\left(\sqrt[3]{x}\right)}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{\sqrt[3]{x} \cdot t_1 + {t_0}^{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.7%
rem-cube-cbrt4.2%
reciprocal-define4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.3%
reciprocal-undefine2.3%
associate-*r/2.3%
*-rgt-identity2.3%
+-commutative2.3%
associate--l+50.0%
+-inverses50.0%
metadata-eval50.0%
reciprocal-undefine21.3%
+-commutative21.3%
exp-prod21.3%
Simplified21.3%
reciprocal-undefine49.8%
+-commutative49.8%
+-commutative49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.7%
expm1-log1p-u49.7%
expm1-udef49.7%
unpow1/350.0%
unpow250.0%
cbrt-prod93.9%
pow293.9%
Applied egg-rr93.9%
expm1-def93.9%
expm1-log1p98.6%
Simplified98.6%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 96.7%
add-cbrt-cube96.6%
pow1/396.7%
pow-to-exp96.7%
pow396.7%
log-pow96.7%
Applied egg-rr96.7%
*-commutative96.7%
associate-*l*96.7%
metadata-eval96.7%
pow-to-exp96.7%
pow196.7%
flip3--97.8%
rem-cube-cbrt97.2%
rem-cube-cbrt99.8%
distribute-rgt-in99.8%
+-commutative99.8%
+-commutative99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))) (t_1 (* (cbrt x) (+ t_0 (cbrt x)))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (+ (pow (cbrt x) 2.0) t_1))
(/ (- (+ x 1.0) x) (+ t_1 (pow t_0 2.0))))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
double t_1 = cbrt(x) * (t_0 + cbrt(x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / (pow(cbrt(x), 2.0) + t_1);
} else {
tmp = ((x + 1.0) - x) / (t_1 + pow(t_0, 2.0));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((x + 1.0));
double t_1 = Math.cbrt(x) * (t_0 + Math.cbrt(x));
double tmp;
if ((t_0 - Math.cbrt(x)) <= 0.0) {
tmp = 1.0 / (Math.pow(Math.cbrt(x), 2.0) + t_1);
} else {
tmp = ((x + 1.0) - x) / (t_1 + Math.pow(t_0, 2.0));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) t_1 = Float64(cbrt(x) * Float64(t_0 + cbrt(x))) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / Float64((cbrt(x) ^ 2.0) + t_1)); else tmp = Float64(Float64(Float64(x + 1.0) - x) / Float64(t_1 + (t_0 ^ 2.0))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(t$95$1 + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
t_1 := \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{t_1 + {t_0}^{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.7%
rem-cube-cbrt4.2%
reciprocal-define4.2%
+-commutative4.2%
distribute-rgt-out4.2%
+-commutative4.2%
fma-def4.2%
add-exp-log4.2%
Applied egg-rr2.3%
reciprocal-undefine2.3%
associate-*r/2.3%
*-rgt-identity2.3%
+-commutative2.3%
associate--l+50.0%
+-inverses50.0%
metadata-eval50.0%
reciprocal-undefine21.3%
+-commutative21.3%
exp-prod21.3%
Simplified21.3%
reciprocal-undefine49.8%
+-commutative49.8%
+-commutative49.8%
Applied egg-rr49.8%
Taylor expanded in x around inf 49.7%
fma-udef49.7%
+-commutative49.7%
unpow1/352.2%
unpow252.2%
cbrt-prod98.6%
pow298.6%
+-commutative98.6%
Applied egg-rr98.6%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 96.7%
add-cbrt-cube96.6%
pow1/396.7%
pow-to-exp96.7%
pow396.7%
log-pow96.7%
Applied egg-rr96.7%
*-commutative96.7%
associate-*l*96.7%
metadata-eval96.7%
pow-to-exp96.7%
pow196.7%
flip3--97.8%
rem-cube-cbrt97.2%
rem-cube-cbrt99.8%
distribute-rgt-in99.8%
+-commutative99.8%
+-commutative99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))))
(if (<= (- t_0 (cbrt x)) 5e-7)
(/ 1.0 (* (cbrt x) (+ (cbrt x) (+ t_0 (cbrt 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((x + 1.0));
double tmp;
if ((t_0 - cbrt(x)) <= 5e-7) {
tmp = 1.0 / (cbrt(x) * (cbrt(x) + (t_0 + cbrt(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(x + 1.0)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 5e-7) tmp = Float64(1.0 / Float64(cbrt(x) * Float64(cbrt(x) + Float64(t_0 + cbrt(x))))); else tmp = Float64(Float64(cbrt(Float64(1.0 + (x ^ 3.0))) / cbrt(Float64(fma(x, x, 1.0) - x))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 5e-7], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(1.0 + N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(N[(x * x + 1.0), $MachinePrecision] - x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(t_0 + \sqrt[3]{x}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{\mathsf{fma}\left(x, x, 1\right) - x}} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.99999999999999977e-7Initial program 5.9%
flip3--6.9%
div-inv6.9%
rem-cube-cbrt5.8%
rem-cube-cbrt8.8%
reciprocal-define5.8%
+-commutative5.8%
distribute-rgt-out5.8%
+-commutative5.8%
fma-def5.8%
add-exp-log5.8%
Applied egg-rr2.8%
reciprocal-undefine3.7%
associate-*r/3.7%
*-rgt-identity3.7%
+-commutative3.7%
associate--l+49.1%
+-inverses49.1%
metadata-eval49.1%
reciprocal-undefine20.9%
+-commutative20.9%
exp-prod20.9%
Simplified20.9%
reciprocal-undefine48.9%
+-commutative48.9%
+-commutative48.9%
Applied egg-rr48.9%
Taylor expanded in x around inf 51.2%
fma-udef51.2%
+-commutative51.2%
unpow1/353.6%
unpow253.6%
cbrt-prod97.7%
pow297.7%
+-commutative97.7%
Applied egg-rr97.7%
unpow297.7%
distribute-lft-out97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
if 4.99999999999999977e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.2%
flip3-+99.3%
cbrt-div99.3%
pow399.2%
metadata-eval99.2%
+-commutative99.2%
pow399.3%
metadata-eval99.3%
*-rgt-identity99.3%
associate-+r-99.3%
fma-def99.3%
Applied egg-rr99.3%
Final simplification98.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))))
(if (<= (- t_0 (cbrt x)) 5e-7)
(/ 1.0 (+ (pow (cbrt x) 2.0) (* (cbrt x) (+ t_0 (cbrt 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((x + 1.0));
double tmp;
if ((t_0 - cbrt(x)) <= 5e-7) {
tmp = 1.0 / (pow(cbrt(x), 2.0) + (cbrt(x) * (t_0 + cbrt(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(x + 1.0)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 5e-7) tmp = Float64(1.0 / Float64((cbrt(x) ^ 2.0) + Float64(cbrt(x) * Float64(t_0 + cbrt(x))))); else tmp = Float64(Float64(cbrt(Float64(1.0 + (x ^ 3.0))) / cbrt(Float64(fma(x, x, 1.0) - x))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 5e-7], N[(1.0 / N[(N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(1.0 + N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(N[(x * x + 1.0), $MachinePrecision] - x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{{\left(\sqrt[3]{x}\right)}^{2} + \sqrt[3]{x} \cdot \left(t_0 + \sqrt[3]{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1 + {x}^{3}}}{\sqrt[3]{\mathsf{fma}\left(x, x, 1\right) - x}} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.99999999999999977e-7Initial program 5.9%
flip3--6.9%
div-inv6.9%
rem-cube-cbrt5.8%
rem-cube-cbrt8.8%
reciprocal-define5.8%
+-commutative5.8%
distribute-rgt-out5.8%
+-commutative5.8%
fma-def5.8%
add-exp-log5.8%
Applied egg-rr2.8%
reciprocal-undefine3.7%
associate-*r/3.7%
*-rgt-identity3.7%
+-commutative3.7%
associate--l+49.1%
+-inverses49.1%
metadata-eval49.1%
reciprocal-undefine20.9%
+-commutative20.9%
exp-prod20.9%
Simplified20.9%
reciprocal-undefine48.9%
+-commutative48.9%
+-commutative48.9%
Applied egg-rr48.9%
Taylor expanded in x around inf 51.2%
fma-udef51.2%
+-commutative51.2%
unpow1/353.6%
unpow253.6%
cbrt-prod97.7%
pow297.7%
+-commutative97.7%
Applied egg-rr97.7%
if 4.99999999999999977e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.2%
flip3-+99.3%
cbrt-div99.3%
pow399.2%
metadata-eval99.2%
+-commutative99.2%
pow399.3%
metadata-eval99.3%
*-rgt-identity99.3%
associate-+r-99.3%
fma-def99.3%
Applied egg-rr99.3%
Final simplification98.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ x 1.0))))
(if (<= (- t_0 (cbrt x)) 5e-7)
(/ 1.0 (* (cbrt x) (+ (cbrt x) (+ t_0 (cbrt x)))))
(- (/ (cbrt (fma x x -1.0)) (cbrt (+ x -1.0))) (cbrt x)))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
double tmp;
if ((t_0 - cbrt(x)) <= 5e-7) {
tmp = 1.0 / (cbrt(x) * (cbrt(x) + (t_0 + cbrt(x))));
} else {
tmp = (cbrt(fma(x, x, -1.0)) / cbrt((x + -1.0))) - cbrt(x);
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 5e-7) tmp = Float64(1.0 / Float64(cbrt(x) * Float64(cbrt(x) + Float64(t_0 + cbrt(x))))); else tmp = Float64(Float64(cbrt(fma(x, x, -1.0)) / cbrt(Float64(x + -1.0))) - cbrt(x)); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 5e-7], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[(t$95$0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(x * x + -1.0), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(x + -1.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(t_0 + \sqrt[3]{x}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.99999999999999977e-7Initial program 5.9%
flip3--6.9%
div-inv6.9%
rem-cube-cbrt5.8%
rem-cube-cbrt8.8%
reciprocal-define5.8%
+-commutative5.8%
distribute-rgt-out5.8%
+-commutative5.8%
fma-def5.8%
add-exp-log5.8%
Applied egg-rr2.8%
reciprocal-undefine3.7%
associate-*r/3.7%
*-rgt-identity3.7%
+-commutative3.7%
associate--l+49.1%
+-inverses49.1%
metadata-eval49.1%
reciprocal-undefine20.9%
+-commutative20.9%
exp-prod20.9%
Simplified20.9%
reciprocal-undefine48.9%
+-commutative48.9%
+-commutative48.9%
Applied egg-rr48.9%
Taylor expanded in x around inf 51.2%
fma-udef51.2%
+-commutative51.2%
unpow1/353.6%
unpow253.6%
cbrt-prod97.7%
pow297.7%
+-commutative97.7%
Applied egg-rr97.7%
unpow297.7%
distribute-lft-out97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
if 4.99999999999999977e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.2%
flip-+99.2%
cbrt-div99.3%
metadata-eval99.3%
fma-neg99.3%
metadata-eval99.3%
sub-neg99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Final simplification98.5%
(FPCore (x) :precision binary64 (if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 5e-7) (* 0.3333333333333333 (pow (/ 1.0 (pow x 2.0)) 0.3333333333333333)) (- (/ (cbrt (fma x x -1.0)) (cbrt (+ x -1.0))) (cbrt x))))
double code(double x) {
double tmp;
if ((cbrt((x + 1.0)) - cbrt(x)) <= 5e-7) {
tmp = 0.3333333333333333 * pow((1.0 / pow(x, 2.0)), 0.3333333333333333);
} else {
tmp = (cbrt(fma(x, x, -1.0)) / cbrt((x + -1.0))) - cbrt(x);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) <= 5e-7) tmp = Float64(0.3333333333333333 * (Float64(1.0 / (x ^ 2.0)) ^ 0.3333333333333333)); else tmp = Float64(Float64(cbrt(fma(x, x, -1.0)) / cbrt(Float64(x + -1.0))) - cbrt(x)); end return tmp end
code[x_] := If[LessEqual[N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 5e-7], N[(0.3333333333333333 * N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(x * x + -1.0), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(x + -1.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;0.3333333333333333 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.99999999999999977e-7Initial program 5.9%
add-sqr-sqrt2.7%
add-sqr-sqrt2.9%
difference-of-squares2.9%
pow1/32.9%
sqrt-pow12.9%
metadata-eval2.9%
pow1/32.9%
sqrt-pow12.9%
metadata-eval2.9%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.9%
metadata-eval2.9%
Applied egg-rr2.9%
Taylor expanded in x around inf 50.1%
if 4.99999999999999977e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.2%
flip-+99.2%
cbrt-div99.3%
metadata-eval99.3%
fma-neg99.3%
metadata-eval99.3%
sub-neg99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Final simplification75.6%
(FPCore (x)
:precision binary64
(let* ((t_0
(* 0.3333333333333333 (pow (/ 1.0 (pow x 2.0)) 0.3333333333333333)))
(t_1
(reciprocal (* (cbrt x) (+ (cbrt x) (+ (cbrt (+ x 1.0)) (cbrt x)))))))
(if (<= x -1.32e+154)
t_1
(if (<= x -29000000.0)
t_0
(if (<= x 34000000.0)
(- (/ (cbrt (fma x x -1.0)) (cbrt (+ x -1.0))) (cbrt x))
(if (<= x 1.35e+154) t_0 t_1))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333}\\
t_1 := \mathsf{reciprocal}\left(\left(\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + \left(\sqrt[3]{x + 1} + \sqrt[3]{x}\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -29000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 34000000:\\
\;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(x, x, -1\right)}}{\sqrt[3]{x + -1}} - \sqrt[3]{x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.31999999999999998e154 or 1.35000000000000003e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.2%
rem-cube-cbrt4.7%
reciprocal-define4.7%
+-commutative4.7%
distribute-rgt-out4.7%
+-commutative4.7%
fma-def4.7%
add-exp-log4.7%
Applied egg-rr2.6%
reciprocal-undefine2.6%
associate-*r/2.6%
*-rgt-identity2.6%
+-commutative2.6%
associate--l+50.8%
+-inverses50.8%
metadata-eval50.8%
reciprocal-undefine21.9%
+-commutative21.9%
exp-prod21.9%
Simplified21.9%
reciprocal-undefine50.4%
+-commutative50.4%
+-commutative50.4%
Applied egg-rr50.4%
Taylor expanded in x around inf 4.7%
expm1-log1p-u4.7%
expm1-udef4.7%
reciprocal-define4.7%
+-commutative4.7%
unpow1/34.7%
unpow24.7%
cbrt-prod4.7%
pow24.7%
Applied egg-rr4.7%
expm1-def39.5%
expm1-log1p39.5%
fma-def39.5%
+-commutative39.5%
unpow239.5%
distribute-lft-out39.5%
+-commutative39.5%
+-commutative39.5%
Simplified39.5%
if -1.31999999999999998e154 < x < -2.9e7 or 3.4e7 < x < 1.35000000000000003e154Initial program 7.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.2%
difference-of-squares3.1%
pow1/33.1%
sqrt-pow13.1%
metadata-eval3.1%
pow1/33.1%
sqrt-pow13.1%
metadata-eval3.1%
pow1/32.1%
sqrt-pow12.1%
metadata-eval2.1%
pow1/33.1%
sqrt-pow13.1%
metadata-eval3.1%
Applied egg-rr3.1%
Taylor expanded in x around inf 90.5%
if -2.9e7 < x < 3.4e7Initial program 99.2%
flip-+99.2%
cbrt-div99.3%
metadata-eval99.3%
fma-neg99.3%
metadata-eval99.3%
sub-neg99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Final simplification83.5%
(FPCore (x)
:precision binary64
(let* ((t_0 (- (cbrt (+ x 1.0)) (cbrt x))))
(if (<= t_0 5e-7)
(* 0.3333333333333333 (pow (/ 1.0 (pow x 2.0)) 0.3333333333333333))
t_0)))
double code(double x) {
double t_0 = cbrt((x + 1.0)) - cbrt(x);
double tmp;
if (t_0 <= 5e-7) {
tmp = 0.3333333333333333 * pow((1.0 / pow(x, 2.0)), 0.3333333333333333);
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((x + 1.0)) - Math.cbrt(x);
double tmp;
if (t_0 <= 5e-7) {
tmp = 0.3333333333333333 * Math.pow((1.0 / Math.pow(x, 2.0)), 0.3333333333333333);
} else {
tmp = t_0;
}
return tmp;
}
function code(x) t_0 = Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) tmp = 0.0 if (t_0 <= 5e-7) tmp = Float64(0.3333333333333333 * (Float64(1.0 / (x ^ 2.0)) ^ 0.3333333333333333)); else tmp = t_0; end return tmp end
code[x_] := Block[{t$95$0 = N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-7], N[(0.3333333333333333 * N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-7}:\\
\;\;\;\;0.3333333333333333 \cdot {\left(\frac{1}{{x}^{2}}\right)}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 4.99999999999999977e-7Initial program 5.9%
add-sqr-sqrt2.7%
add-sqr-sqrt2.9%
difference-of-squares2.9%
pow1/32.9%
sqrt-pow12.9%
metadata-eval2.9%
pow1/32.9%
sqrt-pow12.9%
metadata-eval2.9%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.9%
metadata-eval2.9%
Applied egg-rr2.9%
Taylor expanded in x around inf 50.1%
if 4.99999999999999977e-7 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.2%
Final simplification75.6%
(FPCore (x)
:precision binary64
(let* ((t_0 (- (cbrt (+ x 1.0)) (cbrt x))))
(if (<= t_0 2e-8)
(* 0.3333333333333333 (cbrt (reciprocal (pow x 2.0))))
t_0)))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-8}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\mathsf{reciprocal}\left(\left({x}^{2}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2e-8Initial program 5.5%
add-sqr-sqrt2.3%
add-sqr-sqrt2.5%
difference-of-squares2.5%
pow1/32.5%
sqrt-pow12.5%
metadata-eval2.5%
pow1/32.5%
sqrt-pow12.5%
metadata-eval2.5%
pow1/31.2%
sqrt-pow11.2%
metadata-eval1.2%
pow1/32.4%
sqrt-pow12.5%
metadata-eval2.5%
Applied egg-rr2.5%
Taylor expanded in x around inf 49.9%
unpow1/353.4%
reciprocal-define24.4%
Simplified24.4%
if 2e-8 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 98.9%
Final simplification63.4%
(FPCore (x)
:precision binary64
(let* ((t_0 (* 0.3333333333333333 (cbrt (reciprocal (pow x 2.0))))))
(if (<= x -1.0)
t_0
(if (<= x 0.26)
(+ 1.0 (* x -0.6666666666666666))
(if (<= x 1.35e+154) t_0 (pow (cbrt (reciprocal x)) 2.0))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \sqrt[3]{\mathsf{reciprocal}\left(\left({x}^{2}\right)\right)}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.26:\\
\;\;\;\;1 + x \cdot -0.6666666666666666\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\mathsf{reciprocal}\left(x\right)}\right)}^{2}\\
\end{array}
\end{array}
if x < -1 or 0.26000000000000001 < x < 1.35000000000000003e154Initial program 9.3%
add-sqr-sqrt3.9%
add-sqr-sqrt3.9%
difference-of-squares3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.2%
sqrt-pow13.2%
metadata-eval3.2%
pow1/33.9%
sqrt-pow14.0%
metadata-eval4.0%
Applied egg-rr4.0%
Taylor expanded in x around inf 65.1%
unpow1/369.6%
reciprocal-define31.9%
Simplified31.9%
if -1 < x < 0.26000000000000001Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
reciprocal-define95.7%
+-commutative95.7%
distribute-rgt-out95.7%
+-commutative95.7%
fma-def95.7%
add-exp-log95.7%
Applied egg-rr95.7%
reciprocal-undefine99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
reciprocal-undefine95.7%
+-commutative95.7%
exp-prod95.7%
Simplified95.7%
Taylor expanded in x around 0 95.3%
if 1.35000000000000003e154 < x Initial program 4.7%
flip3--4.7%
div-inv4.7%
rem-cube-cbrt3.2%
rem-cube-cbrt4.7%
reciprocal-define4.7%
+-commutative4.7%
distribute-rgt-out4.7%
+-commutative4.7%
fma-def4.7%
add-exp-log4.7%
Applied egg-rr4.7%
reciprocal-undefine4.7%
associate-*r/4.7%
*-rgt-identity4.7%
+-commutative4.7%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
reciprocal-undefine39.8%
+-commutative39.8%
exp-prod39.8%
Simplified39.8%
Taylor expanded in x around inf 4.7%
unpow1/34.7%
reciprocal-define4.7%
Simplified4.7%
add-sqr-sqrt4.7%
cbrt-prod4.7%
reciprocal-undefine4.7%
sqrt-div4.7%
metadata-eval4.7%
unpow24.7%
sqrt-prod4.7%
add-sqr-sqrt4.7%
reciprocal-define4.7%
reciprocal-undefine4.7%
sqrt-div4.7%
metadata-eval4.7%
unpow24.7%
sqrt-prod17.7%
add-sqr-sqrt17.7%
reciprocal-define17.7%
Applied egg-rr17.7%
unpow217.7%
Simplified17.7%
Final simplification62.1%
(FPCore (x)
:precision binary64
(if (<= x -0.38)
(reciprocal (pow (cbrt x) 2.0))
(if (<= x 1.4)
(+ 1.0 (* x -0.6666666666666666))
(exp (* (log x) (- 0.6666666666666666))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.38:\\
\;\;\;\;\mathsf{reciprocal}\left(\left({\left(\sqrt[3]{x}\right)}^{2}\right)\right)\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;1 + x \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;e^{\log x \cdot \left(-0.6666666666666666\right)}\\
\end{array}
\end{array}
if x < -0.38Initial program 10.1%
flip3--12.6%
div-inv12.6%
rem-cube-cbrt10.9%
rem-cube-cbrt15.0%
reciprocal-define8.3%
+-commutative8.3%
distribute-rgt-out8.3%
+-commutative8.3%
fma-def8.3%
add-exp-log8.3%
Applied egg-rr0.8%
reciprocal-undefine1.6%
associate-*r/1.6%
*-rgt-identity1.6%
+-commutative1.6%
associate--l+1.6%
+-inverses1.6%
metadata-eval1.6%
reciprocal-undefine0.8%
+-commutative0.8%
exp-prod0.8%
Simplified0.8%
Taylor expanded in x around inf 12.3%
unpow1/312.3%
reciprocal-define12.3%
Simplified12.3%
reciprocal-undefine12.3%
cbrt-div12.3%
metadata-eval12.3%
unpow212.3%
cbrt-prod17.8%
pow217.8%
Applied egg-rr17.8%
reciprocal-define17.8%
Simplified17.8%
if -0.38 < x < 1.3999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
reciprocal-define96.1%
+-commutative96.1%
distribute-rgt-out96.1%
+-commutative96.1%
fma-def96.1%
add-exp-log96.1%
Applied egg-rr96.1%
reciprocal-undefine99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
reciprocal-undefine96.1%
+-commutative96.1%
exp-prod96.1%
Simplified96.1%
Taylor expanded in x around 0 95.8%
if 1.3999999999999999 < x Initial program 7.7%
flip3--7.8%
div-inv7.8%
rem-cube-cbrt7.2%
rem-cube-cbrt9.9%
reciprocal-define6.3%
+-commutative6.3%
distribute-rgt-out6.3%
+-commutative6.3%
fma-def6.3%
add-exp-log6.3%
Applied egg-rr6.3%
reciprocal-undefine9.8%
associate-*r/9.8%
*-rgt-identity9.8%
+-commutative9.8%
associate--l+93.2%
+-inverses93.2%
metadata-eval93.2%
reciprocal-undefine39.5%
+-commutative39.5%
exp-prod39.5%
Simplified39.5%
add-exp-log39.5%
reciprocal-undefine91.6%
log-rec91.6%
+-commutative91.6%
+-commutative91.6%
Applied egg-rr91.6%
Taylor expanded in x around inf 17.7%
reciprocal-define17.7%
log-pow17.7%
reciprocal-define17.7%
distribute-lft-neg-in17.7%
metadata-eval17.7%
log-rec17.7%
Simplified17.7%
Final simplification56.8%
(FPCore (x) :precision binary64 (if (or (<= x -0.38) (not (<= x 1.4))) (reciprocal (pow (cbrt x) 2.0)) (+ 1.0 (* x -0.6666666666666666))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.38 \lor \neg \left(x \leq 1.4\right):\\
\;\;\;\;\mathsf{reciprocal}\left(\left({\left(\sqrt[3]{x}\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot -0.6666666666666666\\
\end{array}
\end{array}
if x < -0.38 or 1.3999999999999999 < x Initial program 8.9%
flip3--10.1%
div-inv10.1%
rem-cube-cbrt9.0%
rem-cube-cbrt12.3%
reciprocal-define7.2%
+-commutative7.2%
distribute-rgt-out7.2%
+-commutative7.2%
fma-def7.2%
add-exp-log7.2%
Applied egg-rr3.7%
reciprocal-undefine5.9%
associate-*r/5.9%
*-rgt-identity5.9%
+-commutative5.9%
associate--l+49.5%
+-inverses49.5%
metadata-eval49.5%
reciprocal-undefine21.1%
+-commutative21.1%
exp-prod21.1%
Simplified21.1%
Taylor expanded in x around inf 11.9%
unpow1/311.9%
reciprocal-define11.9%
Simplified11.9%
reciprocal-undefine11.9%
cbrt-div11.9%
metadata-eval11.9%
unpow211.9%
cbrt-prod17.8%
pow217.8%
Applied egg-rr17.8%
reciprocal-define17.8%
Simplified17.8%
if -0.38 < x < 1.3999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
reciprocal-define96.1%
+-commutative96.1%
distribute-rgt-out96.1%
+-commutative96.1%
fma-def96.1%
add-exp-log96.1%
Applied egg-rr96.1%
reciprocal-undefine99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
reciprocal-undefine96.1%
+-commutative96.1%
exp-prod96.1%
Simplified96.1%
Taylor expanded in x around 0 95.8%
Final simplification56.8%
(FPCore (x)
:precision binary64
(if (<= x -0.38)
(reciprocal (pow (cbrt x) 2.0))
(if (<= x 1.4)
(+ 1.0 (* x -0.6666666666666666))
(pow (cbrt (reciprocal x)) 2.0))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.38:\\
\;\;\;\;\mathsf{reciprocal}\left(\left({\left(\sqrt[3]{x}\right)}^{2}\right)\right)\\
\mathbf{elif}\;x \leq 1.4:\\
\;\;\;\;1 + x \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{\mathsf{reciprocal}\left(x\right)}\right)}^{2}\\
\end{array}
\end{array}
if x < -0.38Initial program 10.1%
flip3--12.6%
div-inv12.6%
rem-cube-cbrt10.9%
rem-cube-cbrt15.0%
reciprocal-define8.3%
+-commutative8.3%
distribute-rgt-out8.3%
+-commutative8.3%
fma-def8.3%
add-exp-log8.3%
Applied egg-rr0.8%
reciprocal-undefine1.6%
associate-*r/1.6%
*-rgt-identity1.6%
+-commutative1.6%
associate--l+1.6%
+-inverses1.6%
metadata-eval1.6%
reciprocal-undefine0.8%
+-commutative0.8%
exp-prod0.8%
Simplified0.8%
Taylor expanded in x around inf 12.3%
unpow1/312.3%
reciprocal-define12.3%
Simplified12.3%
reciprocal-undefine12.3%
cbrt-div12.3%
metadata-eval12.3%
unpow212.3%
cbrt-prod17.8%
pow217.8%
Applied egg-rr17.8%
reciprocal-define17.8%
Simplified17.8%
if -0.38 < x < 1.3999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
reciprocal-define96.1%
+-commutative96.1%
distribute-rgt-out96.1%
+-commutative96.1%
fma-def96.1%
add-exp-log96.1%
Applied egg-rr96.1%
reciprocal-undefine99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
reciprocal-undefine96.1%
+-commutative96.1%
exp-prod96.1%
Simplified96.1%
Taylor expanded in x around 0 95.8%
if 1.3999999999999999 < x Initial program 7.7%
flip3--7.8%
div-inv7.8%
rem-cube-cbrt7.2%
rem-cube-cbrt9.9%
reciprocal-define6.3%
+-commutative6.3%
distribute-rgt-out6.3%
+-commutative6.3%
fma-def6.3%
add-exp-log6.3%
Applied egg-rr6.3%
reciprocal-undefine9.8%
associate-*r/9.8%
*-rgt-identity9.8%
+-commutative9.8%
associate--l+93.2%
+-inverses93.2%
metadata-eval93.2%
reciprocal-undefine39.5%
+-commutative39.5%
exp-prod39.5%
Simplified39.5%
Taylor expanded in x around inf 11.5%
unpow1/311.5%
reciprocal-define11.5%
Simplified11.5%
add-sqr-sqrt11.5%
cbrt-prod11.5%
reciprocal-undefine11.5%
sqrt-div11.5%
metadata-eval11.5%
unpow211.5%
sqrt-prod11.5%
add-sqr-sqrt11.5%
reciprocal-define11.5%
reciprocal-undefine11.5%
sqrt-div11.5%
metadata-eval11.5%
unpow211.5%
sqrt-prod17.7%
add-sqr-sqrt17.7%
reciprocal-define17.7%
Applied egg-rr17.7%
unpow217.7%
Simplified17.7%
Final simplification56.8%
(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.4%
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 54.4%
Taylor expanded in x around 0 51.2%
Final simplification51.2%
herbie shell --seed 2024024
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))