Average Error: 14.8 → 0.9
Time: 4.6s
Precision: binary64
Cost: 13120
\[\sqrt[3]{\frac{g}{2 \cdot a}} \]
\[\frac{\sqrt[3]{g}}{\sqrt[3]{a \cdot 2}} \]
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
(FPCore (g a) :precision binary64 (/ (cbrt g) (cbrt (* a 2.0))))
double code(double g, double a) {
	return cbrt((g / (2.0 * a)));
}
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 / (2.0 * a)));
}
public static double code(double g, double a) {
	return Math.cbrt(g) / Math.cbrt((a * 2.0));
}
function code(g, a)
	return cbrt(Float64(g / Float64(2.0 * a)))
end
function code(g, a)
	return Float64(cbrt(g) / cbrt(Float64(a * 2.0)))
end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
code[g_, a_] := N[(N[Power[g, 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\sqrt[3]{\frac{g}{2 \cdot a}}
\frac{\sqrt[3]{g}}{\sqrt[3]{a \cdot 2}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.8

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Applied egg-rr0.9

    \[\leadsto \color{blue}{\sqrt[3]{g} \cdot \frac{1}{\sqrt[3]{2 \cdot a}}} \]
  3. Simplified0.9

    \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{a \cdot 2}}} \]
    Proof
    (/.f64 (cbrt.f64 g) (cbrt.f64 (*.f64 a 2))): 0 points increase in error, 0 points decrease in error
    (/.f64 (cbrt.f64 g) (cbrt.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 a)))): 0 points increase in error, 0 points decrease in error
    (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (cbrt.f64 g) 1)) (cbrt.f64 (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-*r/_binary64 (*.f64 (cbrt.f64 g) (/.f64 1 (cbrt.f64 (*.f64 2 a))))): 40 points increase in error, 26 points decrease in error
  4. Final simplification0.9

    \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{a \cdot 2}} \]

Alternatives

Alternative 1
Error0.8
Cost13120
\[\sqrt[3]{g} \cdot \sqrt[3]{\frac{0.5}{a}} \]
Alternative 2
Error14.9
Cost6848
\[\frac{1}{\sqrt[3]{\frac{a}{\frac{g}{2}}}} \]
Alternative 3
Error14.8
Cost6720
\[\sqrt[3]{g \cdot \frac{0.5}{a}} \]

Error

Reproduce

herbie shell --seed 2022331 
(FPCore (g a)
  :name "2-ancestry mixing, zero discriminant"
  :precision binary64
  (cbrt (/ g (* 2.0 a))))