| Alternative 1 | |
|---|---|
| Error | 0.8 |
| Cost | 13120 |
\[\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g}
\]
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
(FPCore (g a) :precision binary64 (if (!= (cbrt g) 0.0) (/ (cbrt (/ 0.5 a)) (cbrt (/ 1.0 g))) (cbrt (/ (* g 0.5) a))))
double code(double g, double a) {
return cbrt((g / (2.0 * a)));
}
double code(double g, double a) {
double tmp;
if (cbrt(g) != 0.0) {
tmp = cbrt((0.5 / a)) / cbrt((1.0 / g));
} else {
tmp = cbrt(((g * 0.5) / a));
}
return tmp;
}
public static double code(double g, double a) {
return Math.cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
double tmp;
if (Math.cbrt(g) != 0.0) {
tmp = Math.cbrt((0.5 / a)) / Math.cbrt((1.0 / g));
} else {
tmp = Math.cbrt(((g * 0.5) / a));
}
return tmp;
}
function code(g, a) return cbrt(Float64(g / Float64(2.0 * a))) end
function code(g, a) tmp = 0.0 if (cbrt(g) != 0.0) tmp = Float64(cbrt(Float64(0.5 / a)) / cbrt(Float64(1.0 / g))); else tmp = cbrt(Float64(Float64(g * 0.5) / a)); end return tmp end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
code[g_, a_] := If[Unequal[N[Power[g, 1/3], $MachinePrecision], 0.0], N[(N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(1.0 / g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(g * 0.5), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision]]
\sqrt[3]{\frac{g}{2 \cdot a}}
\begin{array}{l}
\mathbf{if}\;\sqrt[3]{g} \ne 0:\\
\;\;\;\;\frac{\sqrt[3]{\frac{0.5}{a}}}{\sqrt[3]{\frac{1}{g}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{g \cdot 0.5}{a}}\\
\end{array}
Initial program 15.3
Applied egg-rr15.8
Applied egg-rr0.9
Simplified15.3
Applied egg-rr0.8
| Alternative 1 | |
|---|---|
| Error | 0.8 |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Error | 0.8 |
| Cost | 13120 |
| Alternative 3 | |
|---|---|
| Error | 15.3 |
| Cost | 6720 |
| Alternative 4 | |
|---|---|
| Error | 15.3 |
| Cost | 6720 |
herbie shell --seed 2023010
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))