
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
double code(double g, double a) {
return cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
return Math.cbrt((g / (2.0 * a)));
}
function code(g, a) return cbrt(Float64(g / Float64(2.0 * a))) end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{2 \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
double code(double g, double a) {
return cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
return Math.cbrt((g / (2.0 * a)));
}
function code(g, a) return cbrt(Float64(g / Float64(2.0 * a))) end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{2 \cdot a}}
\end{array}
(FPCore (g a) :precision binary64 (/ (cbrt (/ 0.5 (pow g -1.0))) (cbrt a)))
double code(double g, double a) {
return cbrt((0.5 / pow(g, -1.0))) / cbrt(a);
}
public static double code(double g, double a) {
return Math.cbrt((0.5 / Math.pow(g, -1.0))) / Math.cbrt(a);
}
function code(g, a) return Float64(cbrt(Float64(0.5 / (g ^ -1.0))) / cbrt(a)) end
code[g_, a_] := N[(N[Power[N[(0.5 / N[Power[g, -1.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{\frac{0.5}{{g}^{-1}}}}{\sqrt[3]{a}}
\end{array}
Initial program 71.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
/-rgt-identityN/A
lift-neg.f64N/A
metadata-evalN/A
frac-2negN/A
cbrt-undivN/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites98.8%
lift-*.f64N/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
*-inversesN/A
inv-powN/A
lower-pow.f6498.8
Applied rewrites98.8%
(FPCore (g a) :precision binary64 (if (<= (* 2.0 a) -2e-303) (* (cbrt (* -0.5 g)) (pow (- a) -0.3333333333333333)) (* (pow (* 2.0 a) -0.3333333333333333) (cbrt g))))
double code(double g, double a) {
double tmp;
if ((2.0 * a) <= -2e-303) {
tmp = cbrt((-0.5 * g)) * pow(-a, -0.3333333333333333);
} else {
tmp = pow((2.0 * a), -0.3333333333333333) * cbrt(g);
}
return tmp;
}
public static double code(double g, double a) {
double tmp;
if ((2.0 * a) <= -2e-303) {
tmp = Math.cbrt((-0.5 * g)) * Math.pow(-a, -0.3333333333333333);
} else {
tmp = Math.pow((2.0 * a), -0.3333333333333333) * Math.cbrt(g);
}
return tmp;
}
function code(g, a) tmp = 0.0 if (Float64(2.0 * a) <= -2e-303) tmp = Float64(cbrt(Float64(-0.5 * g)) * (Float64(-a) ^ -0.3333333333333333)); else tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * cbrt(g)); end return tmp end
code[g_, a_] := If[LessEqual[N[(2.0 * a), $MachinePrecision], -2e-303], N[(N[Power[N[(-0.5 * g), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[(-a), -0.3333333333333333], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt[3]{-0.5 \cdot g} \cdot {\left(-a\right)}^{-0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) a) < -1.99999999999999986e-303Initial program 69.4%
Applied rewrites98.7%
lift-cbrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
cbrt-divN/A
metadata-evalN/A
metadata-evalN/A
pow1/3N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval92.1
Applied rewrites92.1%
if -1.99999999999999986e-303 < (*.f64 #s(literal 2 binary64) a) Initial program 73.3%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
cbrt-undivN/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
cbrt-prodN/A
cbrt-unprodN/A
lift-cbrt.f64N/A
pow1/3N/A
lower-*.f64N/A
Applied rewrites98.7%
lift-cbrt.f64N/A
lift-/.f64N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
pow1/3N/A
pow-flipN/A
lower-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval92.1
Applied rewrites92.1%
Final simplification92.1%
(FPCore (g a) :precision binary64 (if (<= (* 2.0 a) -2e-303) (cbrt (/ (/ 1.0 (/ (/ -1.0 g) -0.5)) a)) (* (pow (* 2.0 a) -0.3333333333333333) (cbrt g))))
double code(double g, double a) {
double tmp;
if ((2.0 * a) <= -2e-303) {
tmp = cbrt(((1.0 / ((-1.0 / g) / -0.5)) / a));
} else {
tmp = pow((2.0 * a), -0.3333333333333333) * cbrt(g);
}
return tmp;
}
public static double code(double g, double a) {
double tmp;
if ((2.0 * a) <= -2e-303) {
tmp = Math.cbrt(((1.0 / ((-1.0 / g) / -0.5)) / a));
} else {
tmp = Math.pow((2.0 * a), -0.3333333333333333) * Math.cbrt(g);
}
return tmp;
}
function code(g, a) tmp = 0.0 if (Float64(2.0 * a) <= -2e-303) tmp = cbrt(Float64(Float64(1.0 / Float64(Float64(-1.0 / g) / -0.5)) / a)); else tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * cbrt(g)); end return tmp end
code[g_, a_] := If[LessEqual[N[(2.0 * a), $MachinePrecision], -2e-303], N[Power[N[(N[(1.0 / N[(N[(-1.0 / g), $MachinePrecision] / -0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt[3]{\frac{\frac{1}{\frac{\frac{-1}{g}}{-0.5}}}{a}}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) a) < -1.99999999999999986e-303Initial program 69.4%
lift-/.f64N/A
frac-2negN/A
clear-numN/A
associate-/r/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites69.3%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
associate-*r*N/A
lift-/.f64N/A
associate-*l/N/A
metadata-evalN/A
*-inversesN/A
times-fracN/A
associate-*r*N/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-neg.f64N/A
clear-numN/A
metadata-evalN/A
*-commutativeN/A
associate-*l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites69.4%
if -1.99999999999999986e-303 < (*.f64 #s(literal 2 binary64) a) Initial program 73.3%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
cbrt-undivN/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
cbrt-prodN/A
cbrt-unprodN/A
lift-cbrt.f64N/A
pow1/3N/A
lower-*.f64N/A
Applied rewrites98.7%
lift-cbrt.f64N/A
lift-/.f64N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
pow1/3N/A
pow-flipN/A
lower-pow.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval92.1
Applied rewrites92.1%
(FPCore (g a) :precision binary64 (/ (cbrt (* g 0.5)) (cbrt a)))
double code(double g, double a) {
return cbrt((g * 0.5)) / cbrt(a);
}
public static double code(double g, double a) {
return Math.cbrt((g * 0.5)) / Math.cbrt(a);
}
function code(g, a) return Float64(cbrt(Float64(g * 0.5)) / cbrt(a)) end
code[g_, a_] := N[(N[Power[N[(g * 0.5), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{g \cdot 0.5}}{\sqrt[3]{a}}
\end{array}
Initial program 71.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
/-rgt-identityN/A
lift-neg.f64N/A
metadata-evalN/A
frac-2negN/A
cbrt-undivN/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites98.8%
Final simplification98.8%
(FPCore (g a) :precision binary64 (/ (cbrt g) (cbrt (* 2.0 a))))
double code(double g, double a) {
return cbrt(g) / cbrt((2.0 * a));
}
public static double code(double g, double a) {
return Math.cbrt(g) / Math.cbrt((2.0 * a));
}
function code(g, a) return Float64(cbrt(g) / cbrt(Float64(2.0 * a))) end
code[g_, a_] := N[(N[Power[g, 1/3], $MachinePrecision] / N[Power[N[(2.0 * a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}}
\end{array}
Initial program 71.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
/-rgt-identityN/A
lift-neg.f64N/A
metadata-evalN/A
frac-2negN/A
cbrt-undivN/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
un-div-invN/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites98.8%
lift-*.f64N/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
*-inversesN/A
inv-powN/A
lower-pow.f6498.8
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
remove-double-negN/A
neg-mul-1N/A
cbrt-divN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-pow.f64N/A
unpow-1N/A
remove-double-divN/A
frac-timesN/A
metadata-evalN/A
frac-2negN/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
cbrt-divN/A
lift-cbrt.f64N/A
lower-/.f64N/A
lower-cbrt.f6498.7
Applied rewrites98.7%
(FPCore (g a) :precision binary64 (* (cbrt (/ 0.5 a)) (cbrt g)))
double code(double g, double a) {
return cbrt((0.5 / a)) * cbrt(g);
}
public static double code(double g, double a) {
return Math.cbrt((0.5 / a)) * Math.cbrt(g);
}
function code(g, a) return Float64(cbrt(Float64(0.5 / a)) * cbrt(g)) end
code[g_, a_] := N[(N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g}
\end{array}
Initial program 71.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
cbrt-undivN/A
div-invN/A
metadata-evalN/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
cbrt-prodN/A
cbrt-unprodN/A
lift-cbrt.f64N/A
pow1/3N/A
lower-*.f64N/A
Applied rewrites98.7%
(FPCore (g a) :precision binary64 (cbrt (/ (/ 1.0 (/ (/ -1.0 g) -0.5)) a)))
double code(double g, double a) {
return cbrt(((1.0 / ((-1.0 / g) / -0.5)) / a));
}
public static double code(double g, double a) {
return Math.cbrt(((1.0 / ((-1.0 / g) / -0.5)) / a));
}
function code(g, a) return cbrt(Float64(Float64(1.0 / Float64(Float64(-1.0 / g) / -0.5)) / a)) end
code[g_, a_] := N[Power[N[(N[(1.0 / N[(N[(-1.0 / g), $MachinePrecision] / -0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{\frac{1}{\frac{\frac{-1}{g}}{-0.5}}}{a}}
\end{array}
Initial program 71.5%
lift-/.f64N/A
frac-2negN/A
clear-numN/A
associate-/r/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites71.4%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
associate-*r*N/A
lift-/.f64N/A
associate-*l/N/A
metadata-evalN/A
*-inversesN/A
times-fracN/A
associate-*r*N/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-neg.f64N/A
clear-numN/A
metadata-evalN/A
*-commutativeN/A
associate-*l/N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites71.5%
(FPCore (g a) :precision binary64 (cbrt (* (/ 1.0 (/ -1.0 g)) (/ -0.5 a))))
double code(double g, double a) {
return cbrt(((1.0 / (-1.0 / g)) * (-0.5 / a)));
}
public static double code(double g, double a) {
return Math.cbrt(((1.0 / (-1.0 / g)) * (-0.5 / a)));
}
function code(g, a) return cbrt(Float64(Float64(1.0 / Float64(-1.0 / g)) * Float64(-0.5 / a))) end
code[g_, a_] := N[Power[N[(N[(1.0 / N[(-1.0 / g), $MachinePrecision]), $MachinePrecision] * N[(-0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{1}{\frac{-1}{g}} \cdot \frac{-0.5}{a}}
\end{array}
Initial program 71.5%
lift-/.f64N/A
frac-2negN/A
clear-numN/A
associate-/r/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites71.4%
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-neg.f64N/A
clear-numN/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift-neg.f64N/A
associate-/r*N/A
*-inversesN/A
metadata-evalN/A
lift-neg.f64N/A
neg-mul-1N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6471.5
Applied rewrites71.5%
Final simplification71.5%
(FPCore (g a) :precision binary64 (cbrt (/ (/ -0.5 a) (/ -1.0 g))))
double code(double g, double a) {
return cbrt(((-0.5 / a) / (-1.0 / g)));
}
public static double code(double g, double a) {
return Math.cbrt(((-0.5 / a) / (-1.0 / g)));
}
function code(g, a) return cbrt(Float64(Float64(-0.5 / a) / Float64(-1.0 / g))) end
code[g_, a_] := N[Power[N[(N[(-0.5 / a), $MachinePrecision] / N[(-1.0 / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{\frac{-0.5}{a}}{\frac{-1}{g}}}
\end{array}
Initial program 71.5%
lift-/.f64N/A
frac-2negN/A
clear-numN/A
div-invN/A
associate-/r*N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites71.5%
(FPCore (g a) :precision binary64 (cbrt (/ g (/ -1.0 (/ -0.5 a)))))
double code(double g, double a) {
return cbrt((g / (-1.0 / (-0.5 / a))));
}
public static double code(double g, double a) {
return Math.cbrt((g / (-1.0 / (-0.5 / a))));
}
function code(g, a) return cbrt(Float64(g / Float64(-1.0 / Float64(-0.5 / a)))) end
code[g_, a_] := N[Power[N[(g / N[(-1.0 / N[(-0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{\frac{-1}{\frac{-0.5}{a}}}}
\end{array}
Initial program 71.5%
remove-double-divN/A
frac-2negN/A
metadata-evalN/A
distribute-frac-neg2N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow2N/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
lower-/.f64N/A
Applied rewrites71.5%
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
double code(double g, double a) {
return cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
return Math.cbrt((g / (2.0 * a)));
}
function code(g, a) return cbrt(Float64(g / Float64(2.0 * a))) end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{2 \cdot a}}
\end{array}
Initial program 71.5%
(FPCore (g a) :precision binary64 (cbrt (* (/ 0.5 a) g)))
double code(double g, double a) {
return cbrt(((0.5 / a) * g));
}
public static double code(double g, double a) {
return Math.cbrt(((0.5 / a) * g));
}
function code(g, a) return cbrt(Float64(Float64(0.5 / a) * g)) end
code[g_, a_] := N[Power[N[(N[(0.5 / a), $MachinePrecision] * g), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{0.5}{a} \cdot g}
\end{array}
Initial program 71.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
cbrt-divN/A
distribute-neg-fracN/A
cbrt-divN/A
pow1/3N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
remove-double-negN/A
remove-double-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/3N/A
cbrt-divN/A
pow1/3N/A
lower-/.f64N/A
Applied rewrites98.8%
lift-/.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
cbrt-undivN/A
lift-neg.f64N/A
distribute-frac-neg2N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-cbrt.f6471.4
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
distribute-frac-neg2N/A
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
Applied rewrites71.4%
herbie shell --seed 2024268
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))