Average Error: 15.1 → 0.8
Time: 1.7s
Precision: binary64
\[\sqrt[3]{\frac{g}{2 \cdot a}} \]
\[\frac{-\sqrt[3]{g}}{-\sqrt[3]{2 \cdot a}} \]
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
(FPCore (g a) :precision binary64 (/ (- (cbrt g)) (- (cbrt (* 2.0 a)))))
double code(double g, double a) {
	return cbrt((g / (2.0 * a)));
}
double code(double g, double a) {
	return -cbrt(g) / -cbrt((2.0 * a));
}
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((2.0 * a));
}
function code(g, a)
	return cbrt(Float64(g / Float64(2.0 * a)))
end
function code(g, a)
	return Float64(Float64(-cbrt(g)) / Float64(-cbrt(Float64(2.0 * a))))
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[(2.0 * a), $MachinePrecision], 1/3], $MachinePrecision])), $MachinePrecision]
\sqrt[3]{\frac{g}{2 \cdot a}}
\frac{-\sqrt[3]{g}}{-\sqrt[3]{2 \cdot a}}

Error

Bits error versus g

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.1

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

    \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}}} \]
  3. Applied egg-rr0.8

    \[\leadsto \color{blue}{-\frac{\sqrt[3]{g}}{-\sqrt[3]{2 \cdot a}}} \]
  4. Final simplification0.8

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

Reproduce

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