
(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))))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt x)) (pow t_0 2.0)))
(/ 1.0 (fma (cbrt x) (+ (cbrt x) t_0) (cbrt (pow (+ 1.0 x) 2.0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + cbrt(x)), pow(t_0, 2.0));
} else {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), cbrt(pow((1.0 + x), 2.0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(x)), (t_0 ^ 2.0))); else tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), cbrt((Float64(1.0 + x) ^ 2.0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, {t_0}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, \sqrt[3]{{\left(1 + x\right)}^{2}}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
pow1/32.7%
Applied egg-rr2.7%
pow1/34.2%
flip3--4.2%
div-inv4.2%
pow33.9%
add-cube-cbrt3.3%
rem-cube-cbrt4.2%
pow24.2%
distribute-rgt-out4.2%
+-commutative4.2%
Applied egg-rr4.2%
associate-*r/4.2%
*-rgt-identity4.2%
+-commutative4.2%
associate--l+98.5%
+-inverses98.5%
metadata-eval98.5%
+-commutative98.5%
fma-def98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
+-commutative98.5%
add-cube-cbrt98.2%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 45.9%
unpow1/398.5%
Simplified98.5%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.8%
pow1/338.1%
Applied egg-rr38.1%
pow1/397.8%
flip3--97.7%
div-inv97.7%
pow397.7%
add-cube-cbrt98.0%
rem-cube-cbrt99.8%
pow299.8%
distribute-rgt-out99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
+-commutative99.8%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
unpow299.8%
cbrt-unprod99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (pow t_0 2.0)))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (fma (cbrt x) (+ (cbrt x) (cbrt x)) t_1))
(/ (- (+ 1.0 x) x) (+ t_1 (* (cbrt x) (+ (cbrt x) t_0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = pow(t_0, 2.0);
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + cbrt(x)), t_1);
} else {
tmp = ((1.0 + x) - x) / (t_1 + (cbrt(x) * (cbrt(x) + t_0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = t_0 ^ 2.0 tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + cbrt(x)), t_1)); else tmp = Float64(Float64(Float64(1.0 + x) - x) / Float64(t_1 + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(t$95$1 + 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}\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + \sqrt[3]{x}, t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
pow1/32.7%
Applied egg-rr2.7%
pow1/34.2%
flip3--4.2%
div-inv4.2%
pow33.9%
add-cube-cbrt3.3%
rem-cube-cbrt4.2%
pow24.2%
distribute-rgt-out4.2%
+-commutative4.2%
Applied egg-rr4.2%
associate-*r/4.2%
*-rgt-identity4.2%
+-commutative4.2%
associate--l+98.5%
+-inverses98.5%
metadata-eval98.5%
+-commutative98.5%
fma-def98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
+-commutative98.5%
add-cube-cbrt98.2%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in x around inf 45.9%
unpow1/398.5%
Simplified98.5%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.8%
pow1/338.1%
Applied egg-rr38.1%
+-commutative38.1%
add-sqr-sqrt38.1%
cbrt-unprod38.0%
pow1/397.2%
flip3--97.1%
cbrt-unprod97.1%
add-sqr-sqrt97.0%
+-commutative97.0%
pow397.0%
add-cube-cbrt97.4%
rem-cube-cbrt98.3%
Applied egg-rr99.8%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))) (t_1 (pow t_0 2.0)))
(if (<= (- t_0 (cbrt x)) 0.0)
(/ 1.0 (fma (cbrt x) (+ 1.0 (cbrt x)) t_1))
(/ (- (+ 1.0 x) x) (+ t_1 (* (cbrt x) (+ (cbrt x) t_0)))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double t_1 = pow(t_0, 2.0);
double tmp;
if ((t_0 - cbrt(x)) <= 0.0) {
tmp = 1.0 / fma(cbrt(x), (1.0 + cbrt(x)), t_1);
} else {
tmp = ((1.0 + x) - x) / (t_1 + (cbrt(x) * (cbrt(x) + t_0)));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) t_1 = t_0 ^ 2.0 tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 0.0) tmp = Float64(1.0 / fma(cbrt(x), Float64(1.0 + cbrt(x)), t_1)); else tmp = Float64(Float64(Float64(1.0 + x) - x) / Float64(t_1 + Float64(cbrt(x) * Float64(cbrt(x) + t_0)))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(1.0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(t$95$1 + 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}\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 0:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{t_1 + \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 0.0Initial program 4.2%
pow1/32.7%
Applied egg-rr2.7%
pow1/34.2%
flip3--4.2%
div-inv4.2%
pow33.9%
add-cube-cbrt3.3%
rem-cube-cbrt4.2%
pow24.2%
distribute-rgt-out4.2%
+-commutative4.2%
Applied egg-rr4.2%
associate-*r/4.2%
*-rgt-identity4.2%
+-commutative4.2%
associate--l+98.5%
+-inverses98.5%
metadata-eval98.5%
+-commutative98.5%
fma-def98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
+-commutative98.5%
add-cube-cbrt98.2%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in x around 0 20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.8%
pow1/338.1%
Applied egg-rr38.1%
+-commutative38.1%
add-sqr-sqrt38.1%
cbrt-unprod38.0%
pow1/397.2%
flip3--97.1%
cbrt-unprod97.1%
add-sqr-sqrt97.0%
+-commutative97.0%
pow397.0%
add-cube-cbrt97.4%
rem-cube-cbrt98.3%
Applied egg-rr99.8%
Final simplification62.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 (fma (cbrt x) (+ (cbrt x) t_0) 1.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 / fma(cbrt(x), (cbrt(x) + t_0), 1.0);
} else {
tmp = exp(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 / fma(cbrt(x), Float64(cbrt(x) + t_0), 1.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[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision] + 1.0), $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}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, 1\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-cbrt3.3%
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+45.3%
+-inverses45.3%
metadata-eval45.3%
+-commutative45.3%
exp-prod44.9%
Simplified44.9%
Taylor expanded in x around 0 20.0%
if 0.0 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 97.8%
add-exp-log97.8%
Applied egg-rr97.8%
Final simplification61.6%
(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.3%
pow1/321.6%
Applied egg-rr21.6%
pow1/354.3%
flip3--54.2%
div-inv54.2%
pow354.1%
add-cube-cbrt54.0%
rem-cube-cbrt55.3%
pow255.3%
distribute-rgt-out55.3%
+-commutative55.3%
Applied egg-rr55.3%
associate-*r/55.3%
*-rgt-identity55.3%
+-commutative55.3%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
fma-def99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x) :precision binary64 (/ 1.0 (fma (cbrt x) (+ 1.0 (cbrt x)) (pow (cbrt (+ 1.0 x)) 2.0))))
double code(double x) {
return 1.0 / fma(cbrt(x), (1.0 + cbrt(x)), pow(cbrt((1.0 + x)), 2.0));
}
function code(x) return Float64(1.0 / fma(cbrt(x), Float64(1.0 + cbrt(x)), (cbrt(Float64(1.0 + x)) ^ 2.0))) end
code[x_] := N[(1.0 / N[(N[Power[x, 1/3], $MachinePrecision] * N[(1.0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, 1 + \sqrt[3]{x}, {\left(\sqrt[3]{1 + x}\right)}^{2}\right)}
\end{array}
Initial program 54.3%
pow1/321.6%
Applied egg-rr21.6%
pow1/354.3%
flip3--54.2%
div-inv54.2%
pow354.1%
add-cube-cbrt54.0%
rem-cube-cbrt55.3%
pow255.3%
distribute-rgt-out55.3%
+-commutative55.3%
Applied egg-rr55.3%
associate-*r/55.3%
*-rgt-identity55.3%
+-commutative55.3%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
fma-def99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
+-commutative99.2%
add-cube-cbrt99.1%
pow399.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 60.3%
Final simplification60.3%
(FPCore (x) :precision binary64 (exp (log (- (cbrt (+ 1.0 x)) (cbrt x)))))
double code(double x) {
return exp(log((cbrt((1.0 + x)) - cbrt(x))));
}
public static double code(double x) {
return Math.exp(Math.log((Math.cbrt((1.0 + x)) - Math.cbrt(x))));
}
function code(x) return exp(log(Float64(cbrt(Float64(1.0 + x)) - cbrt(x)))) end
code[x_] := N[Exp[N[Log[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\log \left(\sqrt[3]{1 + x} - \sqrt[3]{x}\right)}
\end{array}
Initial program 54.3%
add-exp-log54.3%
Applied egg-rr54.3%
Final simplification54.3%
(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.3%
Final simplification54.3%
(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.3%
add-cube-cbrt54.0%
pow354.0%
Applied egg-rr54.0%
Taylor expanded in x around 0 20.9%
associate--l+20.9%
*-commutative20.9%
metadata-eval20.9%
pow-base-120.9%
unpow1/352.4%
*-lft-identity52.4%
Simplified52.4%
Final simplification52.4%
(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.3%
add-cube-cbrt54.0%
pow354.0%
Applied egg-rr54.0%
Taylor expanded in x around 0 19.8%
metadata-eval19.8%
pow-base-119.8%
unpow1/351.9%
*-lft-identity51.9%
Simplified51.9%
Final simplification51.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 54.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 54.3%
Taylor expanded in x around 0 50.7%
Final simplification50.7%
herbie shell --seed 2024010
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))