
(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 10 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 (* 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 76.5%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
cbrt-divN/A
lower-/.f64N/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-cbrt.f6498.8
Applied rewrites98.8%
(FPCore (g a) :precision binary64 (if (<= (* a 2.0) -4e-304) (* (pow (- a) -0.3333333333333333) (cbrt (* g -0.5))) (* (cbrt (* g 0.5)) (pow a -0.3333333333333333))))
double code(double g, double a) {
double tmp;
if ((a * 2.0) <= -4e-304) {
tmp = pow(-a, -0.3333333333333333) * cbrt((g * -0.5));
} else {
tmp = cbrt((g * 0.5)) * pow(a, -0.3333333333333333);
}
return tmp;
}
public static double code(double g, double a) {
double tmp;
if ((a * 2.0) <= -4e-304) {
tmp = Math.pow(-a, -0.3333333333333333) * Math.cbrt((g * -0.5));
} else {
tmp = Math.cbrt((g * 0.5)) * Math.pow(a, -0.3333333333333333);
}
return tmp;
}
function code(g, a) tmp = 0.0 if (Float64(a * 2.0) <= -4e-304) tmp = Float64((Float64(-a) ^ -0.3333333333333333) * cbrt(Float64(g * -0.5))); else tmp = Float64(cbrt(Float64(g * 0.5)) * (a ^ -0.3333333333333333)); end return tmp end
code[g_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], -4e-304], N[(N[Power[(-a), -0.3333333333333333], $MachinePrecision] * N[Power[N[(g * -0.5), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(g * 0.5), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[a, -0.3333333333333333], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -4 \cdot 10^{-304}:\\
\;\;\;\;{\left(-a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{g \cdot 0.5} \cdot {a}^{-0.3333333333333333}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) a) < -3.99999999999999988e-304Initial program 78.4%
lift-cbrt.f64N/A
lift-/.f64N/A
cbrt-divN/A
frac-2negN/A
neg-mul-1N/A
lift-*.f64N/A
*-commutativeN/A
cbrt-prodN/A
distribute-rgt-neg-inN/A
times-fracN/A
distribute-neg-frac2N/A
cbrt-divN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cbrt.f64N/A
lower-neg.f64N/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval98.8
Applied rewrites98.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mul-1-negN/A
lift-neg.f64N/A
remove-double-negN/A
lift-cbrt.f64N/A
lift-*.f64N/A
metadata-evalN/A
div-invN/A
lift-cbrt.f64N/A
cbrt-divN/A
un-div-invN/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
associate-*r/N/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
*-commutativeN/A
Applied rewrites91.8%
if -3.99999999999999988e-304 < (*.f64 #s(literal 2 binary64) a) Initial program 74.8%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
cbrt-prodN/A
pow1/3N/A
*-commutativeN/A
lower-*.f64N/A
inv-powN/A
pow-powN/A
lower-pow.f64N/A
metadata-evalN/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval92.3
Applied rewrites92.3%
Final simplification92.0%
(FPCore (g a) :precision binary64 (if (<= (* a 2.0) 2e-302) (/ 1.0 (cbrt (/ (/ 2.0 (/ -1.0 a)) (- g)))) (* (cbrt (* g 0.5)) (pow a -0.3333333333333333))))
double code(double g, double a) {
double tmp;
if ((a * 2.0) <= 2e-302) {
tmp = 1.0 / cbrt(((2.0 / (-1.0 / a)) / -g));
} else {
tmp = cbrt((g * 0.5)) * pow(a, -0.3333333333333333);
}
return tmp;
}
public static double code(double g, double a) {
double tmp;
if ((a * 2.0) <= 2e-302) {
tmp = 1.0 / Math.cbrt(((2.0 / (-1.0 / a)) / -g));
} else {
tmp = Math.cbrt((g * 0.5)) * Math.pow(a, -0.3333333333333333);
}
return tmp;
}
function code(g, a) tmp = 0.0 if (Float64(a * 2.0) <= 2e-302) tmp = Float64(1.0 / cbrt(Float64(Float64(2.0 / Float64(-1.0 / a)) / Float64(-g)))); else tmp = Float64(cbrt(Float64(g * 0.5)) * (a ^ -0.3333333333333333)); end return tmp end
code[g_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], 2e-302], N[(1.0 / N[Power[N[(N[(2.0 / N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] / (-g)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(g * 0.5), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[a, -0.3333333333333333], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq 2 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{\frac{2}{\frac{-1}{a}}}{-g}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{g \cdot 0.5} \cdot {a}^{-0.3333333333333333}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) a) < 1.9999999999999999e-302Initial program 78.6%
lift-/.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites35.5%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6433.4
Applied rewrites33.4%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
*-inversesN/A
*-rgt-identityN/A
associate-/r/N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
associate-/r/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
metadata-evalN/A
frac-2negN/A
lower-/.f6478.8
Applied rewrites78.8%
if 1.9999999999999999e-302 < (*.f64 #s(literal 2 binary64) a) Initial program 74.6%
lift-cbrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
cbrt-prodN/A
pow1/3N/A
*-commutativeN/A
lower-*.f64N/A
inv-powN/A
pow-powN/A
lower-pow.f64N/A
metadata-evalN/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval92.3
Applied rewrites92.3%
Final simplification85.9%
(FPCore (g a) :precision binary64 (/ (cbrt g) (cbrt (* a 2.0))))
double code(double g, double a) {
return cbrt(g) / cbrt((a * 2.0));
}
public static double code(double g, double a) {
return Math.cbrt(g) / Math.cbrt((a * 2.0));
}
function code(g, a) return Float64(cbrt(g) / cbrt(Float64(a * 2.0))) end
code[g_, a_] := N[(N[Power[g, 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt[3]{g}}{\sqrt[3]{a \cdot 2}}
\end{array}
Initial program 76.5%
lift-cbrt.f64N/A
lift-/.f64N/A
cbrt-divN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6498.4
Applied rewrites98.4%
Final simplification98.4%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0))))
(if (<= t_0 -5e-321)
(/ 1.0 (cbrt (/ (/ 2.0 (/ -1.0 a)) (- g))))
(if (<= t_0 2e-322)
(/ (* g 0.5) (cbrt (* a (* (* g 0.5) (* g 0.5)))))
(/ 1.0 (cbrt (/ 2.0 (/ g a))))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double tmp;
if (t_0 <= -5e-321) {
tmp = 1.0 / cbrt(((2.0 / (-1.0 / a)) / -g));
} else if (t_0 <= 2e-322) {
tmp = (g * 0.5) / cbrt((a * ((g * 0.5) * (g * 0.5))));
} else {
tmp = 1.0 / cbrt((2.0 / (g / a)));
}
return tmp;
}
public static double code(double g, double a) {
double t_0 = g / (a * 2.0);
double tmp;
if (t_0 <= -5e-321) {
tmp = 1.0 / Math.cbrt(((2.0 / (-1.0 / a)) / -g));
} else if (t_0 <= 2e-322) {
tmp = (g * 0.5) / Math.cbrt((a * ((g * 0.5) * (g * 0.5))));
} else {
tmp = 1.0 / Math.cbrt((2.0 / (g / a)));
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) tmp = 0.0 if (t_0 <= -5e-321) tmp = Float64(1.0 / cbrt(Float64(Float64(2.0 / Float64(-1.0 / a)) / Float64(-g)))); elseif (t_0 <= 2e-322) tmp = Float64(Float64(g * 0.5) / cbrt(Float64(a * Float64(Float64(g * 0.5) * Float64(g * 0.5))))); else tmp = Float64(1.0 / cbrt(Float64(2.0 / Float64(g / a)))); end return tmp end
code[g_, a_] := Block[{t$95$0 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-321], N[(1.0 / N[Power[N[(N[(2.0 / N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] / (-g)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-322], N[(N[(g * 0.5), $MachinePrecision] / N[Power[N[(a * N[(N[(g * 0.5), $MachinePrecision] * N[(g * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(2.0 / N[(g / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{\frac{2}{\frac{-1}{a}}}{-g}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-322}:\\
\;\;\;\;\frac{g \cdot 0.5}{\sqrt[3]{a \cdot \left(\left(g \cdot 0.5\right) \cdot \left(g \cdot 0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{2}{\frac{g}{a}}}}\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -4.99994e-321Initial program 88.5%
lift-/.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites43.2%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
*-inversesN/A
*-rgt-identityN/A
associate-/r/N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
associate-/r/N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
metadata-evalN/A
frac-2negN/A
lower-/.f6489.7
Applied rewrites89.7%
if -4.99994e-321 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 1.97626e-322Initial program 5.7%
lift-cbrt.f64N/A
lift-/.f64N/A
cbrt-divN/A
frac-2negN/A
neg-mul-1N/A
lift-*.f64N/A
*-commutativeN/A
cbrt-prodN/A
distribute-rgt-neg-inN/A
times-fracN/A
distribute-neg-frac2N/A
cbrt-divN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cbrt.f64N/A
lower-neg.f64N/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval98.7
Applied rewrites98.7%
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-sub0N/A
flip3--N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites24.9%
if 1.97626e-322 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 91.4%
lift-/.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites50.6%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6445.0
Applied rewrites45.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
*-inversesN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Final simplification80.1%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0))))
(if (<= t_0 -5e-321)
(/ 1.0 (cbrt (/ a (* g 0.5))))
(if (<= t_0 2e-322)
(/ (* g 0.5) (cbrt (* a (* (* g 0.5) (* g 0.5)))))
(/ 1.0 (cbrt (/ 2.0 (/ g a))))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double tmp;
if (t_0 <= -5e-321) {
tmp = 1.0 / cbrt((a / (g * 0.5)));
} else if (t_0 <= 2e-322) {
tmp = (g * 0.5) / cbrt((a * ((g * 0.5) * (g * 0.5))));
} else {
tmp = 1.0 / cbrt((2.0 / (g / a)));
}
return tmp;
}
public static double code(double g, double a) {
double t_0 = g / (a * 2.0);
double tmp;
if (t_0 <= -5e-321) {
tmp = 1.0 / Math.cbrt((a / (g * 0.5)));
} else if (t_0 <= 2e-322) {
tmp = (g * 0.5) / Math.cbrt((a * ((g * 0.5) * (g * 0.5))));
} else {
tmp = 1.0 / Math.cbrt((2.0 / (g / a)));
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) tmp = 0.0 if (t_0 <= -5e-321) tmp = Float64(1.0 / cbrt(Float64(a / Float64(g * 0.5)))); elseif (t_0 <= 2e-322) tmp = Float64(Float64(g * 0.5) / cbrt(Float64(a * Float64(Float64(g * 0.5) * Float64(g * 0.5))))); else tmp = Float64(1.0 / cbrt(Float64(2.0 / Float64(g / a)))); end return tmp end
code[g_, a_] := Block[{t$95$0 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-321], N[(1.0 / N[Power[N[(a / N[(g * 0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-322], N[(N[(g * 0.5), $MachinePrecision] / N[Power[N[(a * N[(N[(g * 0.5), $MachinePrecision] * N[(g * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(2.0 / N[(g / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-321}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-322}:\\
\;\;\;\;\frac{g \cdot 0.5}{\sqrt[3]{a \cdot \left(\left(g \cdot 0.5\right) \cdot \left(g \cdot 0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{2}{\frac{g}{a}}}}\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -4.99994e-321Initial program 88.5%
lift-cbrt.f64N/A
lift-/.f64N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
clear-numN/A
lift-*.f64N/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval89.6
Applied rewrites89.6%
if -4.99994e-321 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 1.97626e-322Initial program 5.7%
lift-cbrt.f64N/A
lift-/.f64N/A
cbrt-divN/A
frac-2negN/A
neg-mul-1N/A
lift-*.f64N/A
*-commutativeN/A
cbrt-prodN/A
distribute-rgt-neg-inN/A
times-fracN/A
distribute-neg-frac2N/A
cbrt-divN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cbrt.f64N/A
lower-neg.f64N/A
lower-cbrt.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval98.7
Applied rewrites98.7%
lift-*.f64N/A
*-commutativeN/A
lift-neg.f64N/A
neg-sub0N/A
flip3--N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites24.9%
if 1.97626e-322 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 91.4%
lift-/.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites50.6%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6445.0
Applied rewrites45.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
*-inversesN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Final simplification80.1%
(FPCore (g a) :precision binary64 (/ 1.0 (cbrt (/ a (* g 0.5)))))
double code(double g, double a) {
return 1.0 / cbrt((a / (g * 0.5)));
}
public static double code(double g, double a) {
return 1.0 / Math.cbrt((a / (g * 0.5)));
}
function code(g, a) return Float64(1.0 / cbrt(Float64(a / Float64(g * 0.5)))) end
code[g_, a_] := N[(1.0 / N[Power[N[(a / N[(g * 0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}
\end{array}
Initial program 76.5%
lift-cbrt.f64N/A
lift-/.f64N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
clear-numN/A
lift-*.f64N/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval76.8
Applied rewrites76.8%
(FPCore (g a) :precision binary64 (/ 1.0 (cbrt (* a (/ 2.0 g)))))
double code(double g, double a) {
return 1.0 / cbrt((a * (2.0 / g)));
}
public static double code(double g, double a) {
return 1.0 / Math.cbrt((a * (2.0 / g)));
}
function code(g, a) return Float64(1.0 / cbrt(Float64(a * Float64(2.0 / g)))) end
code[g_, a_] := N[(1.0 / N[Power[N[(a * N[(2.0 / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt[3]{a \cdot \frac{2}{g}}}
\end{array}
Initial program 76.5%
lift-/.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
Applied rewrites40.2%
lift-cbrt.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
cbrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6436.3
Applied rewrites36.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
metadata-evalN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
associate-*l/N/A
metadata-evalN/A
lower-/.f6476.8
Applied rewrites76.8%
Final simplification76.8%
(FPCore (g a) :precision binary64 (cbrt (/ g (* a 2.0))))
double code(double g, double a) {
return cbrt((g / (a * 2.0)));
}
public static double code(double g, double a) {
return Math.cbrt((g / (a * 2.0)));
}
function code(g, a) return cbrt(Float64(g / Float64(a * 2.0))) end
code[g_, a_] := N[Power[N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g}{a \cdot 2}}
\end{array}
Initial program 76.5%
Final simplification76.5%
(FPCore (g a) :precision binary64 (cbrt (* g (/ 0.5 a))))
double code(double g, double a) {
return cbrt((g * (0.5 / a)));
}
public static double code(double g, double a) {
return Math.cbrt((g * (0.5 / a)));
}
function code(g, a) return cbrt(Float64(g * Float64(0.5 / a))) end
code[g_, a_] := N[Power[N[(g * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{g \cdot \frac{0.5}{a}}
\end{array}
Initial program 76.5%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
metadata-eval76.5
Applied rewrites76.5%
Final simplification76.5%
herbie shell --seed 2024231
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))