
(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 21 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
(if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 1e-10)
(* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)
(/
(fma -1.0 x (+ 1.0 x))
(fma
(cbrt x)
(cbrt x)
(+
(exp (* (log1p x) 0.6666666666666666))
(* (cbrt x) (cbrt (+ 1.0 x))))))))
double code(double x) {
double tmp;
if ((cbrt((x + 1.0)) - cbrt(x)) <= 1e-10) {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
} else {
tmp = fma(-1.0, x, (1.0 + x)) / fma(cbrt(x), cbrt(x), (exp((log1p(x) * 0.6666666666666666)) + (cbrt(x) * cbrt((1.0 + x)))));
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) <= 1e-10) tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); else tmp = Float64(fma(-1.0, x, Float64(1.0 + x)) / fma(cbrt(x), cbrt(x), Float64(exp(Float64(log1p(x) * 0.6666666666666666)) + Float64(cbrt(x) * cbrt(Float64(1.0 + x)))))); end return tmp end
code[x_] := If[LessEqual[N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1e-10], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(-1.0 * x + N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision] + N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] * 0.6666666666666666), $MachinePrecision]], $MachinePrecision] + N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 10^{-10}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, x, 1 + x\right)}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x}, e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666} + \sqrt[3]{x} \cdot \sqrt[3]{1 + x}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 1.00000000000000004e-10Initial program 4.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.4
Applied rewrites51.4%
Applied rewrites64.8%
Applied rewrites98.6%
if 1.00000000000000004e-10 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 72.4%
lift-+.f64N/A
rem-cube-cbrtN/A
lift-cbrt.f64N/A
sqr-powN/A
lower-fma.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6472.1
Applied rewrites72.1%
Applied rewrites98.1%
Final simplification98.6%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 1e-10)
(* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)
(/
(- (+ 1.0 x) x)
(fma
(cbrt x)
(cbrt x)
(+ (exp (* (log1p x) 0.6666666666666666)) (cbrt (fma x x x)))))))
double code(double x) {
double tmp;
if ((cbrt((x + 1.0)) - cbrt(x)) <= 1e-10) {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
} else {
tmp = ((1.0 + x) - x) / fma(cbrt(x), cbrt(x), (exp((log1p(x) * 0.6666666666666666)) + cbrt(fma(x, x, x))));
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) <= 1e-10) tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); else tmp = Float64(Float64(Float64(1.0 + x) - x) / fma(cbrt(x), cbrt(x), Float64(exp(Float64(log1p(x) * 0.6666666666666666)) + cbrt(fma(x, x, x))))); end return tmp end
code[x_] := If[LessEqual[N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1e-10], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * N[Power[x, 1/3], $MachinePrecision] + N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] * 0.6666666666666666), $MachinePrecision]], $MachinePrecision] + N[Power[N[(x * x + x), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 10^{-10}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{x}, e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666} + \sqrt[3]{\mathsf{fma}\left(x, x, x\right)}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 1.00000000000000004e-10Initial program 4.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.4
Applied rewrites51.4%
Applied rewrites64.8%
Applied rewrites98.6%
if 1.00000000000000004e-10 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 72.4%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6472.0
Applied rewrites72.0%
Applied rewrites97.9%
Final simplification98.6%
(FPCore (x)
:precision binary64
(if (<= (- (cbrt (+ x 1.0)) (cbrt x)) 1e-10)
(* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)
(/
(- (+ 1.0 x) x)
(fma
(cbrt x)
(+ (cbrt (+ 1.0 x)) (cbrt x))
(exp (* (log1p x) 0.6666666666666666))))))
double code(double x) {
double tmp;
if ((cbrt((x + 1.0)) - cbrt(x)) <= 1e-10) {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
} else {
tmp = ((1.0 + x) - x) / fma(cbrt(x), (cbrt((1.0 + x)) + cbrt(x)), exp((log1p(x) * 0.6666666666666666)));
}
return tmp;
}
function code(x) tmp = 0.0 if (Float64(cbrt(Float64(x + 1.0)) - cbrt(x)) <= 1e-10) tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); else tmp = Float64(Float64(Float64(1.0 + x) - x) / fma(cbrt(x), Float64(cbrt(Float64(1.0 + x)) + cbrt(x)), exp(Float64(log1p(x) * 0.6666666666666666)))); end return tmp end
code[x_] := If[LessEqual[N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], 1e-10], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(N[(1.0 + x), $MachinePrecision] - x), $MachinePrecision] / N[(N[Power[x, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 + x), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision] + N[Exp[N[(N[Log[1 + x], $MachinePrecision] * 0.6666666666666666), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{x + 1} - \sqrt[3]{x} \leq 10^{-10}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + x\right) - x}{\mathsf{fma}\left(\sqrt[3]{x}, \sqrt[3]{1 + x} + \sqrt[3]{x}, e^{\mathsf{log1p}\left(x\right) \cdot 0.6666666666666666}\right)}\\
\end{array}
\end{array}
if (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) < 1.00000000000000004e-10Initial program 4.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.4
Applied rewrites51.4%
Applied rewrites64.8%
Applied rewrites98.6%
if 1.00000000000000004e-10 < (-.f64 (cbrt.f64 (+.f64 x #s(literal 1 binary64))) (cbrt.f64 x)) Initial program 72.4%
lift-+.f64N/A
rem-cube-cbrtN/A
lift-cbrt.f64N/A
sqr-powN/A
lower-fma.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6472.1
Applied rewrites72.1%
Applied rewrites97.9%
(FPCore (x)
:precision binary64
(if (<= x 2e+150)
(pow
(/
(* x x)
(fma
0.06172839506172839
(pow (cbrt x) -2.0)
(fma
-0.1111111111111111
(cbrt x)
(* (* (cbrt x) x) 0.3333333333333333))))
-1.0)
(* (* (cbrt (pow x -0.5)) (sqrt (pow x -1.0))) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 2e+150) {
tmp = pow(((x * x) / fma(0.06172839506172839, pow(cbrt(x), -2.0), fma(-0.1111111111111111, cbrt(x), ((cbrt(x) * x) * 0.3333333333333333)))), -1.0);
} else {
tmp = (cbrt(pow(x, -0.5)) * sqrt(pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 2e+150) tmp = Float64(Float64(x * x) / fma(0.06172839506172839, (cbrt(x) ^ -2.0), fma(-0.1111111111111111, cbrt(x), Float64(Float64(cbrt(x) * x) * 0.3333333333333333)))) ^ -1.0; else tmp = Float64(Float64(cbrt((x ^ -0.5)) * sqrt((x ^ -1.0))) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 2e+150], N[Power[N[(N[(x * x), $MachinePrecision] / N[(0.06172839506172839 * N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] + N[(-0.1111111111111111 * N[Power[x, 1/3], $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Sqrt[N[Power[x, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+150}:\\
\;\;\;\;{\left(\frac{x \cdot x}{\mathsf{fma}\left(0.06172839506172839, {\left(\sqrt[3]{x}\right)}^{-2}, \mathsf{fma}\left(-0.1111111111111111, \sqrt[3]{x}, \left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333\right)\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt{{x}^{-1}}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.99999999999999996e150Initial program 11.3%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites48.9%
Applied rewrites96.7%
if 1.99999999999999996e150 < x Initial program 4.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6410.2
Applied rewrites10.2%
Applied rewrites35.5%
Taylor expanded in x around 0
Applied rewrites98.6%
Final simplification97.7%
(FPCore (x)
:precision binary64
(if (<= x 4e+140)
(/
(fma
(* (cbrt x) x)
0.3333333333333333
(fma
(cbrt (/ (pow x -1.0) x))
0.06172839506172839
(* -0.1111111111111111 (cbrt x))))
(* x x))
(* (* (cbrt (pow x -0.5)) (sqrt (pow x -1.0))) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 4e+140) {
tmp = fma((cbrt(x) * x), 0.3333333333333333, fma(cbrt((pow(x, -1.0) / x)), 0.06172839506172839, (-0.1111111111111111 * cbrt(x)))) / (x * x);
} else {
tmp = (cbrt(pow(x, -0.5)) * sqrt(pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 4e+140) tmp = Float64(fma(Float64(cbrt(x) * x), 0.3333333333333333, fma(cbrt(Float64((x ^ -1.0) / x)), 0.06172839506172839, Float64(-0.1111111111111111 * cbrt(x)))) / Float64(x * x)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * sqrt((x ^ -1.0))) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 4e+140], N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333 + N[(N[Power[N[(N[Power[x, -1.0], $MachinePrecision] / x), $MachinePrecision], 1/3], $MachinePrecision] * 0.06172839506172839 + N[(-0.1111111111111111 * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Sqrt[N[Power[x, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{x} \cdot x, 0.3333333333333333, \mathsf{fma}\left(\sqrt[3]{\frac{{x}^{-1}}{x}}, 0.06172839506172839, -0.1111111111111111 \cdot \sqrt[3]{x}\right)\right)}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt{{x}^{-1}}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 4.00000000000000024e140Initial program 11.7%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites51.6%
Applied rewrites96.5%
if 4.00000000000000024e140 < x Initial program 4.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6414.7
Applied rewrites14.7%
Applied rewrites38.7%
Taylor expanded in x around 0
Applied rewrites98.6%
Final simplification97.6%
(FPCore (x)
:precision binary64
(if (<= x 1.5e+231)
(/
(/
(fma
0.06172839506172839
(pow (cbrt x) -2.0)
(fma -0.1111111111111111 (cbrt x) (* (* (cbrt x) x) 0.3333333333333333)))
x)
x)
(* (* (cbrt (pow x -0.5)) (sqrt (pow x -1.0))) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1.5e+231) {
tmp = (fma(0.06172839506172839, pow(cbrt(x), -2.0), fma(-0.1111111111111111, cbrt(x), ((cbrt(x) * x) * 0.3333333333333333))) / x) / x;
} else {
tmp = (cbrt(pow(x, -0.5)) * sqrt(pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.5e+231) tmp = Float64(Float64(fma(0.06172839506172839, (cbrt(x) ^ -2.0), fma(-0.1111111111111111, cbrt(x), Float64(Float64(cbrt(x) * x) * 0.3333333333333333))) / x) / x); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * sqrt((x ^ -1.0))) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1.5e+231], N[(N[(N[(0.06172839506172839 * N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] + N[(-0.1111111111111111 * N[Power[x, 1/3], $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Sqrt[N[Power[x, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{+231}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.06172839506172839, {\left(\sqrt[3]{x}\right)}^{-2}, \mathsf{fma}\left(-0.1111111111111111, \sqrt[3]{x}, \left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333\right)\right)}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt{{x}^{-1}}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.5000000000000001e231Initial program 9.2%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites34.6%
Applied rewrites97.3%
if 1.5000000000000001e231 < x Initial program 5.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f645.1
Applied rewrites5.1%
Applied rewrites5.1%
Taylor expanded in x around 0
Applied rewrites98.5%
Final simplification97.6%
(FPCore (x)
:precision binary64
(if (<= x 4e+140)
(/
(fma
(pow (cbrt x) -2.0)
0.06172839506172839
(fma -0.1111111111111111 (cbrt x) (* (* (cbrt x) x) 0.3333333333333333)))
(* x x))
(* (* (cbrt (pow x -0.5)) (sqrt (pow x -1.0))) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 4e+140) {
tmp = fma(pow(cbrt(x), -2.0), 0.06172839506172839, fma(-0.1111111111111111, cbrt(x), ((cbrt(x) * x) * 0.3333333333333333))) / (x * x);
} else {
tmp = (cbrt(pow(x, -0.5)) * sqrt(pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 4e+140) tmp = Float64(fma((cbrt(x) ^ -2.0), 0.06172839506172839, fma(-0.1111111111111111, cbrt(x), Float64(Float64(cbrt(x) * x) * 0.3333333333333333))) / Float64(x * x)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * sqrt((x ^ -1.0))) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 4e+140], N[(N[(N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * 0.06172839506172839 + N[(-0.1111111111111111 * N[Power[x, 1/3], $MachinePrecision] + N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Sqrt[N[Power[x, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\sqrt[3]{x}\right)}^{-2}, 0.06172839506172839, \mathsf{fma}\left(-0.1111111111111111, \sqrt[3]{x}, \left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333\right)\right)}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt{{x}^{-1}}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 4.00000000000000024e140Initial program 11.7%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites51.6%
Applied rewrites96.5%
if 4.00000000000000024e140 < x Initial program 4.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6414.7
Applied rewrites14.7%
Applied rewrites38.7%
Taylor expanded in x around 0
Applied rewrites98.6%
Final simplification97.6%
(FPCore (x)
:precision binary64
(if (<= x 2e+129)
(/
(/
(fma
(fma (* (cbrt x) x) 0.3333333333333333 (* -0.1111111111111111 (cbrt x)))
x
(* 0.06172839506172839 (cbrt x)))
x)
(* x x))
(* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 2e+129) {
tmp = (fma(fma((cbrt(x) * x), 0.3333333333333333, (-0.1111111111111111 * cbrt(x))), x, (0.06172839506172839 * cbrt(x))) / x) / (x * x);
} else {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 2e+129) tmp = Float64(Float64(fma(fma(Float64(cbrt(x) * x), 0.3333333333333333, Float64(-0.1111111111111111 * cbrt(x))), x, Float64(0.06172839506172839 * cbrt(x))) / x) / Float64(x * x)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 2e+129], N[(N[(N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333 + N[(-0.1111111111111111 * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(0.06172839506172839 * N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+129}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\sqrt[3]{x} \cdot x, 0.3333333333333333, -0.1111111111111111 \cdot \sqrt[3]{x}\right), x, 0.06172839506172839 \cdot \sqrt[3]{x}\right)}{x}}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 2e129Initial program 12.3%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites55.6%
Taylor expanded in x around 0
Applied rewrites55.6%
Applied rewrites96.2%
if 2e129 < x Initial program 4.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6419.9
Applied rewrites19.9%
Applied rewrites42.4%
Applied rewrites98.6%
(FPCore (x)
:precision binary64
(if (<= x 1e+77)
(/
(/
(fma
(* 0.3333333333333333 (cbrt (pow x 4.0)))
x
(* (cbrt x) (fma -0.1111111111111111 x 0.06172839506172839)))
x)
(* x x))
(* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1e+77) {
tmp = (fma((0.3333333333333333 * cbrt(pow(x, 4.0))), x, (cbrt(x) * fma(-0.1111111111111111, x, 0.06172839506172839))) / x) / (x * x);
} else {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1e+77) tmp = Float64(Float64(fma(Float64(0.3333333333333333 * cbrt((x ^ 4.0))), x, Float64(cbrt(x) * fma(-0.1111111111111111, x, 0.06172839506172839))) / x) / Float64(x * x)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1e+77], N[(N[(N[(N[(0.3333333333333333 * N[Power[N[Power[x, 4.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * x + N[(N[Power[x, 1/3], $MachinePrecision] * N[(-0.1111111111111111 * x + 0.06172839506172839), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+77}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.3333333333333333 \cdot \sqrt[3]{{x}^{4}}, x, \sqrt[3]{x} \cdot \mathsf{fma}\left(-0.1111111111111111, x, 0.06172839506172839\right)\right)}{x}}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 9.99999999999999983e76Initial program 18.7%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites94.4%
Taylor expanded in x around inf
Applied rewrites87.4%
Taylor expanded in x around 0
Applied rewrites94.4%
if 9.99999999999999983e76 < x Initial program 4.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6439.1
Applied rewrites39.1%
Applied rewrites56.1%
Applied rewrites98.6%
(FPCore (x) :precision binary64 (if (<= x 46000000.0) (- (pow (+ 1.0 x) 0.3333333333333333) (pow x 0.3333333333333333)) (* (* (cbrt (pow x -0.5)) (sqrt (pow x -1.0))) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) - pow(x, 0.3333333333333333);
} else {
tmp = (cbrt(pow(x, -0.5)) * sqrt(pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) - Math.pow(x, 0.3333333333333333);
} else {
tmp = (Math.cbrt(Math.pow(x, -0.5)) * Math.sqrt(Math.pow(x, -1.0))) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 46000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) - (x ^ 0.3333333333333333)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * sqrt((x ^ -1.0))) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 46000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Sqrt[N[Power[x, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 46000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} - {x}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot \sqrt{{x}^{-1}}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 4.6e7Initial program 78.0%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6478.1
Applied rewrites78.1%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6481.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6481.8
Applied rewrites81.8%
if 4.6e7 < x Initial program 4.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
Applied rewrites64.8%
Taylor expanded in x around 0
Applied rewrites98.2%
Final simplification97.5%
(FPCore (x) :precision binary64 (if (<= x 46000000.0) (- (pow (+ 1.0 x) 0.3333333333333333) (pow x 0.3333333333333333)) (* (* (cbrt (pow x -0.5)) (pow x -0.5)) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) - pow(x, 0.3333333333333333);
} else {
tmp = (cbrt(pow(x, -0.5)) * pow(x, -0.5)) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) - Math.pow(x, 0.3333333333333333);
} else {
tmp = (Math.cbrt(Math.pow(x, -0.5)) * Math.pow(x, -0.5)) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 46000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) - (x ^ 0.3333333333333333)); else tmp = Float64(Float64(cbrt((x ^ -0.5)) * (x ^ -0.5)) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 46000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Power[x, -0.5], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 46000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} - {x}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{{x}^{-0.5}} \cdot {x}^{-0.5}\right) \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 4.6e7Initial program 78.0%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6478.1
Applied rewrites78.1%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6481.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6481.8
Applied rewrites81.8%
if 4.6e7 < x Initial program 4.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
Applied rewrites64.8%
Applied rewrites98.2%
(FPCore (x) :precision binary64 (if (<= x 1.55e+231) (pow (/ x (/ (* (* (cbrt x) x) 0.3333333333333333) x)) -1.0) (* (pow x -0.6666666666666666) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1.55e+231) {
tmp = pow((x / (((cbrt(x) * x) * 0.3333333333333333) / x)), -1.0);
} else {
tmp = pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.55e+231) {
tmp = Math.pow((x / (((Math.cbrt(x) * x) * 0.3333333333333333) / x)), -1.0);
} else {
tmp = Math.pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.55e+231) tmp = Float64(x / Float64(Float64(Float64(cbrt(x) * x) * 0.3333333333333333) / x)) ^ -1.0; else tmp = Float64((x ^ -0.6666666666666666) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1.55e+231], N[Power[N[(x / N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], N[(N[Power[x, -0.6666666666666666], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{+231}:\\
\;\;\;\;{\left(\frac{x}{\frac{\left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333}{x}}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.6666666666666666} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.54999999999999995e231Initial program 9.2%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites34.6%
Taylor expanded in x around inf
Applied rewrites32.1%
Applied rewrites94.8%
if 1.54999999999999995e231 < x Initial program 5.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f645.1
Applied rewrites5.1%
Applied rewrites88.7%
Final simplification93.0%
(FPCore (x) :precision binary64 (if (<= x 1.35e+154) (* (cbrt (pow (* x x) -1.0)) 0.3333333333333333) (* (pow x -0.6666666666666666) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = cbrt(pow((x * x), -1.0)) * 0.3333333333333333;
} else {
tmp = pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = Math.cbrt(Math.pow((x * x), -1.0)) * 0.3333333333333333;
} else {
tmp = Math.pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.35e+154) tmp = Float64(cbrt((Float64(x * x) ^ -1.0)) * 0.3333333333333333); else tmp = Float64((x ^ -0.6666666666666666) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1.35e+154], N[(N[Power[N[Power[N[(x * x), $MachinePrecision], -1.0], $MachinePrecision], 1/3], $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[Power[x, -0.6666666666666666], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{{\left(x \cdot x\right)}^{-1}} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.6666666666666666} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.35000000000000003e154Initial program 11.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6493.0
Applied rewrites93.0%
Applied rewrites93.0%
if 1.35000000000000003e154 < x Initial program 4.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f645.8
Applied rewrites5.8%
Applied rewrites89.0%
Final simplification91.1%
(FPCore (x) :precision binary64 (if (<= x 46000000.0) (- (pow (+ 1.0 x) 0.3333333333333333) (pow x 0.3333333333333333)) (* (pow (cbrt x) -2.0) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = pow((1.0 + x), 0.3333333333333333) - pow(x, 0.3333333333333333);
} else {
tmp = pow(cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 46000000.0) {
tmp = Math.pow((1.0 + x), 0.3333333333333333) - Math.pow(x, 0.3333333333333333);
} else {
tmp = Math.pow(Math.cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 46000000.0) tmp = Float64((Float64(1.0 + x) ^ 0.3333333333333333) - (x ^ 0.3333333333333333)); else tmp = Float64((cbrt(x) ^ -2.0) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 46000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.3333333333333333], $MachinePrecision] - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 46000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.3333333333333333} - {x}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{x}\right)}^{-2} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 4.6e7Initial program 78.0%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6478.1
Applied rewrites78.1%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6481.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6481.8
Applied rewrites81.8%
if 4.6e7 < x Initial program 4.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
Applied rewrites98.0%
(FPCore (x) :precision binary64 (if (<= x 16200000.0) (- (cbrt (+ x 1.0)) (pow x 0.3333333333333333)) (* (pow (cbrt x) -2.0) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 16200000.0) {
tmp = cbrt((x + 1.0)) - pow(x, 0.3333333333333333);
} else {
tmp = pow(cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 16200000.0) {
tmp = Math.cbrt((x + 1.0)) - Math.pow(x, 0.3333333333333333);
} else {
tmp = Math.pow(Math.cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 16200000.0) tmp = Float64(cbrt(Float64(x + 1.0)) - (x ^ 0.3333333333333333)); else tmp = Float64((cbrt(x) ^ -2.0) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 16200000.0], N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 16200000:\\
\;\;\;\;\sqrt[3]{x + 1} - {x}^{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{x}\right)}^{-2} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.62e7Initial program 80.0%
lift-cbrt.f64N/A
pow1/3N/A
lower-pow.f6480.2
Applied rewrites80.2%
if 1.62e7 < x Initial program 5.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
Applied rewrites97.8%
(FPCore (x) :precision binary64 (if (<= x 27000000.0) (- (cbrt (+ x 1.0)) (cbrt x)) (* (pow (cbrt x) -2.0) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 27000000.0) {
tmp = cbrt((x + 1.0)) - cbrt(x);
} else {
tmp = pow(cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 27000000.0) {
tmp = Math.cbrt((x + 1.0)) - Math.cbrt(x);
} else {
tmp = Math.pow(Math.cbrt(x), -2.0) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 27000000.0) tmp = Float64(cbrt(Float64(x + 1.0)) - cbrt(x)); else tmp = Float64((cbrt(x) ^ -2.0) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 27000000.0], N[(N[Power[N[(x + 1.0), $MachinePrecision], 1/3], $MachinePrecision] - N[Power[x, 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 27000000:\\
\;\;\;\;\sqrt[3]{x + 1} - \sqrt[3]{x}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{x}\right)}^{-2} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 2.7e7Initial program 80.0%
if 2.7e7 < x Initial program 5.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
Applied rewrites97.8%
(FPCore (x) :precision binary64 (* (pow (cbrt x) -2.0) 0.3333333333333333))
double code(double x) {
return pow(cbrt(x), -2.0) * 0.3333333333333333;
}
public static double code(double x) {
return Math.pow(Math.cbrt(x), -2.0) * 0.3333333333333333;
}
function code(x) return Float64((cbrt(x) ^ -2.0) * 0.3333333333333333) end
code[x_] := N[(N[Power[N[Power[x, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sqrt[3]{x}\right)}^{-2} \cdot 0.3333333333333333
\end{array}
Initial program 8.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.1
Applied rewrites51.1%
Applied rewrites95.5%
(FPCore (x) :precision binary64 (if (<= x 1.55e+231) (/ (/ (* (* (cbrt x) x) 0.3333333333333333) x) x) (* (pow x -0.6666666666666666) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1.55e+231) {
tmp = (((cbrt(x) * x) * 0.3333333333333333) / x) / x;
} else {
tmp = pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.55e+231) {
tmp = (((Math.cbrt(x) * x) * 0.3333333333333333) / x) / x;
} else {
tmp = Math.pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.55e+231) tmp = Float64(Float64(Float64(Float64(cbrt(x) * x) * 0.3333333333333333) / x) / x); else tmp = Float64((x ^ -0.6666666666666666) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1.55e+231], N[(N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], N[(N[Power[x, -0.6666666666666666], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{+231}:\\
\;\;\;\;\frac{\frac{\left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.6666666666666666} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.54999999999999995e231Initial program 9.2%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites34.6%
Taylor expanded in x around inf
Applied rewrites32.1%
Applied rewrites94.8%
if 1.54999999999999995e231 < x Initial program 5.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f645.1
Applied rewrites5.1%
Applied rewrites88.7%
(FPCore (x) :precision binary64 (if (<= x 1.35e+154) (/ (* (* (cbrt x) x) 0.3333333333333333) (* x x)) (* (pow x -0.6666666666666666) 0.3333333333333333)))
double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = ((cbrt(x) * x) * 0.3333333333333333) / (x * x);
} else {
tmp = pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
public static double code(double x) {
double tmp;
if (x <= 1.35e+154) {
tmp = ((Math.cbrt(x) * x) * 0.3333333333333333) / (x * x);
} else {
tmp = Math.pow(x, -0.6666666666666666) * 0.3333333333333333;
}
return tmp;
}
function code(x) tmp = 0.0 if (x <= 1.35e+154) tmp = Float64(Float64(Float64(cbrt(x) * x) * 0.3333333333333333) / Float64(x * x)); else tmp = Float64((x ^ -0.6666666666666666) * 0.3333333333333333); end return tmp end
code[x_] := If[LessEqual[x, 1.35e+154], N[(N[(N[(N[Power[x, 1/3], $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -0.6666666666666666], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(\sqrt[3]{x} \cdot x\right) \cdot 0.3333333333333333}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.6666666666666666} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if x < 1.35000000000000003e154Initial program 11.0%
Taylor expanded in x around inf
lower-/.f64N/A
Applied rewrites46.8%
Taylor expanded in x around inf
Applied rewrites43.4%
Applied rewrites93.4%
if 1.35000000000000003e154 < x Initial program 4.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f645.8
Applied rewrites5.8%
Applied rewrites89.0%
(FPCore (x) :precision binary64 (* (pow x -0.6666666666666666) 0.3333333333333333))
double code(double x) {
return pow(x, -0.6666666666666666) * 0.3333333333333333;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x ** (-0.6666666666666666d0)) * 0.3333333333333333d0
end function
public static double code(double x) {
return Math.pow(x, -0.6666666666666666) * 0.3333333333333333;
}
def code(x): return math.pow(x, -0.6666666666666666) * 0.3333333333333333
function code(x) return Float64((x ^ -0.6666666666666666) * 0.3333333333333333) end
function tmp = code(x) tmp = (x ^ -0.6666666666666666) * 0.3333333333333333; end
code[x_] := N[(N[Power[x, -0.6666666666666666], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
{x}^{-0.6666666666666666} \cdot 0.3333333333333333
\end{array}
Initial program 8.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
lower-cbrt.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6451.1
Applied rewrites51.1%
Applied rewrites87.9%
(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.0%
Taylor expanded in x around 0
Applied rewrites1.8%
(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 2024313
(FPCore (x)
:name "2cbrt (problem 3.3.4)"
:precision binary64
:pre (and (> x 1.0) (< x 1e+308))
:alt
(! :herbie-platform default (/ 1 (+ (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (cbrt x) (cbrt (+ x 1))) (* (cbrt x) (cbrt x)))))
(- (cbrt (+ x 1.0)) (cbrt x)))