Average Error: 15.6 → 0.9
Time: 3.5s
Precision: 64
\[\sqrt[3]{\frac{g}{2 \cdot a}}\]
\[\sqrt[3]{-g} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}\]
\sqrt[3]{\frac{g}{2 \cdot a}}
\sqrt[3]{-g} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}
double code(double g, double a) {
	return cbrt((g / (2.0 * a)));
}
double code(double g, double a) {
	return (cbrt(-g) * (1.0 / cbrt(-(2.0 * 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.6

    \[\sqrt[3]{\frac{g}{2 \cdot a}}\]
  2. Using strategy rm
  3. Applied frac-2neg15.6

    \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{-2 \cdot a}}}\]
  4. Applied cbrt-div0.9

    \[\leadsto \color{blue}{\frac{\sqrt[3]{-g}}{\sqrt[3]{-2 \cdot a}}}\]
  5. Using strategy rm
  6. Applied div-inv0.9

    \[\leadsto \color{blue}{\sqrt[3]{-g} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}}\]
  7. Final simplification0.9

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

Reproduce

herbie shell --seed 2020071 +o rules:numerics
(FPCore (g a)
  :name "2-ancestry mixing, zero discriminant"
  :precision binary64
  (cbrt (/ g (* 2 a))))