
(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 (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 2e-6)
(+
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
(* (/ (cbrt x) (* x x)) -0.1111111111111111))
(/
1.0
(+
(* (cbrt x) (+ (cbrt x) t_0))
(exp (* 0.6666666666666666 (log1p x))))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 2e-6) {
tmp = (0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / x)) + ((cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = 1.0 / ((cbrt(x) * (cbrt(x) + t_0)) + exp((0.6666666666666666 * log1p(x))));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double tmp;
if ((t_0 - Math.cbrt(x)) <= 2e-6) {
tmp = (0.3333333333333333 * (Math.cbrt(-Math.pow((-1.0 / x), -1.0)) / x)) + ((Math.cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = 1.0 / ((Math.cbrt(x) * (Math.cbrt(x) + t_0)) + Math.exp((0.6666666666666666 * Math.log1p(x))));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 2e-6) tmp = Float64(Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / x)) + Float64(Float64(cbrt(x) / Float64(x * x)) * -0.1111111111111111)); else tmp = Float64(1.0 / Float64(Float64(cbrt(x) * Float64(cbrt(x) + t_0)) + exp(Float64(0.6666666666666666 * log1p(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-6], N[(N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.1111111111111111), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[x, 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + 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}\\
\mathbf{if}\;t_0 - \sqrt[3]{x} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{x}}{x \cdot x} \cdot -0.1111111111111111\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t_0\right) + e^{0.6666666666666666 \cdot \mathsf{log1p}\left(x\right)}}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 1.99999999999999991e-6Initial program 5.3%
add-sqr-sqrt2.8%
add-sqr-sqrt2.8%
difference-of-squares2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
Applied egg-rr2.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
Simplified99.1%
cbrt-prod99.1%
metadata-eval99.1%
metadata-eval99.1%
add-cbrt-cube99.1%
unpow-199.1%
cbrt-div99.1%
metadata-eval99.1%
cbrt-div99.1%
metadata-eval99.1%
metadata-eval99.1%
add-cbrt-cube99.1%
Applied egg-rr99.1%
mul-1-neg99.1%
associate-/r/99.1%
metadata-eval99.1%
neg-mul-199.1%
remove-double-neg99.1%
Simplified99.1%
if 1.99999999999999991e-6 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.3%
flip3--99.2%
div-inv99.2%
rem-cube-cbrt99.2%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
fma-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
+-commutative99.9%
pow299.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
add-exp-log99.9%
log-pow99.9%
pow1/399.9%
log-pow99.9%
log1p-udef99.9%
Applied egg-rr99.9%
associate-*r*99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ 1.0 x)) (cbrt x)) 0.0002)
(+
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
(* (/ (cbrt x) (* x x)) -0.1111111111111111))
(- (/ (cbrt (+ 1.0 (pow x 3.0))) (cbrt (fma x x (- 1.0 x)))) (cbrt x))))
double code(double x) {
double tmp;
if ((cbrt((1.0 + x)) - cbrt(x)) <= 0.0002) {
tmp = (0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / x)) + ((cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = (cbrt((1.0 + pow(x, 3.0))) / cbrt(fma(x, x, (1.0 - x)))) - cbrt(x);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) <= 0.0002) tmp = Float64(Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / x)) + Float64(Float64(cbrt(x) / Float64(x * x)) * -0.1111111111111111)); 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_] := If[LessEqual[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0002], N[(N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.1111111111111111), $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}
\mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0.0002:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{x}}{x \cdot x} \cdot -0.1111111111111111\\
\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)) < 2.0000000000000001e-4Initial program 5.8%
add-sqr-sqrt3.3%
add-sqr-sqrt3.3%
difference-of-squares3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/32.1%
sqrt-pow12.1%
metadata-eval2.1%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
Applied egg-rr3.3%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
Simplified98.9%
cbrt-prod98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
unpow-198.9%
cbrt-div98.9%
metadata-eval98.9%
cbrt-div98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
Applied egg-rr98.9%
mul-1-neg98.9%
associate-/r/98.9%
metadata-eval98.9%
neg-mul-198.9%
remove-double-neg98.9%
Simplified98.9%
if 2.0000000000000001e-4 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.5%
flip3-+99.5%
cbrt-div99.5%
pow399.5%
metadata-eval99.5%
+-commutative99.5%
pow399.5%
fma-def99.5%
metadata-eval99.5%
*-rgt-identity99.5%
Applied egg-rr99.5%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (+ 1.0 x))))
(if (<= (- t_0 (cbrt x)) 2e-6)
(+
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
(* (/ (cbrt x) (* x x)) -0.1111111111111111))
(/
1.0
(fma (cbrt x) (+ (cbrt x) t_0) (pow (+ 1.0 x) 0.6666666666666666))))))
double code(double x) {
double t_0 = cbrt((1.0 + x));
double tmp;
if ((t_0 - cbrt(x)) <= 2e-6) {
tmp = (0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / x)) + ((cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = 1.0 / fma(cbrt(x), (cbrt(x) + t_0), pow((1.0 + x), 0.6666666666666666));
}
return tmp;
}
function code(x) t_0 = cbrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_0 - cbrt(x)) <= 2e-6) tmp = Float64(Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / x)) + Float64(Float64(cbrt(x) / Float64(x * x)) * -0.1111111111111111)); else tmp = Float64(1.0 / fma(cbrt(x), Float64(cbrt(x) + t_0), (Float64(1.0 + x) ^ 0.6666666666666666))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 2e-6], N[(N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.1111111111111111), $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[(1.0 + x), $MachinePrecision], 0.6666666666666666], $MachinePrecision]), $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^{-6}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{x}}{x \cdot x} \cdot -0.1111111111111111\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x} + t_0, {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 1.99999999999999991e-6Initial program 5.3%
add-sqr-sqrt2.8%
add-sqr-sqrt2.8%
difference-of-squares2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
Applied egg-rr2.8%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
Simplified99.1%
cbrt-prod99.1%
metadata-eval99.1%
metadata-eval99.1%
add-cbrt-cube99.1%
unpow-199.1%
cbrt-div99.1%
metadata-eval99.1%
cbrt-div99.1%
metadata-eval99.1%
metadata-eval99.1%
add-cbrt-cube99.1%
Applied egg-rr99.1%
mul-1-neg99.1%
associate-/r/99.1%
metadata-eval99.1%
neg-mul-199.1%
remove-double-neg99.1%
Simplified99.1%
if 1.99999999999999991e-6 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.3%
flip3--99.2%
div-inv99.2%
rem-cube-cbrt99.2%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
pow1/399.9%
+-commutative99.9%
pow-pow99.9%
+-commutative99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification99.5%
(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 50.1%
flip3--50.1%
div-inv50.1%
rem-cube-cbrt50.2%
rem-cube-cbrt51.6%
cbrt-unprod51.6%
pow251.6%
distribute-rgt-out51.6%
+-commutative51.6%
Applied egg-rr51.6%
associate-*r/51.6%
*-rgt-identity51.6%
+-commutative51.6%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.4%
+-commutative75.4%
+-commutative75.4%
Simplified75.4%
expm1-log1p-u74.5%
expm1-udef74.5%
+-commutative74.5%
pow274.5%
cbrt-prod96.8%
pow296.8%
+-commutative96.8%
Applied egg-rr96.8%
expm1-def96.8%
expm1-log1p99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ 1.0 x)) (cbrt x)) 0.0002)
(+
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
(* (/ (cbrt x) (* x x)) -0.1111111111111111))
(- (pow (exp 0.3333333333333333) (log1p x)) (cbrt x))))
double code(double x) {
double tmp;
if ((cbrt((1.0 + x)) - cbrt(x)) <= 0.0002) {
tmp = (0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / x)) + ((cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = pow(exp(0.3333333333333333), log1p(x)) - cbrt(x);
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((Math.cbrt((1.0 + x)) - Math.cbrt(x)) <= 0.0002) {
tmp = (0.3333333333333333 * (Math.cbrt(-Math.pow((-1.0 / x), -1.0)) / x)) + ((Math.cbrt(x) / (x * x)) * -0.1111111111111111);
} else {
tmp = Math.pow(Math.exp(0.3333333333333333), Math.log1p(x)) - Math.cbrt(x);
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) <= 0.0002) tmp = Float64(Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / x)) + Float64(Float64(cbrt(x) / Float64(x * x)) * -0.1111111111111111)); else tmp = Float64((exp(0.3333333333333333) ^ log1p(x)) - cbrt(x)); end return tmp end
code[x_] := If[LessEqual[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 0.0002], N[(N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.1111111111111111), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Exp[0.3333333333333333], $MachinePrecision], N[Log[1 + x], $MachinePrecision]], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 0.0002:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{x}}{x \cdot x} \cdot -0.1111111111111111\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{0.3333333333333333}\right)}^{\left(\mathsf{log1p}\left(x\right)\right)} - \sqrt[3]{x}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2.0000000000000001e-4Initial program 5.8%
add-sqr-sqrt3.3%
add-sqr-sqrt3.3%
difference-of-squares3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/32.1%
sqrt-pow12.1%
metadata-eval2.1%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
Applied egg-rr3.3%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
Simplified98.9%
cbrt-prod98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
unpow-198.9%
cbrt-div98.9%
metadata-eval98.9%
cbrt-div98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
Applied egg-rr98.9%
mul-1-neg98.9%
associate-/r/98.9%
metadata-eval98.9%
neg-mul-198.9%
remove-double-neg98.9%
Simplified98.9%
if 2.0000000000000001e-4 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.5%
add-exp-log99.5%
pow1/399.5%
log-pow99.5%
+-commutative99.5%
log1p-udef99.5%
Applied egg-rr99.5%
exp-prod99.5%
Simplified99.5%
Final simplification99.2%
(FPCore (x)
:precision binary64
(let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x))))
(if (<= t_0 0.0002)
(+
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
(* (/ (cbrt x) (* x x)) -0.1111111111111111))
t_0)))
double code(double x) {
double t_0 = cbrt((1.0 + x)) - cbrt(x);
double tmp;
if (t_0 <= 0.0002) {
tmp = (0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / x)) + ((cbrt(x) / (x * x)) * -0.1111111111111111);
} 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.0002) {
tmp = (0.3333333333333333 * (Math.cbrt(-Math.pow((-1.0 / x), -1.0)) / x)) + ((Math.cbrt(x) / (x * x)) * -0.1111111111111111);
} 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.0002) tmp = Float64(Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / x)) + Float64(Float64(cbrt(x) / Float64(x * x)) * -0.1111111111111111)); 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.0002], N[(N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * -0.1111111111111111), $MachinePrecision]), $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.0002:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x} + \frac{\sqrt[3]{x}}{x \cdot x} \cdot -0.1111111111111111\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 2.0000000000000001e-4Initial program 5.8%
add-sqr-sqrt3.3%
add-sqr-sqrt3.3%
difference-of-squares3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
pow1/32.1%
sqrt-pow12.1%
metadata-eval2.1%
pow1/33.3%
sqrt-pow13.3%
metadata-eval3.3%
Applied egg-rr3.3%
Taylor expanded in x around -inf 0.0%
+-commutative0.0%
+-commutative0.0%
associate-+l+0.0%
Simplified98.9%
cbrt-prod98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
unpow-198.9%
cbrt-div98.9%
metadata-eval98.9%
cbrt-div98.9%
metadata-eval98.9%
metadata-eval98.9%
add-cbrt-cube98.9%
Applied egg-rr98.9%
mul-1-neg98.9%
associate-/r/98.9%
metadata-eval98.9%
neg-mul-198.9%
remove-double-neg98.9%
Simplified98.9%
if 2.0000000000000001e-4 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.5%
Final simplification99.2%
(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 50.1%
flip3--50.1%
div-inv50.1%
rem-cube-cbrt50.2%
rem-cube-cbrt51.6%
cbrt-unprod51.6%
pow251.6%
distribute-rgt-out51.6%
+-commutative51.6%
Applied egg-rr51.6%
associate-*r/51.6%
*-rgt-identity51.6%
+-commutative51.6%
associate--l+75.5%
+-inverses75.5%
metadata-eval75.5%
+-commutative75.5%
fma-def75.4%
+-commutative75.4%
+-commutative75.4%
Simplified75.4%
fma-udef75.5%
+-commutative75.5%
pow275.5%
cbrt-prod99.1%
+-commutative99.1%
pow299.1%
+-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x))))
(if (<= t_0 2e-6)
(* 0.3333333333333333 (/ (cbrt (- (pow (/ -1.0 x) -1.0))) x))
t_0)))
double code(double x) {
double t_0 = cbrt((1.0 + x)) - cbrt(x);
double tmp;
if (t_0 <= 2e-6) {
tmp = 0.3333333333333333 * (cbrt(-pow((-1.0 / x), -1.0)) / 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 <= 2e-6) {
tmp = 0.3333333333333333 * (Math.cbrt(-Math.pow((-1.0 / x), -1.0)) / 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 <= 2e-6) tmp = Float64(0.3333333333333333 * Float64(cbrt(Float64(-(Float64(-1.0 / x) ^ -1.0))) / 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, 2e-6], N[(0.3333333333333333 * N[(N[Power[(-N[Power[N[(-1.0 / x), $MachinePrecision], -1.0], $MachinePrecision]), 1/3], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt[3]{-{\left(\frac{-1}{x}\right)}^{-1}}}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 1.99999999999999991e-6Initial program 5.3%
add-sqr-sqrt2.8%
add-sqr-sqrt2.8%
difference-of-squares2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
Applied egg-rr2.8%
Taylor expanded in x around -inf 0.0%
Simplified98.5%
if 1.99999999999999991e-6 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.3%
Final simplification98.9%
(FPCore (x) :precision binary64 (let* ((t_0 (- (cbrt (+ 1.0 x)) (cbrt x)))) (if (<= t_0 2e-6) (/ 0.3333333333333333 (pow (cbrt x) 2.0)) t_0)))
double code(double x) {
double t_0 = cbrt((1.0 + x)) - cbrt(x);
double tmp;
if (t_0 <= 2e-6) {
tmp = 0.3333333333333333 / pow(cbrt(x), 2.0);
} 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 <= 2e-6) {
tmp = 0.3333333333333333 / Math.pow(Math.cbrt(x), 2.0);
} 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 <= 2e-6) tmp = Float64(0.3333333333333333 / (cbrt(x) ^ 2.0)); 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, 2e-6], N[(0.3333333333333333 / N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\frac{0.3333333333333333}{{\left(\sqrt[3]{x}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) < 1.99999999999999991e-6Initial program 5.3%
add-sqr-sqrt2.8%
add-sqr-sqrt2.8%
difference-of-squares2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
pow1/31.6%
sqrt-pow11.6%
metadata-eval1.6%
pow1/32.8%
sqrt-pow12.8%
metadata-eval2.8%
Applied egg-rr2.8%
Taylor expanded in x around inf 49.3%
unpow1/352.6%
unpow252.6%
Simplified52.6%
cbrt-div52.5%
metadata-eval52.5%
cbrt-prod97.8%
un-div-inv97.8%
pow297.8%
Applied egg-rr97.8%
if 1.99999999999999991e-6 < (-.f64 (cbrt.f64 (+.f64 x 1)) (cbrt.f64 x)) Initial program 99.3%
Final simplification98.5%
(FPCore (x) :precision binary64 (if (or (<= x -1.0) (not (<= x 0.245))) (/ 0.3333333333333333 (pow (cbrt x) 2.0)) (/ 1.0 (pow (+ 1.0 (* x 0.2222222222222222)) 3.0))))
double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.245)) {
tmp = 0.3333333333333333 / pow(cbrt(x), 2.0);
} else {
tmp = 1.0 / pow((1.0 + (x * 0.2222222222222222)), 3.0);
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.245)) {
tmp = 0.3333333333333333 / Math.pow(Math.cbrt(x), 2.0);
} else {
tmp = 1.0 / Math.pow((1.0 + (x * 0.2222222222222222)), 3.0);
}
return tmp;
}
function code(x) tmp = 0.0 if ((x <= -1.0) || !(x <= 0.245)) tmp = Float64(0.3333333333333333 / (cbrt(x) ^ 2.0)); else tmp = Float64(1.0 / (Float64(1.0 + Float64(x * 0.2222222222222222)) ^ 3.0)); end return tmp end
code[x_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.245]], $MachinePrecision]], N[(0.3333333333333333 / N[Power[N[Power[x, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(1.0 + N[(x * 0.2222222222222222), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 0.245\right):\\
\;\;\;\;\frac{0.3333333333333333}{{\left(\sqrt[3]{x}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(1 + x \cdot 0.2222222222222222\right)}^{3}}\\
\end{array}
\end{array}
if x < -1 or 0.245 < x Initial program 7.4%
add-sqr-sqrt5.0%
add-sqr-sqrt5.0%
difference-of-squares5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/33.8%
sqrt-pow13.8%
metadata-eval3.8%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
Applied egg-rr5.0%
Taylor expanded in x around inf 49.0%
unpow1/352.2%
unpow252.2%
Simplified52.2%
cbrt-div52.1%
metadata-eval52.1%
cbrt-prod96.1%
un-div-inv96.1%
pow296.1%
Applied egg-rr96.1%
if -1 < x < 0.245Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
pow299.9%
+-commutative99.9%
Applied egg-rr99.9%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 96.5%
*-commutative96.5%
Simplified96.5%
Final simplification96.3%
(FPCore (x)
:precision binary64
(if (<= x -1.0)
(* 0.3333333333333333 (/ -1.0 (cbrt (* x (- x)))))
(if (<= x 0.245)
(/ 1.0 (pow (+ 1.0 (* x 0.2222222222222222)) 3.0))
(* 0.3333333333333333 (cbrt (/ 1.0 (* x x)))))))
double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.3333333333333333 * (-1.0 / cbrt((x * -x)));
} else if (x <= 0.245) {
tmp = 1.0 / pow((1.0 + (x * 0.2222222222222222)), 3.0);
} else {
tmp = 0.3333333333333333 * cbrt((1.0 / (x * x)));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.3333333333333333 * (-1.0 / Math.cbrt((x * -x)));
} else if (x <= 0.245) {
tmp = 1.0 / Math.pow((1.0 + (x * 0.2222222222222222)), 3.0);
} else {
tmp = 0.3333333333333333 * Math.cbrt((1.0 / (x * x)));
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= -1.0) tmp = Float64(0.3333333333333333 * Float64(-1.0 / cbrt(Float64(x * Float64(-x))))); elseif (x <= 0.245) tmp = Float64(1.0 / (Float64(1.0 + Float64(x * 0.2222222222222222)) ^ 3.0)); else tmp = Float64(0.3333333333333333 * cbrt(Float64(1.0 / Float64(x * x)))); end return tmp end
code[x_] := If[LessEqual[x, -1.0], N[(0.3333333333333333 * N[(-1.0 / N[Power[N[(x * (-x)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.245], N[(1.0 / N[Power[N[(1.0 + N[(x * 0.2222222222222222), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[Power[N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;0.3333333333333333 \cdot \frac{-1}{\sqrt[3]{x \cdot \left(-x\right)}}\\
\mathbf{elif}\;x \leq 0.245:\\
\;\;\;\;\frac{1}{{\left(1 + x \cdot 0.2222222222222222\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\end{array}
\end{array}
if x < -1Initial program 5.2%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
difference-of-squares0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 54.9%
unpow1/358.7%
unpow258.7%
Simplified58.7%
frac-2neg58.7%
metadata-eval58.7%
cbrt-div58.8%
metadata-eval58.8%
metadata-eval58.8%
add-cbrt-cube58.8%
distribute-rgt-neg-in58.8%
Applied egg-rr58.8%
if -1 < x < 0.245Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
pow299.9%
+-commutative99.9%
Applied egg-rr99.9%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 96.5%
*-commutative96.5%
Simplified96.5%
if 0.245 < x Initial program 9.3%
add-sqr-sqrt9.3%
add-sqr-sqrt9.3%
difference-of-squares9.3%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
pow1/37.0%
sqrt-pow17.0%
metadata-eval7.0%
pow1/39.3%
sqrt-pow19.4%
metadata-eval9.4%
Applied egg-rr9.4%
Taylor expanded in x around inf 43.8%
unpow1/346.6%
unpow246.6%
Simplified46.6%
Final simplification72.6%
(FPCore (x) :precision binary64 (if (or (<= x -1.0) (not (<= x 0.24))) (* 0.3333333333333333 (cbrt (/ 1.0 (* x x)))) (/ 1.0 (+ 1.0 (* x 0.6666666666666666)))))
double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.24)) {
tmp = 0.3333333333333333 * cbrt((1.0 / (x * x)));
} else {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.24)) {
tmp = 0.3333333333333333 * Math.cbrt((1.0 / (x * x)));
} else {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
}
return tmp;
}
function code(x) tmp = 0.0 if ((x <= -1.0) || !(x <= 0.24)) tmp = Float64(0.3333333333333333 * cbrt(Float64(1.0 / Float64(x * x)))); else tmp = Float64(1.0 / Float64(1.0 + Float64(x * 0.6666666666666666))); end return tmp end
code[x_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.24]], $MachinePrecision]], N[(0.3333333333333333 * N[Power[N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 0.24\right):\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + x \cdot 0.6666666666666666}\\
\end{array}
\end{array}
if x < -1 or 0.23999999999999999 < x Initial program 7.4%
add-sqr-sqrt5.0%
add-sqr-sqrt5.0%
difference-of-squares5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/33.8%
sqrt-pow13.8%
metadata-eval3.8%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
Applied egg-rr5.0%
Taylor expanded in x around inf 49.0%
unpow1/352.2%
unpow252.2%
Simplified52.2%
if -1 < x < 0.23999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
pow299.9%
+-commutative99.9%
Applied egg-rr99.9%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 96.5%
Final simplification72.6%
(FPCore (x)
:precision binary64
(if (<= x -1.0)
(* 0.3333333333333333 (/ -1.0 (cbrt (* x (- x)))))
(if (<= x 0.24)
(/ 1.0 (+ 1.0 (* x 0.6666666666666666)))
(* 0.3333333333333333 (cbrt (/ 1.0 (* x x)))))))
double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.3333333333333333 * (-1.0 / cbrt((x * -x)));
} else if (x <= 0.24) {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
} else {
tmp = 0.3333333333333333 * cbrt((1.0 / (x * x)));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= -1.0) {
tmp = 0.3333333333333333 * (-1.0 / Math.cbrt((x * -x)));
} else if (x <= 0.24) {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
} else {
tmp = 0.3333333333333333 * Math.cbrt((1.0 / (x * x)));
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= -1.0) tmp = Float64(0.3333333333333333 * Float64(-1.0 / cbrt(Float64(x * Float64(-x))))); elseif (x <= 0.24) tmp = Float64(1.0 / Float64(1.0 + Float64(x * 0.6666666666666666))); else tmp = Float64(0.3333333333333333 * cbrt(Float64(1.0 / Float64(x * x)))); end return tmp end
code[x_] := If[LessEqual[x, -1.0], N[(0.3333333333333333 * N[(-1.0 / N[Power[N[(x * (-x)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.24], N[(1.0 / N[(1.0 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[Power[N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;0.3333333333333333 \cdot \frac{-1}{\sqrt[3]{x \cdot \left(-x\right)}}\\
\mathbf{elif}\;x \leq 0.24:\\
\;\;\;\;\frac{1}{1 + x \cdot 0.6666666666666666}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt[3]{\frac{1}{x \cdot x}}\\
\end{array}
\end{array}
if x < -1Initial program 5.2%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
difference-of-squares0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
pow1/30.0%
sqrt-pow10.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 54.9%
unpow1/358.7%
unpow258.7%
Simplified58.7%
frac-2neg58.7%
metadata-eval58.7%
cbrt-div58.8%
metadata-eval58.8%
metadata-eval58.8%
add-cbrt-cube58.8%
distribute-rgt-neg-in58.8%
Applied egg-rr58.8%
if -1 < x < 0.23999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
pow299.9%
+-commutative99.9%
Applied egg-rr99.9%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 96.5%
if 0.23999999999999999 < x Initial program 9.3%
add-sqr-sqrt9.3%
add-sqr-sqrt9.3%
difference-of-squares9.3%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
pow1/37.0%
sqrt-pow17.0%
metadata-eval7.0%
pow1/39.3%
sqrt-pow19.4%
metadata-eval9.4%
Applied egg-rr9.4%
Taylor expanded in x around inf 43.8%
unpow1/346.6%
unpow246.6%
Simplified46.6%
Final simplification72.6%
(FPCore (x) :precision binary64 (if (or (<= x -1.0) (not (<= x 0.24))) (* 0.3333333333333333 (pow (* x x) -0.3333333333333333)) (/ 1.0 (+ 1.0 (* x 0.6666666666666666)))))
double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.24)) {
tmp = 0.3333333333333333 * pow((x * x), -0.3333333333333333);
} else {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 0.24d0))) then
tmp = 0.3333333333333333d0 * ((x * x) ** (-0.3333333333333333d0))
else
tmp = 1.0d0 / (1.0d0 + (x * 0.6666666666666666d0))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x <= -1.0) || !(x <= 0.24)) {
tmp = 0.3333333333333333 * Math.pow((x * x), -0.3333333333333333);
} else {
tmp = 1.0 / (1.0 + (x * 0.6666666666666666));
}
return tmp;
}
def code(x): tmp = 0 if (x <= -1.0) or not (x <= 0.24): tmp = 0.3333333333333333 * math.pow((x * x), -0.3333333333333333) else: tmp = 1.0 / (1.0 + (x * 0.6666666666666666)) return tmp
function code(x) tmp = 0.0 if ((x <= -1.0) || !(x <= 0.24)) tmp = Float64(0.3333333333333333 * (Float64(x * x) ^ -0.3333333333333333)); else tmp = Float64(1.0 / Float64(1.0 + Float64(x * 0.6666666666666666))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x <= -1.0) || ~((x <= 0.24))) tmp = 0.3333333333333333 * ((x * x) ^ -0.3333333333333333); else tmp = 1.0 / (1.0 + (x * 0.6666666666666666)); end tmp_2 = tmp; end
code[x_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.24]], $MachinePrecision]], N[(0.3333333333333333 * N[Power[N[(x * x), $MachinePrecision], -0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 + N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 0.24\right):\\
\;\;\;\;0.3333333333333333 \cdot {\left(x \cdot x\right)}^{-0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + x \cdot 0.6666666666666666}\\
\end{array}
\end{array}
if x < -1 or 0.23999999999999999 < x Initial program 7.4%
add-sqr-sqrt5.0%
add-sqr-sqrt5.0%
difference-of-squares5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
pow1/33.8%
sqrt-pow13.8%
metadata-eval3.8%
pow1/35.0%
sqrt-pow15.0%
metadata-eval5.0%
Applied egg-rr5.0%
Taylor expanded in x around inf 49.0%
unpow1/352.2%
unpow252.2%
Simplified52.2%
pow1/349.0%
inv-pow49.0%
pow-pow49.0%
metadata-eval49.0%
Applied egg-rr49.0%
if -1 < x < 0.23999999999999999Initial program 100.0%
flip3--99.9%
div-inv99.9%
rem-cube-cbrt99.9%
rem-cube-cbrt99.9%
cbrt-unprod99.9%
pow299.9%
distribute-rgt-out99.9%
+-commutative99.9%
Applied egg-rr99.9%
associate-*r/99.9%
*-rgt-identity99.9%
+-commutative99.9%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef99.9%
+-commutative99.9%
pow299.9%
cbrt-prod99.9%
pow299.9%
+-commutative99.9%
Applied egg-rr99.9%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 96.5%
Final simplification70.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 50.1%
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 50.1%
Taylor expanded in x around 0 48.0%
Final simplification48.0%
herbie shell --seed 2023261
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
(- (cbrt (+ x 1.0)) (cbrt x)))