
(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 14 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)) 4e-6)
(/
(+
(* (cbrt (/ 1.0 (pow x 2.0))) -0.1111111111111111)
(cbrt (* x 0.037037037037037035)))
x)
(-
0.0
(/
(- x (+ -1.0 x))
(+
(* (cbrt x) (- (- (cbrt x)) t_0))
(- 0.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)) <= 4e-6) {
tmp = ((cbrt((1.0 / pow(x, 2.0))) * -0.1111111111111111) + cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = 0.0 - ((x - (-1.0 + x)) / ((cbrt(x) * (-cbrt(x) - t_0)) + (0.0 - pow((1.0 + x), 0.6666666666666666))));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.cbrt((1.0 + x));
double tmp;
if ((t_0 - Math.cbrt(x)) <= 4e-6) {
tmp = ((Math.cbrt((1.0 / Math.pow(x, 2.0))) * -0.1111111111111111) + Math.cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = 0.0 - ((x - (-1.0 + x)) / ((Math.cbrt(x) * (-Math.cbrt(x) - t_0)) + (0.0 - Math.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)) <= 4e-6) tmp = Float64(Float64(Float64(cbrt(Float64(1.0 / (x ^ 2.0))) * -0.1111111111111111) + cbrt(Float64(x * 0.037037037037037035))) / x); else tmp = Float64(0.0 - Float64(Float64(x - Float64(-1.0 + x)) / Float64(Float64(cbrt(x) * Float64(Float64(-cbrt(x)) - t_0)) + Float64(0.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], 4e-6], N[(N[(N[(N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * -0.1111111111111111), $MachinePrecision] + N[Power[N[(x * 0.037037037037037035), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(0.0 - N[(N[(x - N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Power[x, 1/3], $MachinePrecision] * N[((-N[Power[x, 1/3], $MachinePrecision]) - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(0.0 - N[Power[N[(1.0 + x), $MachinePrecision], 0.6666666666666666], $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 4 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{{x}^{2}}} \cdot -0.1111111111111111 + \sqrt[3]{x \cdot 0.037037037037037035}}{x}\\
\mathbf{else}:\\
\;\;\;\;0 - \frac{x - \left(-1 + x\right)}{\sqrt[3]{x} \cdot \left(\left(-\sqrt[3]{x}\right) - t\_0\right) + \left(0 - {\left(1 + x\right)}^{0.6666666666666666}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 3.99999999999999982e-6Initial program 5.7%
add-sqr-sqrt5.3%
add-sqr-sqrt5.7%
difference-of-squares5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/33.2%
sqrt-pow13.2%
metadata-eval3.2%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
Taylor expanded in x around inf 99.1%
associate-+r+99.1%
distribute-rgt-out99.1%
metadata-eval99.1%
Simplified99.1%
pow1/391.8%
pow191.8%
pow1/399.1%
Applied egg-rr99.1%
unpow199.1%
rem-cbrt-cube98.9%
*-commutative98.9%
cube-prod98.9%
rem-cube-cbrt99.1%
metadata-eval99.1%
Simplified99.1%
if 3.99999999999999982e-6 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 88.2%
pow1/388.6%
add-sqr-sqrt88.4%
pow288.4%
pow-pow88.4%
metadata-eval88.4%
Applied egg-rr88.4%
sqrt-pow288.6%
metadata-eval88.6%
pow1/388.2%
flip3--88.0%
frac-2neg88.0%
rem-cube-cbrt91.1%
rem-cube-cbrt97.7%
pow297.7%
distribute-rgt-out98.0%
Applied egg-rr98.0%
associate--l+98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
+-commutative98.8%
pow298.8%
cbrt-unprod99.0%
pow299.0%
+-commutative99.0%
Applied egg-rr99.0%
pow1/399.0%
+-commutative99.0%
pow-pow99.0%
+-commutative99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Final simplification99.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (pow (+ 1.0 x) 0.16666666666666666)))
(if (<= (- (cbrt (+ 1.0 x)) (cbrt x)) 4e-6)
(/
(+
(* (cbrt (/ 1.0 (pow x 2.0))) -0.1111111111111111)
(cbrt (* x 0.037037037037037035)))
x)
(*
(+ t_0 (pow x 0.16666666666666666))
(- t_0 (pow x 0.16666666666666666))))))
double code(double x) {
double t_0 = pow((1.0 + x), 0.16666666666666666);
double tmp;
if ((cbrt((1.0 + x)) - cbrt(x)) <= 4e-6) {
tmp = ((cbrt((1.0 / pow(x, 2.0))) * -0.1111111111111111) + cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = (t_0 + pow(x, 0.16666666666666666)) * (t_0 - pow(x, 0.16666666666666666));
}
return tmp;
}
public static double code(double x) {
double t_0 = Math.pow((1.0 + x), 0.16666666666666666);
double tmp;
if ((Math.cbrt((1.0 + x)) - Math.cbrt(x)) <= 4e-6) {
tmp = ((Math.cbrt((1.0 / Math.pow(x, 2.0))) * -0.1111111111111111) + Math.cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = (t_0 + Math.pow(x, 0.16666666666666666)) * (t_0 - Math.pow(x, 0.16666666666666666));
}
return tmp;
}
function code(x) t_0 = Float64(1.0 + x) ^ 0.16666666666666666 tmp = 0.0 if (Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) <= 4e-6) tmp = Float64(Float64(Float64(cbrt(Float64(1.0 / (x ^ 2.0))) * -0.1111111111111111) + cbrt(Float64(x * 0.037037037037037035))) / x); else tmp = Float64(Float64(t_0 + (x ^ 0.16666666666666666)) * Float64(t_0 - (x ^ 0.16666666666666666))); end return tmp end
code[x_] := Block[{t$95$0 = N[Power[N[(1.0 + x), $MachinePrecision], 0.16666666666666666], $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 4e-6], N[(N[(N[(N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * -0.1111111111111111), $MachinePrecision] + N[Power[N[(x * 0.037037037037037035), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(t$95$0 + N[Power[x, 0.16666666666666666], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 - N[Power[x, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(1 + x\right)}^{0.16666666666666666}\\
\mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{{x}^{2}}} \cdot -0.1111111111111111 + \sqrt[3]{x \cdot 0.037037037037037035}}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 + {x}^{0.16666666666666666}\right) \cdot \left(t\_0 - {x}^{0.16666666666666666}\right)\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 3.99999999999999982e-6Initial program 5.7%
add-sqr-sqrt5.3%
add-sqr-sqrt5.7%
difference-of-squares5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/33.2%
sqrt-pow13.2%
metadata-eval3.2%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
Taylor expanded in x around inf 99.1%
associate-+r+99.1%
distribute-rgt-out99.1%
metadata-eval99.1%
Simplified99.1%
pow1/391.8%
pow191.8%
pow1/399.1%
Applied egg-rr99.1%
unpow199.1%
rem-cbrt-cube98.9%
*-commutative98.9%
cube-prod98.9%
rem-cube-cbrt99.1%
metadata-eval99.1%
Simplified99.1%
if 3.99999999999999982e-6 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 88.2%
add-sqr-sqrt88.3%
add-sqr-sqrt88.2%
difference-of-squares89.4%
pow1/389.4%
sqrt-pow189.4%
metadata-eval89.4%
pow1/389.4%
sqrt-pow189.4%
metadata-eval89.4%
pow1/391.6%
sqrt-pow192.1%
metadata-eval92.1%
pow1/391.5%
sqrt-pow191.8%
metadata-eval91.8%
Applied egg-rr91.8%
Final simplification98.9%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ 1.0 x)) (cbrt x)) 4e-6)
(/
(+
(* (cbrt (/ 1.0 (pow x 2.0))) -0.1111111111111111)
(cbrt (* x 0.037037037037037035)))
x)
(+ (pow (+ 1.0 x) 0.3333333333333333) (- 0.0 (pow x 0.3333333333333333)))))
double code(double x) {
double tmp;
if ((cbrt((1.0 + x)) - cbrt(x)) <= 4e-6) {
tmp = ((cbrt((1.0 / pow(x, 2.0))) * -0.1111111111111111) + cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = pow((1.0 + x), 0.3333333333333333) + (0.0 - pow(x, 0.3333333333333333));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((Math.cbrt((1.0 + x)) - Math.cbrt(x)) <= 4e-6) {
tmp = ((Math.cbrt((1.0 / Math.pow(x, 2.0))) * -0.1111111111111111) + Math.cbrt((x * 0.037037037037037035))) / x;
} else {
tmp = Math.pow((1.0 + x), 0.3333333333333333) + (0.0 - Math.pow(x, 0.3333333333333333));
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) <= 4e-6) tmp = Float64(Float64(Float64(cbrt(Float64(1.0 / (x ^ 2.0))) * -0.1111111111111111) + cbrt(Float64(x * 0.037037037037037035))) / x); else tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) + Float64(0.0 - (x ^ 0.3333333333333333))); 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], 4e-6], N[(N[(N[(N[Power[N[(1.0 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * -0.1111111111111111), $MachinePrecision] + N[Power[N[(x * 0.037037037037037035), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{{x}^{2}}} \cdot -0.1111111111111111 + \sqrt[3]{x \cdot 0.037037037037037035}}{x}\\
\mathbf{else}:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 3.99999999999999982e-6Initial program 5.7%
add-sqr-sqrt5.3%
add-sqr-sqrt5.7%
difference-of-squares5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/33.2%
sqrt-pow13.2%
metadata-eval3.2%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
Taylor expanded in x around inf 99.1%
associate-+r+99.1%
distribute-rgt-out99.1%
metadata-eval99.1%
Simplified99.1%
pow1/391.8%
pow191.8%
pow1/399.1%
Applied egg-rr99.1%
unpow199.1%
rem-cbrt-cube98.9%
*-commutative98.9%
cube-prod98.9%
rem-cube-cbrt99.1%
metadata-eval99.1%
Simplified99.1%
if 3.99999999999999982e-6 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 88.2%
pow1/388.6%
Applied egg-rr88.6%
pow1/391.0%
Applied egg-rr91.0%
Final simplification98.9%
(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(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}{\left(-{t\_0}^{2}\right) - \sqrt[3]{x} \cdot \left(\sqrt[3]{x} + t\_0\right)}
\end{array}
\end{array}
Initial program 8.6%
pow1/39.4%
add-sqr-sqrt9.4%
pow29.4%
pow-pow9.4%
metadata-eval9.4%
Applied egg-rr9.4%
sqrt-pow29.4%
metadata-eval9.4%
pow1/38.6%
flip3--8.8%
frac-2neg8.8%
rem-cube-cbrt7.8%
rem-cube-cbrt10.9%
pow210.9%
distribute-rgt-out10.9%
Applied egg-rr10.9%
associate--l+10.9%
+-commutative10.9%
+-commutative10.9%
Simplified10.9%
Taylor expanded in x around 0 98.4%
Final simplification98.4%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ 1.0 x)) (cbrt x)) 4e-6)
(-
0.0
(/
(+
(* (cbrt x) (- 0.3333333333333333))
(- 0.0 (* -0.1111111111111111 (pow x -0.6666666666666666))))
x))
(+ (pow (+ 1.0 x) 0.3333333333333333) (- 0.0 (pow x 0.3333333333333333)))))
double code(double x) {
double tmp;
if ((cbrt((1.0 + x)) - cbrt(x)) <= 4e-6) {
tmp = 0.0 - (((cbrt(x) * -0.3333333333333333) + (0.0 - (-0.1111111111111111 * pow(x, -0.6666666666666666)))) / x);
} else {
tmp = pow((1.0 + x), 0.3333333333333333) + (0.0 - pow(x, 0.3333333333333333));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((Math.cbrt((1.0 + x)) - Math.cbrt(x)) <= 4e-6) {
tmp = 0.0 - (((Math.cbrt(x) * -0.3333333333333333) + (0.0 - (-0.1111111111111111 * Math.pow(x, -0.6666666666666666)))) / x);
} else {
tmp = Math.pow((1.0 + x), 0.3333333333333333) + (0.0 - Math.pow(x, 0.3333333333333333));
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(1.0 + x)) - cbrt(x)) <= 4e-6) tmp = Float64(0.0 - Float64(Float64(Float64(cbrt(x) * Float64(-0.3333333333333333)) + Float64(0.0 - Float64(-0.1111111111111111 * (x ^ -0.6666666666666666)))) / x)); else tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) + Float64(0.0 - (x ^ 0.3333333333333333))); 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], 4e-6], N[(0.0 - N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision] + N[(0.0 - N[(-0.1111111111111111 * N[Power[x, -0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{1 + x} - \sqrt[3]{x} \leq 4 \cdot 10^{-6}:\\
\;\;\;\;0 - \frac{\sqrt[3]{x} \cdot \left(-0.3333333333333333\right) + \left(0 - -0.1111111111111111 \cdot {x}^{-0.6666666666666666}\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 3.99999999999999982e-6Initial program 5.7%
add-sqr-sqrt5.3%
add-sqr-sqrt5.7%
difference-of-squares5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
pow1/33.2%
sqrt-pow13.2%
metadata-eval3.2%
pow1/35.7%
sqrt-pow15.7%
metadata-eval5.7%
Applied egg-rr5.7%
Taylor expanded in x around inf 99.1%
associate-+r+99.1%
distribute-rgt-out99.1%
metadata-eval99.1%
Simplified99.1%
pow1/399.1%
pow-flip99.1%
pow-pow99.1%
metadata-eval99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 3.99999999999999982e-6 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 88.2%
pow1/388.6%
Applied egg-rr88.6%
pow1/391.0%
Applied egg-rr91.0%
Final simplification98.8%
(FPCore (x)
:precision binary64
(if (<= x 62000000.0)
(+ (pow (+ 1.0 x) 0.3333333333333333) (- 0.0 (pow x 0.3333333333333333)))
(if (<= x 1.35e+154)
(cbrt (/ 0.037037037037037035 (pow x 2.0)))
(if (<= x 7.5e+193)
(*
x
(* 0.3333333333333333 (exp (* 0.3333333333333333 (* -5.0 (log x))))))
(/ 1.0 (+ 1.0 (* (cbrt x) (+ 1.0 (cbrt x)))))))))
double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) + (0.0 - pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else if (x <= 7.5e+193) {
tmp = x * (0.3333333333333333 * exp((0.3333333333333333 * (-5.0 * log(x)))));
} else {
tmp = 1.0 / (1.0 + (cbrt(x) * (1.0 + cbrt(x))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) + (0.0 - Math.pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else if (x <= 7.5e+193) {
tmp = x * (0.3333333333333333 * Math.exp((0.3333333333333333 * (-5.0 * Math.log(x)))));
} else {
tmp = 1.0 / (1.0 + (Math.cbrt(x) * (1.0 + Math.cbrt(x))));
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 62000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) + Float64(0.0 - (x ^ 0.3333333333333333))); elseif (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); elseif (x <= 7.5e+193) tmp = Float64(x * Float64(0.3333333333333333 * exp(Float64(0.3333333333333333 * Float64(-5.0 * log(x)))))); else tmp = Float64(1.0 / Float64(1.0 + Float64(cbrt(x) * Float64(1.0 + cbrt(x))))); end return tmp end
code[x_] := If[LessEqual[x, 62000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[x, 7.5e+193], N[(x * N[(0.3333333333333333 * N[Exp[N[(0.3333333333333333 * N[(-5.0 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 + N[(N[Power[x, 1/3], $MachinePrecision] * N[(1.0 + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 62000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+193}:\\
\;\;\;\;x \cdot \left(0.3333333333333333 \cdot e^{0.3333333333333333 \cdot \left(-5 \cdot \log x\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + \sqrt[3]{x} \cdot \left(1 + \sqrt[3]{x}\right)}\\
\end{array}
\end{array}
if x < 6.2e7Initial program 85.2%
pow1/385.3%
Applied egg-rr85.3%
pow1/388.5%
Applied egg-rr88.5%
if 6.2e7 < x < 1.35000000000000003e154Initial program 6.4%
add-cbrt-cube6.4%
pow36.4%
Applied egg-rr6.4%
Taylor expanded in x around inf 97.3%
if 1.35000000000000003e154 < x < 7.5000000000000008e193Initial program 4.2%
sub-neg4.2%
+-commutative4.2%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.4%
pow1/34.7%
sqrt-pow14.7%
metadata-eval4.7%
pow1/34.7%
sqrt-pow14.7%
metadata-eval4.7%
Applied egg-rr4.7%
Taylor expanded in x around inf 4.2%
associate-+r+4.2%
distribute-rgt1-in4.2%
metadata-eval4.2%
mul0-lft4.2%
+-lft-identity4.2%
Simplified4.2%
pow1/34.2%
pow-to-exp4.2%
pow-flip4.2%
log-pow86.1%
metadata-eval86.1%
Applied egg-rr86.1%
if 7.5000000000000008e193 < x Initial program 5.0%
pow1/33.7%
add-sqr-sqrt3.7%
pow23.7%
pow-pow3.7%
metadata-eval3.7%
Applied egg-rr3.7%
sqrt-pow23.7%
metadata-eval3.7%
pow1/35.0%
flip3--5.0%
frac-2neg5.0%
rem-cube-cbrt3.1%
rem-cube-cbrt5.0%
pow25.0%
distribute-rgt-out5.0%
Applied egg-rr5.0%
associate--l+5.0%
+-commutative5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in x around 0 98.4%
Taylor expanded in x around 0 17.7%
Final simplification64.0%
(FPCore (x)
:precision binary64
(if (<= x 62000000.0)
(+ (pow (+ 1.0 x) 0.3333333333333333) (- 0.0 (pow x 0.3333333333333333)))
(if (<= x 1.35e+154)
(cbrt (/ 0.037037037037037035 (pow x 2.0)))
(*
x
(* 0.3333333333333333 (exp (* 0.3333333333333333 (* -5.0 (log x)))))))))
double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) + (0.0 - pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else {
tmp = x * (0.3333333333333333 * exp((0.3333333333333333 * (-5.0 * log(x)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) + (0.0 - Math.pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else {
tmp = x * (0.3333333333333333 * Math.exp((0.3333333333333333 * (-5.0 * Math.log(x)))));
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 62000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) + Float64(0.0 - (x ^ 0.3333333333333333))); elseif (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); else tmp = Float64(x * Float64(0.3333333333333333 * exp(Float64(0.3333333333333333 * Float64(-5.0 * log(x)))))); end return tmp end
code[x_] := If[LessEqual[x, 62000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[(x * N[(0.3333333333333333 * N[Exp[N[(0.3333333333333333 * N[(-5.0 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 62000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.3333333333333333 \cdot e^{0.3333333333333333 \cdot \left(-5 \cdot \log x\right)}\right)\\
\end{array}
\end{array}
if x < 6.2e7Initial program 85.2%
pow1/385.3%
Applied egg-rr85.3%
pow1/388.5%
Applied egg-rr88.5%
if 6.2e7 < x < 1.35000000000000003e154Initial program 6.4%
add-cbrt-cube6.4%
pow36.4%
Applied egg-rr6.4%
Taylor expanded in x around inf 97.3%
if 1.35000000000000003e154 < x Initial program 4.8%
sub-neg4.8%
+-commutative4.8%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.1%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
Applied egg-rr3.9%
Taylor expanded in x around inf 4.8%
associate-+r+4.8%
distribute-rgt1-in4.8%
metadata-eval4.8%
mul0-lft4.8%
+-lft-identity4.8%
Simplified4.8%
pow1/34.8%
pow-to-exp4.8%
pow-flip4.8%
log-pow25.9%
metadata-eval25.9%
Applied egg-rr25.9%
Final simplification59.0%
(FPCore (x)
:precision binary64
(if (<= x 27000000.0)
(- (cbrt (+ 1.0 x)) (cbrt x))
(if (<= x 1.35e+154)
(cbrt (/ 0.037037037037037035 (pow x 2.0)))
(* (- x) (* (pow x -1.6666666666666667) (- 0.3333333333333333))))))
double code(double x) {
double tmp;
if (x <= 27000000.0) {
tmp = cbrt((1.0 + x)) - cbrt(x);
} else if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else {
tmp = -x * (pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 27000000.0) {
tmp = Math.cbrt((1.0 + x)) - Math.cbrt(x);
} else if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else {
tmp = -x * (Math.pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 27000000.0) tmp = Float64(cbrt(Float64(1.0 + x)) - cbrt(x)); elseif (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); else tmp = Float64(Float64(-x) * Float64((x ^ -1.6666666666666667) * Float64(-0.3333333333333333))); end return tmp end
code[x_] := If[LessEqual[x, 27000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[((-x) * N[(N[Power[x, -1.6666666666666667], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 27000000:\\
\;\;\;\;\sqrt[3]{1 + x} - \sqrt[3]{x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left({x}^{-1.6666666666666667} \cdot \left(-0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if x < 2.7e7Initial program 88.2%
if 2.7e7 < x < 1.35000000000000003e154Initial program 6.9%
add-cbrt-cube6.9%
pow36.9%
Applied egg-rr6.9%
Taylor expanded in x around inf 97.0%
if 1.35000000000000003e154 < x Initial program 4.8%
sub-neg4.8%
+-commutative4.8%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.1%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
Applied egg-rr3.9%
Taylor expanded in x around inf 4.8%
associate-+r+4.8%
distribute-rgt1-in4.8%
metadata-eval4.8%
mul0-lft4.8%
+-lft-identity4.8%
Simplified4.8%
pow1/34.8%
pow-flip4.8%
pow-pow25.4%
metadata-eval25.4%
metadata-eval25.8%
Applied egg-rr25.8%
Final simplification58.9%
(FPCore (x)
:precision binary64
(if (<= x 18000000.0)
(+ (cbrt (+ 1.0 x)) (- 0.0 (pow x 0.3333333333333333)))
(if (<= x 1.35e+154)
(cbrt (/ 0.037037037037037035 (pow x 2.0)))
(* (- x) (* (pow x -1.6666666666666667) (- 0.3333333333333333))))))
double code(double x) {
double tmp;
if (x <= 18000000.0) {
tmp = cbrt((1.0 + x)) + (0.0 - pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else {
tmp = -x * (pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 18000000.0) {
tmp = Math.cbrt((1.0 + x)) + (0.0 - Math.pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else {
tmp = -x * (Math.pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 18000000.0) tmp = Float64(cbrt(Float64(1.0 + x)) + Float64(0.0 - (x ^ 0.3333333333333333))); elseif (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); else tmp = Float64(Float64(-x) * Float64((x ^ -1.6666666666666667) * Float64(-0.3333333333333333))); end return tmp end
code[x_] := If[LessEqual[x, 18000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[((-x) * N[(N[Power[x, -1.6666666666666667], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 18000000:\\
\;\;\;\;\sqrt[3]{1 + x} + \left(0 - {x}^{0.3333333333333333}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left({x}^{-1.6666666666666667} \cdot \left(-0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if x < 1.8e7Initial program 88.2%
pow1/388.6%
Applied egg-rr88.6%
if 1.8e7 < x < 1.35000000000000003e154Initial program 6.9%
add-cbrt-cube6.9%
pow36.9%
Applied egg-rr6.9%
Taylor expanded in x around inf 97.0%
if 1.35000000000000003e154 < x Initial program 4.8%
sub-neg4.8%
+-commutative4.8%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.1%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
Applied egg-rr3.9%
Taylor expanded in x around inf 4.8%
associate-+r+4.8%
distribute-rgt1-in4.8%
metadata-eval4.8%
mul0-lft4.8%
+-lft-identity4.8%
Simplified4.8%
pow1/34.8%
pow-flip4.8%
pow-pow25.4%
metadata-eval25.4%
metadata-eval25.8%
Applied egg-rr25.8%
Final simplification58.9%
(FPCore (x)
:precision binary64
(if (<= x 62000000.0)
(+ (pow (+ 1.0 x) 0.3333333333333333) (- 0.0 (pow x 0.3333333333333333)))
(if (<= x 1.35e+154)
(cbrt (/ 0.037037037037037035 (pow x 2.0)))
(* (- x) (* (pow x -1.6666666666666667) (- 0.3333333333333333))))))
double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) + (0.0 - pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else {
tmp = -x * (pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 62000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) + (0.0 - Math.pow(x, 0.3333333333333333));
} else if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else {
tmp = -x * (Math.pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 62000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) + Float64(0.0 - (x ^ 0.3333333333333333))); elseif (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); else tmp = Float64(Float64(-x) * Float64((x ^ -1.6666666666666667) * Float64(-0.3333333333333333))); end return tmp end
code[x_] := If[LessEqual[x, 62000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] + N[(0.0 - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[((-x) * N[(N[Power[x, -1.6666666666666667], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 62000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} + \left(0 - {x}^{0.3333333333333333}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left({x}^{-1.6666666666666667} \cdot \left(-0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if x < 6.2e7Initial program 85.2%
pow1/385.3%
Applied egg-rr85.3%
pow1/388.5%
Applied egg-rr88.5%
if 6.2e7 < x < 1.35000000000000003e154Initial program 6.4%
add-cbrt-cube6.4%
pow36.4%
Applied egg-rr6.4%
Taylor expanded in x around inf 97.3%
if 1.35000000000000003e154 < x Initial program 4.8%
sub-neg4.8%
+-commutative4.8%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.1%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
Applied egg-rr3.9%
Taylor expanded in x around inf 4.8%
associate-+r+4.8%
distribute-rgt1-in4.8%
metadata-eval4.8%
mul0-lft4.8%
+-lft-identity4.8%
Simplified4.8%
pow1/34.8%
pow-flip4.8%
pow-pow25.4%
metadata-eval25.4%
metadata-eval25.8%
Applied egg-rr25.8%
Final simplification59.0%
(FPCore (x) :precision binary64 (if (<= x 1.35e+154) (cbrt (/ 0.037037037037037035 (pow x 2.0))) (* (- x) (* (pow x -1.6666666666666667) (- 0.3333333333333333)))))
double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = cbrt((0.037037037037037035 / pow(x, 2.0)));
} else {
tmp = -x * (pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = Math.cbrt((0.037037037037037035 / Math.pow(x, 2.0)));
} else {
tmp = -x * (Math.pow(x, -1.6666666666666667) * -0.3333333333333333);
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.35e+154) tmp = cbrt(Float64(0.037037037037037035 / (x ^ 2.0))); else tmp = Float64(Float64(-x) * Float64((x ^ -1.6666666666666667) * Float64(-0.3333333333333333))); end return tmp end
code[x_] := If[LessEqual[x, 1.35e+154], N[Power[N[(0.037037037037037035 / N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[((-x) * N[(N[Power[x, -1.6666666666666667], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{\frac{0.037037037037037035}{{x}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \left({x}^{-1.6666666666666667} \cdot \left(-0.3333333333333333\right)\right)\\
\end{array}
\end{array}
if x < 1.35000000000000003e154Initial program 13.0%
add-cbrt-cube13.0%
pow313.0%
Applied egg-rr13.0%
Taylor expanded in x around inf 92.0%
if 1.35000000000000003e154 < x Initial program 4.8%
sub-neg4.8%
+-commutative4.8%
add-sqr-sqrt3.9%
distribute-rgt-neg-in3.9%
fma-define3.1%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
pow1/33.9%
sqrt-pow13.9%
metadata-eval3.9%
Applied egg-rr3.9%
Taylor expanded in x around inf 4.8%
associate-+r+4.8%
distribute-rgt1-in4.8%
metadata-eval4.8%
mul0-lft4.8%
+-lft-identity4.8%
Simplified4.8%
pow1/34.8%
pow-flip4.8%
pow-pow25.4%
metadata-eval25.4%
metadata-eval25.8%
Applied egg-rr25.8%
Final simplification56.8%
(FPCore (x) :precision binary64 (* (- x) (* (pow x -1.6666666666666667) (- 0.3333333333333333))))
double code(double x) {
return -x * (pow(x, -1.6666666666666667) * -0.3333333333333333);
}
real(8) function code(x)
real(8), intent (in) :: x
code = -x * ((x ** (-1.6666666666666667d0)) * -0.3333333333333333d0)
end function
public static double code(double x) {
return -x * (Math.pow(x, -1.6666666666666667) * -0.3333333333333333);
}
def code(x): return -x * (math.pow(x, -1.6666666666666667) * -0.3333333333333333)
function code(x) return Float64(Float64(-x) * Float64((x ^ -1.6666666666666667) * Float64(-0.3333333333333333))) end
function tmp = code(x) tmp = -x * ((x ^ -1.6666666666666667) * -0.3333333333333333); end
code[x_] := N[((-x) * N[(N[Power[x, -1.6666666666666667], $MachinePrecision] * (-0.3333333333333333)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) \cdot \left({x}^{-1.6666666666666667} \cdot \left(-0.3333333333333333\right)\right)
\end{array}
Initial program 8.6%
sub-neg8.6%
+-commutative8.6%
add-sqr-sqrt8.4%
distribute-rgt-neg-in8.4%
fma-define8.0%
pow1/39.4%
sqrt-pow19.4%
metadata-eval9.4%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
Applied egg-rr9.3%
Taylor expanded in x around inf 6.7%
associate-+r+20.0%
distribute-rgt1-in20.0%
metadata-eval20.0%
mul0-lft20.0%
+-lft-identity20.0%
Simplified20.0%
pow1/319.0%
pow-flip19.7%
pow-pow52.5%
metadata-eval52.5%
metadata-eval53.3%
Applied egg-rr53.3%
Final simplification53.3%
(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 8.6%
Taylor expanded in x around 0 1.8%
sub-neg1.8%
rem-square-sqrt0.0%
fabs-sqr0.0%
rem-square-sqrt5.4%
fabs-neg5.4%
unpow1/35.4%
metadata-eval5.4%
pow-sqr5.4%
fabs-sqr5.4%
pow-sqr5.4%
metadata-eval5.4%
unpow1/35.4%
Simplified5.4%
Final simplification5.4%
(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 8.6%
sub-neg8.6%
+-commutative8.6%
add-sqr-sqrt8.4%
distribute-rgt-neg-in8.4%
fma-define8.0%
pow1/39.4%
sqrt-pow19.4%
metadata-eval9.4%
pow1/39.3%
sqrt-pow19.3%
metadata-eval9.3%
Applied egg-rr9.3%
Taylor expanded in x around inf 4.2%
distribute-rgt1-in4.2%
metadata-eval4.2%
mul0-lft4.2%
mul0-rgt4.2%
Simplified4.2%
Final simplification4.2%
(FPCore (x) :precision binary64 (let* ((t_0 (cbrt (+ x 1.0)))) (/ 1.0 (+ (+ (* t_0 t_0) (* (cbrt x) t_0)) (* (cbrt x) (cbrt x))))))
double code(double x) {
double t_0 = cbrt((x + 1.0));
return 1.0 / (((t_0 * t_0) + (cbrt(x) * t_0)) + (cbrt(x) * cbrt(x)));
}
public static double code(double x) {
double t_0 = Math.cbrt((x + 1.0));
return 1.0 / (((t_0 * t_0) + (Math.cbrt(x) * t_0)) + (Math.cbrt(x) * Math.cbrt(x)));
}
function code(x) t_0 = cbrt(Float64(x + 1.0)) return Float64(1.0 / Float64(Float64(Float64(t_0 * t_0) + Float64(cbrt(x) * t_0)) + Float64(cbrt(x) * cbrt(x)))) end
code[x_] := Block[{t$95$0 = N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision]}, N[(1.0 / N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{x + 1}\\
\frac{1}{\left(t\_0 \cdot t\_0 + \sqrt[3]{x} \cdot t\_0\right) + \sqrt[3]{x} \cdot \sqrt[3]{x}}
\end{array}
\end{array}
herbie shell --seed 2024077
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
:pre (and (> x 1.0) (< x 1e+308))
:alt
(/ 1.0 (+ (+ (* (cbrt (+ x 1.0)) (cbrt (+ x 1.0))) (* (cbrt x) (cbrt (+ x 1.0)))) (* (cbrt x) (cbrt x))))
(- (cbrt (+ x 1.0)) (cbrt x)))