
(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 11 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 (/ 1.0 (* (cbrt a) (cbrt (/ 2.0 g)))))
double code(double g, double a) {
return 1.0 / (cbrt(a) * cbrt((2.0 / g)));
}
public static double code(double g, double a) {
return 1.0 / (Math.cbrt(a) * Math.cbrt((2.0 / g)));
}
function code(g, a) return Float64(1.0 / Float64(cbrt(a) * cbrt(Float64(2.0 / g)))) end
code[g_, a_] := N[(1.0 / N[(N[Power[a, 1/3], $MachinePrecision] * N[Power[N[(2.0 / g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sqrt[3]{a} \cdot \sqrt[3]{\frac{2}{g}}}
\end{array}
Initial program 78.9%
cbrt-divN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
pow1/3N/A
pow-lowering-pow.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6444.4
Applied egg-rr44.4%
unpow1/3N/A
+-rgt-identityN/A
cbrt-lowering-cbrt.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6498.7
Applied egg-rr98.7%
Applied egg-rr44.5%
Applied egg-rr98.7%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0)))
(t_1 (/ (cbrt (/ (* a g) (/ 0.25 a))) (fma 2.0 a 0.0))))
(if (<= t_0 -2e+280)
t_1
(if (<= t_0 -4e-303)
(cbrt (/ g (/ 2.0 (/ 1.0 a))))
(if (<= t_0 5e-232)
t_1
(if (<= t_0 5e+280) (cbrt (/ 1.0 (/ 2.0 (/ g a)))) t_1))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = cbrt(((a * g) / (0.25 / a))) / fma(2.0, a, 0.0);
double tmp;
if (t_0 <= -2e+280) {
tmp = t_1;
} else if (t_0 <= -4e-303) {
tmp = cbrt((g / (2.0 / (1.0 / a))));
} else if (t_0 <= 5e-232) {
tmp = t_1;
} else if (t_0 <= 5e+280) {
tmp = cbrt((1.0 / (2.0 / (g / a))));
} else {
tmp = t_1;
}
return tmp;
}
function code(g, a) t_0 = Float64(g / Float64(a * 2.0)) t_1 = Float64(cbrt(Float64(Float64(a * g) / Float64(0.25 / a))) / fma(2.0, a, 0.0)) tmp = 0.0 if (t_0 <= -2e+280) tmp = t_1; elseif (t_0 <= -4e-303) tmp = cbrt(Float64(g / Float64(2.0 / Float64(1.0 / a)))); elseif (t_0 <= 5e-232) tmp = t_1; elseif (t_0 <= 5e+280) tmp = cbrt(Float64(1.0 / Float64(2.0 / Float64(g / a)))); 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[(N[(a * g), $MachinePrecision] / N[(0.25 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[(2.0 * a + 0.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+280], t$95$1, If[LessEqual[t$95$0, -4e-303], N[Power[N[(g / N[(2.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[t$95$0, 5e-232], t$95$1, If[LessEqual[t$95$0, 5e+280], N[Power[N[(1.0 / N[(2.0 / N[(g / a), $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]{\frac{a \cdot g}{\frac{0.25}{a}}}}{\mathsf{fma}\left(2, a, 0\right)}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;\sqrt[3]{\frac{g}{\frac{2}{\frac{1}{a}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+280}:\\
\;\;\;\;\sqrt[3]{\frac{1}{\frac{2}{\frac{g}{a}}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -2.0000000000000001e280 or -3.99999999999999972e-303 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999999e-232 or 5.0000000000000002e280 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 17.9%
clear-numN/A
associate-/r/N/A
cbrt-prodN/A
cbrt-divN/A
metadata-evalN/A
cbrt-prodN/A
associate-/r*N/A
pow1/3N/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6498.6
Applied egg-rr98.6%
Applied egg-rr38.6%
+-rgt-identityN/A
associate-*l*N/A
associate-*r*N/A
remove-double-divN/A
--rgt-identityN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--rgt-identityN/A
metadata-evalN/A
div-invN/A
clear-numN/A
/-lowering-/.f6473.4
Applied egg-rr73.4%
if -2.0000000000000001e280 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -3.99999999999999972e-303Initial program 99.1%
metadata-evalN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.2
Applied egg-rr99.2%
if 4.9999999999999999e-232 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 5.0000000000000002e280Initial program 99.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-eval99.3
Applied egg-rr99.3%
Applied egg-rr41.6%
associate-/l*N/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
*-lft-identityN/A
+-rgt-identityN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
cube-unmultN/A
metadata-evalN/A
metadata-evalN/A
unpow-prod-downN/A
*-commutativeN/A
+-rgt-identityN/A
metadata-evalN/A
clear-numN/A
div-invN/A
metadata-evalN/A
div-invN/A
Applied egg-rr99.5%
Final simplification92.9%
(FPCore (g a)
:precision binary64
(let* ((t_0 (/ g (* a 2.0)))
(t_1 (/ (cbrt (* a (* g (fma a 4.0 0.0)))) (fma 2.0 a 0.0))))
(if (<= t_0 -2e+280)
t_1
(if (<= t_0 -4e-303)
(cbrt (/ g (/ 2.0 (/ 1.0 a))))
(if (<= t_0 5e-232)
t_1
(if (<= t_0 5e+280) (cbrt (/ 1.0 (/ 2.0 (/ g a)))) t_1))))))
double code(double g, double a) {
double t_0 = g / (a * 2.0);
double t_1 = cbrt((a * (g * fma(a, 4.0, 0.0)))) / fma(2.0, a, 0.0);
double tmp;
if (t_0 <= -2e+280) {
tmp = t_1;
} else if (t_0 <= -4e-303) {
tmp = cbrt((g / (2.0 / (1.0 / a))));
} else if (t_0 <= 5e-232) {
tmp = t_1;
} else if (t_0 <= 5e+280) {
tmp = cbrt((1.0 / (2.0 / (g / a))));
} 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(g * fma(a, 4.0, 0.0)))) / fma(2.0, a, 0.0)) tmp = 0.0 if (t_0 <= -2e+280) tmp = t_1; elseif (t_0 <= -4e-303) tmp = cbrt(Float64(g / Float64(2.0 / Float64(1.0 / a)))); elseif (t_0 <= 5e-232) tmp = t_1; elseif (t_0 <= 5e+280) tmp = cbrt(Float64(1.0 / Float64(2.0 / Float64(g / a)))); 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[(g * N[(a * 4.0 + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[(2.0 * a + 0.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+280], t$95$1, If[LessEqual[t$95$0, -4e-303], N[Power[N[(g / N[(2.0 / N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[t$95$0, 5e-232], t$95$1, If[LessEqual[t$95$0, 5e+280], N[Power[N[(1.0 / N[(2.0 / N[(g / a), $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(g \cdot \mathsf{fma}\left(a, 4, 0\right)\right)}}{\mathsf{fma}\left(2, a, 0\right)}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;\sqrt[3]{\frac{g}{\frac{2}{\frac{1}{a}}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+280}:\\
\;\;\;\;\sqrt[3]{\frac{1}{\frac{2}{\frac{g}{a}}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -2.0000000000000001e280 or -3.99999999999999972e-303 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999999e-232 or 5.0000000000000002e280 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 17.9%
clear-numN/A
associate-/r/N/A
cbrt-prodN/A
cbrt-divN/A
metadata-evalN/A
cbrt-prodN/A
associate-/r*N/A
pow1/3N/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6498.6
Applied egg-rr98.6%
Applied egg-rr38.6%
+-rgt-identityN/A
metadata-evalN/A
div-invN/A
clear-numN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
div-invN/A
clear-numN/A
div-invN/A
metadata-evalN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6473.3
Applied egg-rr73.3%
if -2.0000000000000001e280 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -3.99999999999999972e-303Initial program 99.1%
metadata-evalN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.2
Applied egg-rr99.2%
if 4.9999999999999999e-232 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 5.0000000000000002e280Initial program 99.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-eval99.3
Applied egg-rr99.3%
Applied egg-rr41.6%
associate-/l*N/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
*-lft-identityN/A
+-rgt-identityN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
cube-unmultN/A
metadata-evalN/A
metadata-evalN/A
unpow-prod-downN/A
*-commutativeN/A
+-rgt-identityN/A
metadata-evalN/A
clear-numN/A
div-invN/A
metadata-evalN/A
div-invN/A
Applied egg-rr99.5%
Final simplification92.8%
(FPCore (g a) :precision binary64 (* (cbrt (* g 0.5)) (cbrt (/ 1.0 a))))
double code(double g, double a) {
return cbrt((g * 0.5)) * cbrt((1.0 / a));
}
public static double code(double g, double a) {
return Math.cbrt((g * 0.5)) * Math.cbrt((1.0 / a));
}
function code(g, a) return Float64(cbrt(Float64(g * 0.5)) * cbrt(Float64(1.0 / a))) end
code[g_, a_] := N[(N[Power[N[(g * 0.5), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(1.0 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{g \cdot 0.5} \cdot \sqrt[3]{\frac{1}{a}}
\end{array}
Initial program 78.9%
cbrt-divN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
pow1/3N/A
pow-lowering-pow.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6444.4
Applied egg-rr44.4%
unpow1/3N/A
+-rgt-identityN/A
cbrt-lowering-cbrt.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6498.7
Applied egg-rr98.7%
cbrt-undivN/A
+-rgt-identityN/A
associate-/r*N/A
cbrt-divN/A
div-invN/A
metadata-evalN/A
cbrt-divN/A
div-invN/A
cbrt-prodN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
metadata-eval98.7
Applied egg-rr98.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 78.9%
cbrt-divN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
pow1/3N/A
pow-lowering-pow.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6444.4
Applied egg-rr44.4%
unpow1/3N/A
+-rgt-identityN/A
cbrt-lowering-cbrt.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6498.7
Applied egg-rr98.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6498.7
Applied egg-rr98.7%
(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(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 78.9%
div-invN/A
cbrt-prodN/A
pow1/3N/A
*-commutativeN/A
*-lowering-*.f64N/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f6444.4
Applied egg-rr44.4%
+-rgt-identityN/A
metadata-evalN/A
pow-powN/A
inv-powN/A
metadata-evalN/A
associate-/r/N/A
clear-numN/A
pow1/3N/A
cbrt-lowering-cbrt.f64N/A
clear-numN/A
associate-/r/N/A
metadata-evalN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f6498.7
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (g a) :precision binary64 (if (<= (/ g (* a 2.0)) -2e+280) (/ (cbrt (* 4.0 (* g (* a a)))) (fma 2.0 a 0.0)) (cbrt (/ (* g 0.125) (* a 0.25)))))
double code(double g, double a) {
double tmp;
if ((g / (a * 2.0)) <= -2e+280) {
tmp = cbrt((4.0 * (g * (a * a)))) / fma(2.0, a, 0.0);
} else {
tmp = cbrt(((g * 0.125) / (a * 0.25)));
}
return tmp;
}
function code(g, a) tmp = 0.0 if (Float64(g / Float64(a * 2.0)) <= -2e+280) tmp = Float64(cbrt(Float64(4.0 * Float64(g * Float64(a * a)))) / fma(2.0, a, 0.0)); else tmp = cbrt(Float64(Float64(g * 0.125) / Float64(a * 0.25))); end return tmp end
code[g_, a_] := If[LessEqual[N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -2e+280], N[(N[Power[N[(4.0 * N[(g * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / N[(2.0 * a + 0.0), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(g * 0.125), $MachinePrecision] / N[(a * 0.25), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{g}{a \cdot 2} \leq -2 \cdot 10^{+280}:\\
\;\;\;\;\frac{\sqrt[3]{4 \cdot \left(g \cdot \left(a \cdot a\right)\right)}}{\mathsf{fma}\left(2, a, 0\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{g \cdot 0.125}{a \cdot 0.25}}\\
\end{array}
\end{array}
if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -2.0000000000000001e280Initial program 9.6%
clear-numN/A
associate-/r/N/A
cbrt-prodN/A
cbrt-divN/A
metadata-evalN/A
cbrt-prodN/A
associate-/r*N/A
pow1/3N/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
cbrt-lowering-cbrt.f6498.2
Applied egg-rr98.2%
Applied egg-rr45.1%
+-rgt-identityN/A
associate-*r*N/A
/-rgt-identityN/A
metadata-evalN/A
clear-numN/A
metadata-evalN/A
div-invN/A
*-lowering-*.f64N/A
div-invN/A
metadata-evalN/A
clear-numN/A
metadata-evalN/A
/-rgt-identityN/A
*-lowering-*.f64N/A
*-lowering-*.f6445.1
Applied egg-rr45.1%
if -2.0000000000000001e280 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) Initial program 84.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-eval84.1
Applied egg-rr84.1%
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
associate-/r*N/A
associate-*l/N/A
unpow1N/A
metadata-evalN/A
pow-divN/A
pow3N/A
pow2N/A
metadata-evalN/A
times-fracN/A
*-commutativeN/A
+-rgt-identityN/A
clear-numN/A
+-rgt-identityN/A
associate-/l*N/A
associate-/r*N/A
Applied egg-rr84.2%
Final simplification81.4%
(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 78.9%
cbrt-divN/A
/-lowering-/.f64N/A
cbrt-lowering-cbrt.f64N/A
pow1/3N/A
pow-lowering-pow.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6444.4
Applied egg-rr44.4%
unpow1/3N/A
+-rgt-identityN/A
cbrt-lowering-cbrt.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6498.7
Applied egg-rr98.7%
Applied egg-rr44.5%
Applied egg-rr79.6%
(FPCore (g a) :precision binary64 (cbrt (/ (* g 0.125) (* a 0.25))))
double code(double g, double a) {
return cbrt(((g * 0.125) / (a * 0.25)));
}
public static double code(double g, double a) {
return Math.cbrt(((g * 0.125) / (a * 0.25)));
}
function code(g, a) return cbrt(Float64(Float64(g * 0.125) / Float64(a * 0.25))) end
code[g_, a_] := N[Power[N[(N[(g * 0.125), $MachinePrecision] / N[(a * 0.25), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}
\\
\sqrt[3]{\frac{g \cdot 0.125}{a \cdot 0.25}}
\end{array}
Initial program 78.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-eval78.9
Applied egg-rr78.9%
associate-*l/N/A
metadata-evalN/A
associate-/r/N/A
associate-/r*N/A
associate-*l/N/A
unpow1N/A
metadata-evalN/A
pow-divN/A
pow3N/A
pow2N/A
metadata-evalN/A
times-fracN/A
*-commutativeN/A
+-rgt-identityN/A
clear-numN/A
+-rgt-identityN/A
associate-/l*N/A
associate-/r*N/A
Applied egg-rr78.9%
(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 78.9%
Final simplification78.9%
(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 78.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-eval78.9
Applied egg-rr78.9%
Final simplification78.9%
herbie shell --seed 2024199
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))