
(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 9 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)) (cbrt (/ -0.5 a))))
double code(double g, double a) {
return cbrt(-g) * cbrt((-0.5 / a));
}
public static double code(double g, double a) {
return Math.cbrt(-g) * Math.cbrt((-0.5 / a));
}
function code(g, a) return Float64(cbrt(Float64(-g)) * cbrt(Float64(-0.5 / a))) end
code[g_, a_] := N[(N[Power[(-g), 1/3], $MachinePrecision] * N[Power[N[(-0.5 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{-g} \cdot \sqrt[3]{\frac{-0.5}{a}}
\end{array}
Initial program 79.5%
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.7
Applied rewrites98.7%
Applied rewrites98.8%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0))) (t_1 (/ (cbrt (* a (* a (* g 0.5)))) a)))
(if (<= t_0 -1e+255)
t_1
(if (<= t_0 -2e-302)
(/ 1.0 (cbrt (/ a (* g 0.5))))
(if (<= t_0 0.0)
t_1
(if (<= t_0 2e+277)
(cbrt (* (/ g a) (* (sqrt 0.5) (sqrt 0.5))))
t_1))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -1e+255) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = 1.0 / cbrt((a / (g * 0.5)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = cbrt(((g / a) * (sqrt(0.5) * sqrt(0.5))));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = Math.cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -1e+255) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = 1.0 / Math.cbrt((a / (g * 0.5)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = Math.cbrt(((g / a) * (Math.sqrt(0.5) * Math.sqrt(0.5))));
} else {
tmp = t_1;
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) t_1 = Float64(cbrt(Float64(a * Float64(a * Float64(g * 0.5)))) / a) tmp = 0.0 if (t_0 <= -1e+255) tmp = t_1; elseif (t_0 <= -2e-302) tmp = Float64(1.0 / cbrt(Float64(a / Float64(g * 0.5)))); elseif (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+277) tmp = cbrt(Float64(Float64(g / a) * Float64(sqrt(0.5) * sqrt(0.5)))); else tmp = t_1; end return tmp end
code[g_, a_] := Block[{t$95$0 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(a * N[(a * N[(g * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+255], t$95$1, If[LessEqual[t$95$0, -2e-302], N[(1.0 / N[Power[N[(a / N[(g * 0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+277], N[Power[N[(N[(g / a), $MachinePrecision] * N[(N[Sqrt[0.5], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
t_1 := \frac{\sqrt[3]{a \cdot \left(a \cdot \left(g \cdot 0.5\right)\right)}}{a}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{\frac{g}{a} \cdot \left(\sqrt{0.5} \cdot \sqrt{0.5}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -9.99999999999999988e254 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 14.3%
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.6
Applied rewrites98.6%
Applied rewrites98.6%
Applied rewrites83.3%
if -9.99999999999999988e254 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999999e-302Initial program 99.0%
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-eval99.2
Applied rewrites99.2%
if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277Initial program 98.1%
associate-/l/N/A
clear-numN/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
metadata-evalN/A
lower-/.f6497.1
Applied rewrites97.1%
lift-/.f64N/A
clear-numN/A
inv-powN/A
sqr-powN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
Applied rewrites98.3%
Final simplification95.2%
(FPCore (g a) :precision binary64 (if (<= (* a 2.0) -4e-294) (* (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-294) {
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-294) {
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-294) 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-294], 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^{-294}:\\
\;\;\;\;{\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) < -4.00000000000000007e-294Initial program 78.2%
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%
Applied rewrites98.9%
frac-2negN/A
metadata-evalN/A
div-invN/A
cbrt-prodN/A
pow1/3N/A
lower-*.f64N/A
pow1/3N/A
lower-cbrt.f64N/A
distribute-frac-neg2N/A
inv-powN/A
metadata-evalN/A
pow-divN/A
pow2N/A
lift-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lift-*.f64N/A
distribute-frac-negN/A
lower-cbrt.f64N/A
distribute-frac-negN/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
cube-unmultN/A
pow-divN/A
Applied rewrites98.7%
lift-neg.f64N/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
lift-/.f64N/A
lift-cbrt.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-cbrt.f64N/A
pow1/3N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-neg.f64N/A
metadata-evalN/A
lift-cbrt.f64N/A
lift-cbrt.f64N/A
cbrt-unprodN/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
Applied rewrites92.3%
if -4.00000000000000007e-294 < (*.f64 #s(literal 2 binary64) a) Initial program 80.7%
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.4
Applied rewrites92.4%
Final simplification92.4%
(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 79.5%
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.7
Applied rewrites98.7%
(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 79.5%
lift-*.f64N/A
cbrt-divN/A
lower-/.f64N/A
lower-cbrt.f64N/A
lower-cbrt.f6498.7
Applied rewrites98.7%
Final simplification98.7%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0))) (t_1 (/ (cbrt (* a (* a (* g 0.5)))) a)))
(if (<= t_0 -1e+255)
t_1
(if (<= t_0 -2e-302)
(/ 1.0 (cbrt (/ a (* g 0.5))))
(if (<= t_0 0.0) t_1 (if (<= t_0 2e+277) (cbrt t_0) t_1))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -1e+255) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = 1.0 / cbrt((a / (g * 0.5)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = cbrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = Math.cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -1e+255) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = 1.0 / Math.cbrt((a / (g * 0.5)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = Math.cbrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) t_1 = Float64(cbrt(Float64(a * Float64(a * Float64(g * 0.5)))) / a) tmp = 0.0 if (t_0 <= -1e+255) tmp = t_1; elseif (t_0 <= -2e-302) tmp = Float64(1.0 / cbrt(Float64(a / Float64(g * 0.5)))); elseif (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+277) tmp = cbrt(t_0); else tmp = t_1; end return tmp end
code[g_, a_] := Block[{t$95$0 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(a * N[(a * N[(g * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+255], t$95$1, If[LessEqual[t$95$0, -2e-302], N[(1.0 / N[Power[N[(a / N[(g * 0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+277], N[Power[t$95$0, 1/3], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
t_1 := \frac{\sqrt[3]{a \cdot \left(a \cdot \left(g \cdot 0.5\right)\right)}}{a}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -9.99999999999999988e254 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 14.3%
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.6
Applied rewrites98.6%
Applied rewrites98.6%
Applied rewrites83.3%
if -9.99999999999999988e254 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999999e-302Initial program 99.0%
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-eval99.2
Applied rewrites99.2%
if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277Initial program 98.1%
Final simplification95.2%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0))) (t_1 (/ (cbrt (* a (* a (* g 0.5)))) a)))
(if (<= t_0 (- INFINITY))
t_1
(if (<= t_0 -2e-302)
(cbrt (/ 0.5 (/ a g)))
(if (<= t_0 0.0) t_1 (if (<= t_0 2e+277) (cbrt t_0) t_1))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = cbrt((0.5 / (a / g)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = cbrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = Math.cbrt((a * (a * (g * 0.5)))) / a;
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= -2e-302) {
tmp = Math.cbrt((0.5 / (a / g)));
} else if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+277) {
tmp = Math.cbrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) t_1 = Float64(cbrt(Float64(a * Float64(a * Float64(g * 0.5)))) / a) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= -2e-302) tmp = cbrt(Float64(0.5 / Float64(a / g))); elseif (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+277) tmp = cbrt(t_0); else tmp = t_1; end return tmp end
code[g_, a_] := Block[{t$95$0 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(a * N[(a * N[(g * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, -2e-302], N[Power[N[(0.5 / N[(a / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+277], N[Power[t$95$0, 1/3], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
t_1 := \frac{\sqrt[3]{a \cdot \left(a \cdot \left(g \cdot 0.5\right)\right)}}{a}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\sqrt[3]{\frac{0.5}{\frac{a}{g}}}\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -inf.0 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 8.1%
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.5
Applied rewrites98.5%
Applied rewrites98.5%
Applied rewrites82.1%
if -inf.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999999e-302Initial program 99.0%
associate-/l/N/A
clear-numN/A
associate-/l/N/A
associate-/r*N/A
lower-/.f64N/A
metadata-evalN/A
lower-/.f6499.1
Applied rewrites99.1%
if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277Initial program 98.1%
Final simplification95.1%
(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 79.5%
Final simplification79.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 79.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-eval79.5
Applied rewrites79.5%
Final simplification79.5%
herbie shell --seed 2024219
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))