| Alternative 1 | |
|---|---|
| Error | 0.9 |
| 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 (* (* (cbrt (/ 1.0 a)) (cbrt g)) (cbrt 0.5)))
double code(double g, double a) {
return cbrt((g / (2.0 * a)));
}
double code(double g, double a) {
return (cbrt((1.0 / a)) * cbrt(g)) * cbrt(0.5);
}
public static double code(double g, double a) {
return Math.cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
return (Math.cbrt((1.0 / a)) * Math.cbrt(g)) * Math.cbrt(0.5);
}
function code(g, a) return cbrt(Float64(g / Float64(2.0 * a))) end
function code(g, a) return Float64(Float64(cbrt(Float64(1.0 / a)) * cbrt(g)) * cbrt(0.5)) end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
code[g_, a_] := N[(N[(N[Power[N[(1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[0.5, 1/3], $MachinePrecision]), $MachinePrecision]
\sqrt[3]{\frac{g}{2 \cdot a}}
\left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{g}\right) \cdot \sqrt[3]{0.5}
Results
Initial program 15.5
Simplified15.5
[Start]15.5 | \[ \sqrt[3]{\frac{g}{2 \cdot a}}
\] |
|---|---|
rational_best-simplify-54 [=>]15.5 | \[ \sqrt[3]{\color{blue}{\frac{\frac{g}{2}}{a}}}
\] |
Applied egg-rr15.5
Applied egg-rr0.9
Final simplification0.9
| Alternative 1 | |
|---|---|
| Error | 0.9 |
| Cost | 13120 |
| Alternative 2 | |
|---|---|
| Error | 15.5 |
| Cost | 6720 |
herbie shell --seed 2023099
(FPCore (g a)
:name "2-ancestry mixing, zero discriminant"
:precision binary64
(cbrt (/ g (* 2.0 a))))