2-ancestry mixing, zero discriminant

Percentage Accurate: 76.2% → 98.7%
Time: 5.0s
Alternatives: 6
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \sqrt[3]{\frac{g}{2 \cdot a}} \end{array} \]
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
double code(double g, double a) {
	return cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
	return Math.cbrt((g / (2.0 * a)));
}
function code(g, a)
	return cbrt(Float64(g / Float64(2.0 * a)))
end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 6 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 76.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt[3]{\frac{g}{2 \cdot a}} \end{array} \]
(FPCore (g a) :precision binary64 (cbrt (/ g (* 2.0 a))))
double code(double g, double a) {
	return cbrt((g / (2.0 * a)));
}
public static double code(double g, double a) {
	return Math.cbrt((g / (2.0 * a)));
}
function code(g, a)
	return cbrt(Float64(g / Float64(2.0 * a)))
end
code[g_, a_] := N[Power[N[(g / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}} \end{array} \]
(FPCore (g a) :precision binary64 (/ (cbrt g) (cbrt (* 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) / Math.cbrt((2.0 * a));
}
function code(g, a)
	return Float64(cbrt(g) / cbrt(Float64(2.0 * a)))
end
code[g_, a_] := N[(N[Power[g, 1/3], $MachinePrecision] / N[Power[N[(2.0 * a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}}
\end{array}
Derivation
  1. Initial program 75.1%

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{2 \cdot a}}} \]
    2. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{g}{2 \cdot a}}} \]
    3. frac-2negN/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    4. cbrt-divN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\color{blue}{-1 \cdot \left(2 \cdot a\right)}}} \]
    6. cbrt-prodN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{\sqrt[3]{-1} \cdot \sqrt[3]{2 \cdot a}}} \]
    7. pow1/3N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{{-1}^{\frac{1}{3}}} \cdot \sqrt[3]{2 \cdot a}} \]
    8. associate-/r*N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    9. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    10. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    11. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    12. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\left(\mathsf{neg}\left(g\right)\right) \cdot \left(\mathsf{neg}\left(g\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    13. sqr-negN/A

      \[\leadsto \frac{\frac{{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    14. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(\color{blue}{g} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    15. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(g \cdot \color{blue}{g}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    16. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {g}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    17. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    18. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    19. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{{-1}^{\frac{1}{3}}}}}{\sqrt[3]{2 \cdot a}} \]
    20. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    21. pow1/3N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    22. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    23. lower-cbrt.f641.6

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\color{blue}{\sqrt[3]{2 \cdot a}}} \]
    24. remove-double-divN/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{\color{blue}{\frac{1}{\frac{1}{2 \cdot a}}}}} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
    2. lift-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}}{\sqrt[3]{-2 \cdot a}} \]
    3. associate-/l/N/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-2 \cdot a} \cdot \sqrt[3]{-1}}} \]
    4. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-2 \cdot a} \cdot \sqrt[3]{-1}}} \]
    5. *-commutativeN/A

      \[\leadsto \frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1} \cdot \sqrt[3]{-2 \cdot a}}} \]
    6. lift-cbrt.f64N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}} \cdot \sqrt[3]{-2 \cdot a}} \]
    7. lift-cbrt.f64N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{-1} \cdot \color{blue}{\sqrt[3]{-2 \cdot a}}} \]
    8. cbrt-unprodN/A

      \[\leadsto \frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1 \cdot \left(-2 \cdot a\right)}}} \]
    9. neg-mul-1N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{\mathsf{neg}\left(-2 \cdot a\right)}}} \]
    10. lower-cbrt.f64N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{\mathsf{neg}\left(-2 \cdot a\right)}}} \]
    11. lift-*.f64N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\mathsf{neg}\left(\color{blue}{-2 \cdot a}\right)}} \]
    12. distribute-lft-neg-inN/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot a}}} \]
    13. metadata-evalN/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{2} \cdot a}} \]
    14. metadata-evalN/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{\frac{-1}{\frac{-1}{2}}} \cdot a}} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{\frac{-1}{\frac{-1}{2}} \cdot a}}} \]
    16. metadata-eval98.8

      \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{2} \cdot a}} \]
  6. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}}} \]
  7. Add Preprocessing

Alternative 2: 92.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-307}:\\ \;\;\;\;{\left(-a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{-0.5 \cdot g}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\ \end{array} \end{array} \]
(FPCore (g a)
 :precision binary64
 (if (<= (* 2.0 a) -2e-307)
   (* (pow (- a) -0.3333333333333333) (cbrt (* -0.5 g)))
   (* (pow (* 2.0 a) -0.3333333333333333) (cbrt g))))
double code(double g, double a) {
	double tmp;
	if ((2.0 * a) <= -2e-307) {
		tmp = pow(-a, -0.3333333333333333) * cbrt((-0.5 * g));
	} else {
		tmp = pow((2.0 * a), -0.3333333333333333) * cbrt(g);
	}
	return tmp;
}
public static double code(double g, double a) {
	double tmp;
	if ((2.0 * a) <= -2e-307) {
		tmp = Math.pow(-a, -0.3333333333333333) * Math.cbrt((-0.5 * g));
	} else {
		tmp = Math.pow((2.0 * a), -0.3333333333333333) * Math.cbrt(g);
	}
	return tmp;
}
function code(g, a)
	tmp = 0.0
	if (Float64(2.0 * a) <= -2e-307)
		tmp = Float64((Float64(-a) ^ -0.3333333333333333) * cbrt(Float64(-0.5 * g)));
	else
		tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * cbrt(g));
	end
	return tmp
end
code[g_, a_] := If[LessEqual[N[(2.0 * a), $MachinePrecision], -2e-307], N[(N[Power[(-a), -0.3333333333333333], $MachinePrecision] * N[Power[N[(-0.5 * g), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-307}:\\
\;\;\;\;{\left(-a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{-0.5 \cdot g}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) a) < -1.99999999999999982e-307

    1. Initial program 75.4%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
    3. Applied rewrites98.8%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{-1}{a}} \cdot \sqrt[3]{-0.5 \cdot g}} \]
    4. Step-by-step derivation
      1. lift-cbrt.f64N/A

        \[\leadsto \color{blue}{\sqrt[3]{\frac{-1}{a}}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      2. pow1/3N/A

        \[\leadsto \color{blue}{{\left(\frac{-1}{a}\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      3. lift-/.f64N/A

        \[\leadsto {\color{blue}{\left(\frac{-1}{a}\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      4. frac-2negN/A

        \[\leadsto {\color{blue}{\left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(a\right)}\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      5. metadata-evalN/A

        \[\leadsto {\left(\frac{\color{blue}{1}}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      6. inv-powN/A

        \[\leadsto {\color{blue}{\left({\left(\mathsf{neg}\left(a\right)\right)}^{-1}\right)}}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      7. pow-powN/A

        \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(a\right)\right)}^{\left(-1 \cdot \frac{1}{3}\right)}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      8. metadata-evalN/A

        \[\leadsto {\left(\mathsf{neg}\left(a\right)\right)}^{\color{blue}{\frac{-1}{3}}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      9. lower-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\mathsf{neg}\left(a\right)\right)}^{\frac{-1}{3}}} \cdot \sqrt[3]{\frac{-1}{2} \cdot g} \]
      10. lower-neg.f6491.8

        \[\leadsto {\color{blue}{\left(-a\right)}}^{-0.3333333333333333} \cdot \sqrt[3]{-0.5 \cdot g} \]
    5. Applied rewrites91.8%

      \[\leadsto \color{blue}{{\left(-a\right)}^{-0.3333333333333333}} \cdot \sqrt[3]{-0.5 \cdot g} \]

    if -1.99999999999999982e-307 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 74.7%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
    3. Applied rewrites98.8%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{-1}{a}} \cdot \sqrt[3]{-0.5 \cdot g}} \]
    4. Applied rewrites92.4%

      \[\leadsto \color{blue}{{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 83.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-307}:\\ \;\;\;\;\sqrt[3]{\frac{g}{\frac{-1}{\frac{-0.5}{a}}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\ \end{array} \end{array} \]
(FPCore (g a)
 :precision binary64
 (if (<= (* 2.0 a) -2e-307)
   (cbrt (/ g (/ -1.0 (/ -0.5 a))))
   (* (pow (* 2.0 a) -0.3333333333333333) (cbrt g))))
double code(double g, double a) {
	double tmp;
	if ((2.0 * a) <= -2e-307) {
		tmp = cbrt((g / (-1.0 / (-0.5 / a))));
	} else {
		tmp = pow((2.0 * a), -0.3333333333333333) * cbrt(g);
	}
	return tmp;
}
public static double code(double g, double a) {
	double tmp;
	if ((2.0 * a) <= -2e-307) {
		tmp = Math.cbrt((g / (-1.0 / (-0.5 / a))));
	} else {
		tmp = Math.pow((2.0 * a), -0.3333333333333333) * Math.cbrt(g);
	}
	return tmp;
}
function code(g, a)
	tmp = 0.0
	if (Float64(2.0 * a) <= -2e-307)
		tmp = cbrt(Float64(g / Float64(-1.0 / Float64(-0.5 / a))));
	else
		tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * cbrt(g));
	end
	return tmp
end
code[g_, a_] := If[LessEqual[N[(2.0 * a), $MachinePrecision], -2e-307], N[Power[N[(g / N[(-1.0 / N[(-0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;2 \cdot a \leq -2 \cdot 10^{-307}:\\
\;\;\;\;\sqrt[3]{\frac{g}{\frac{-1}{\frac{-0.5}{a}}}}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 2 binary64) a) < -1.99999999999999982e-307

    1. Initial program 75.4%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. remove-double-divN/A

        \[\leadsto \sqrt[3]{\frac{g}{\color{blue}{\frac{1}{\frac{1}{2 \cdot a}}}}} \]
      2. frac-2negN/A

        \[\leadsto \sqrt[3]{\frac{g}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\frac{1}{2 \cdot a}\right)}}}} \]
      3. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\frac{1}{2 \cdot a}\right)}}} \]
      4. distribute-frac-neg2N/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{\frac{1}{\mathsf{neg}\left(2 \cdot a\right)}}}}} \]
      5. inv-powN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{-1}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\color{blue}{\left(\frac{-1}{2} + \frac{-1}{2}\right)}}}}} \]
      7. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \frac{-1}{2}\right)}}}} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right) + \frac{-1}{2}\right)}}}} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}}}} \]
      10. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)\right)}}}} \]
      11. pow-prod-upN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}}} \]
      12. pow-prod-downN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{{\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right) \cdot \left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}}} \]
      13. sqr-negN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right)\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}} \]
      14. remove-double-negN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\color{blue}{\left(2 \cdot a\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}} \]
      15. remove-double-negN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(\left(2 \cdot a\right) \cdot \color{blue}{\left(2 \cdot a\right)}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}} \]
      16. pow-prod-downN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{{\left(2 \cdot a\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(2 \cdot a\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}}}} \]
      17. pow-sqrN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{{\left(2 \cdot a\right)}^{\left(2 \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}}} \]
      18. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(2 \cdot a\right)}^{\left(2 \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)\right)}}}} \]
      19. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(2 \cdot a\right)}^{\left(2 \cdot \color{blue}{\frac{-1}{2}}\right)}}}} \]
      20. metadata-evalN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{{\left(2 \cdot a\right)}^{\color{blue}{-1}}}}} \]
      21. inv-powN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{-1}{\color{blue}{\frac{1}{2 \cdot a}}}}} \]
    4. Applied rewrites75.5%

      \[\leadsto \sqrt[3]{\frac{g}{\color{blue}{\frac{-1}{\frac{-0.5}{a}}}}} \]

    if -1.99999999999999982e-307 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 74.7%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
    3. Applied rewrites98.8%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{-1}{a}} \cdot \sqrt[3]{-0.5 \cdot g}} \]
    4. Applied rewrites92.4%

      \[\leadsto \color{blue}{{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \sqrt[3]{g}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 76.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ {\left(\sqrt[3]{2 \cdot \frac{a}{g}}\right)}^{-1} \end{array} \]
(FPCore (g a) :precision binary64 (pow (cbrt (* 2.0 (/ a g))) -1.0))
double code(double g, double a) {
	return pow(cbrt((2.0 * (a / g))), -1.0);
}
public static double code(double g, double a) {
	return Math.pow(Math.cbrt((2.0 * (a / g))), -1.0);
}
function code(g, a)
	return cbrt(Float64(2.0 * Float64(a / g))) ^ -1.0
end
code[g_, a_] := N[Power[N[Power[N[(2.0 * N[(a / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], -1.0], $MachinePrecision]
\begin{array}{l}

\\
{\left(\sqrt[3]{2 \cdot \frac{a}{g}}\right)}^{-1}
\end{array}
Derivation
  1. Initial program 75.1%

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{2 \cdot a}}} \]
    2. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{g}{2 \cdot a}}} \]
    3. frac-2negN/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    4. cbrt-divN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\color{blue}{-1 \cdot \left(2 \cdot a\right)}}} \]
    6. cbrt-prodN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{\sqrt[3]{-1} \cdot \sqrt[3]{2 \cdot a}}} \]
    7. pow1/3N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{{-1}^{\frac{1}{3}}} \cdot \sqrt[3]{2 \cdot a}} \]
    8. associate-/r*N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    9. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    10. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    11. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    12. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\left(\mathsf{neg}\left(g\right)\right) \cdot \left(\mathsf{neg}\left(g\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    13. sqr-negN/A

      \[\leadsto \frac{\frac{{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    14. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(\color{blue}{g} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    15. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(g \cdot \color{blue}{g}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    16. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {g}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    17. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    18. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    19. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{{-1}^{\frac{1}{3}}}}}{\sqrt[3]{2 \cdot a}} \]
    20. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    21. pow1/3N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    22. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    23. lower-cbrt.f641.6

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\color{blue}{\sqrt[3]{2 \cdot a}}} \]
    24. remove-double-divN/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{\color{blue}{\frac{1}{\frac{1}{2 \cdot a}}}}} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
  5. Applied rewrites75.8%

    \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{2 \cdot \frac{a}{g}}}} \]
  6. Final simplification75.8%

    \[\leadsto {\left(\sqrt[3]{2 \cdot \frac{a}{g}}\right)}^{-1} \]
  7. Add Preprocessing

Alternative 5: 98.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g} \end{array} \]
(FPCore (g a) :precision binary64 (* (cbrt (/ 0.5 a)) (cbrt g)))
double code(double g, double a) {
	return cbrt((0.5 / a)) * cbrt(g);
}
public static double code(double g, double a) {
	return Math.cbrt((0.5 / a)) * Math.cbrt(g);
}
function code(g, a)
	return Float64(cbrt(Float64(0.5 / a)) * cbrt(g))
end
code[g_, a_] := N[(N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[g, 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g}
\end{array}
Derivation
  1. Initial program 75.1%

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{2 \cdot a}}} \]
    2. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{g}{2 \cdot a}}} \]
    3. frac-2negN/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    4. cbrt-divN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\color{blue}{-1 \cdot \left(2 \cdot a\right)}}} \]
    6. cbrt-prodN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{\sqrt[3]{-1} \cdot \sqrt[3]{2 \cdot a}}} \]
    7. pow1/3N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{{-1}^{\frac{1}{3}}} \cdot \sqrt[3]{2 \cdot a}} \]
    8. associate-/r*N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    9. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    10. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    11. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    12. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\left(\mathsf{neg}\left(g\right)\right) \cdot \left(\mathsf{neg}\left(g\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    13. sqr-negN/A

      \[\leadsto \frac{\frac{{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    14. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(\color{blue}{g} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    15. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(g \cdot \color{blue}{g}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    16. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {g}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    17. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    18. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    19. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{{-1}^{\frac{1}{3}}}}}{\sqrt[3]{2 \cdot a}} \]
    20. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    21. pow1/3N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    22. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    23. lower-cbrt.f641.6

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\color{blue}{\sqrt[3]{2 \cdot a}}} \]
    24. remove-double-divN/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{\color{blue}{\frac{1}{\frac{1}{2 \cdot a}}}}} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
    2. div-invN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}} \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{-2 \cdot a}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}}} \]
    4. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{\sqrt[3]{1}}}{\sqrt[3]{-2 \cdot a}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    5. metadata-evalN/A

      \[\leadsto \frac{\sqrt[3]{\color{blue}{\mathsf{neg}\left(-1\right)}}}{\sqrt[3]{-2 \cdot a}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    6. lift-cbrt.f64N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(-1\right)}}{\color{blue}{\sqrt[3]{-2 \cdot a}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(-1\right)}}{\sqrt[3]{\color{blue}{-2 \cdot a}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(-1\right)}}{\sqrt[3]{\color{blue}{a \cdot -2}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    9. metadata-evalN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(-1\right)}}{\sqrt[3]{a \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    10. div-invN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(-1\right)}}{\sqrt[3]{\color{blue}{\frac{a}{\frac{-1}{2}}}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    11. cbrt-divN/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\mathsf{neg}\left(-1\right)}{\frac{a}{\frac{-1}{2}}}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    12. metadata-evalN/A

      \[\leadsto \sqrt[3]{\frac{\color{blue}{1}}{\frac{a}{\frac{-1}{2}}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    13. clear-numN/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{-1}{2}}{a}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    14. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{-1}{2}}{a}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    15. pow1/3N/A

      \[\leadsto \color{blue}{{\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}}} \cdot \frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \]
    16. lift-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}} \]
    17. lift-cbrt.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot \frac{\color{blue}{\sqrt[3]{g}}}{\sqrt[3]{-1}} \]
    18. lift-cbrt.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot \frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}} \]
    19. cbrt-undivN/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot \color{blue}{\sqrt[3]{\frac{g}{-1}}} \]
    20. pow1/3N/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot \color{blue}{{\left(\frac{g}{-1}\right)}^{\frac{1}{3}}} \]
    21. clear-numN/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot {\color{blue}{\left(\frac{1}{\frac{-1}{g}}\right)}}^{\frac{1}{3}} \]
    22. lift-/.f64N/A

      \[\leadsto {\left(\frac{\frac{-1}{2}}{a}\right)}^{\frac{1}{3}} \cdot {\left(\frac{1}{\color{blue}{\frac{-1}{g}}}\right)}^{\frac{1}{3}} \]
    23. unpow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\frac{\frac{-1}{2}}{a} \cdot \frac{1}{\frac{-1}{g}}\right)}^{\frac{1}{3}}} \]
  6. Applied rewrites98.7%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g}} \]
  7. Add Preprocessing

Alternative 6: 76.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt[3]{\frac{0.5}{a} \cdot g} \end{array} \]
(FPCore (g a) :precision binary64 (cbrt (* (/ 0.5 a) g)))
double code(double g, double a) {
	return cbrt(((0.5 / a) * g));
}
public static double code(double g, double a) {
	return Math.cbrt(((0.5 / a) * g));
}
function code(g, a)
	return cbrt(Float64(Float64(0.5 / a) * g))
end
code[g_, a_] := N[Power[N[(N[(0.5 / a), $MachinePrecision] * g), $MachinePrecision], 1/3], $MachinePrecision]
\begin{array}{l}

\\
\sqrt[3]{\frac{0.5}{a} \cdot g}
\end{array}
Derivation
  1. Initial program 75.1%

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-cbrt.f64N/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{2 \cdot a}}} \]
    2. lift-/.f64N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{g}{2 \cdot a}}} \]
    3. frac-2negN/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    4. cbrt-divN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\mathsf{neg}\left(2 \cdot a\right)}}} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{\color{blue}{-1 \cdot \left(2 \cdot a\right)}}} \]
    6. cbrt-prodN/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{\sqrt[3]{-1} \cdot \sqrt[3]{2 \cdot a}}} \]
    7. pow1/3N/A

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\color{blue}{{-1}^{\frac{1}{3}}} \cdot \sqrt[3]{2 \cdot a}} \]
    8. associate-/r*N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    9. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}}} \]
    10. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    11. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {\left(\mathsf{neg}\left(g\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    12. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{\left(\left(\mathsf{neg}\left(g\right)\right) \cdot \left(\mathsf{neg}\left(g\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    13. sqr-negN/A

      \[\leadsto \frac{\frac{{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    14. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(\color{blue}{g} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(g\right)\right)\right)\right)\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    15. remove-double-negN/A

      \[\leadsto \frac{\frac{{\left(g \cdot \color{blue}{g}\right)}^{\left(\frac{\frac{1}{3}}{2}\right)}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    16. pow-prod-downN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\left(\frac{\frac{1}{3}}{2}\right)} \cdot {g}^{\left(\frac{\frac{1}{3}}{2}\right)}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    17. sqr-powN/A

      \[\leadsto \frac{\frac{\color{blue}{{g}^{\frac{1}{3}}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    18. pow1/3N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    19. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{{-1}^{\frac{1}{3}}}}}{\sqrt[3]{2 \cdot a}} \]
    20. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{{-1}^{\frac{1}{3}}}}{\sqrt[3]{2 \cdot a}} \]
    21. pow1/3N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    22. lower-cbrt.f64N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-1}}}}{\sqrt[3]{2 \cdot a}} \]
    23. lower-cbrt.f641.6

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\color{blue}{\sqrt[3]{2 \cdot a}}} \]
    24. remove-double-divN/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{\color{blue}{\frac{1}{\frac{1}{2 \cdot a}}}}} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}}{\sqrt[3]{-2 \cdot a}}} \]
    2. div-invN/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}} \]
    3. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-1}}} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}} \]
    4. associate-*l/N/A

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g} \cdot \frac{1}{\sqrt[3]{-2 \cdot a}}}{\sqrt[3]{-1}}} \]
    5. div-invN/A

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{-2 \cdot a}}}}{\sqrt[3]{-1}} \]
    6. lift-cbrt.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{g}}}{\sqrt[3]{-2 \cdot a}}}{\sqrt[3]{-1}} \]
    7. lift-cbrt.f64N/A

      \[\leadsto \frac{\frac{\sqrt[3]{g}}{\color{blue}{\sqrt[3]{-2 \cdot a}}}}{\sqrt[3]{-1}} \]
    8. cbrt-undivN/A

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\frac{g}{-2 \cdot a}}}}{\sqrt[3]{-1}} \]
    9. un-div-invN/A

      \[\leadsto \frac{\sqrt[3]{\color{blue}{g \cdot \frac{1}{-2 \cdot a}}}}{\sqrt[3]{-1}} \]
    10. lift-*.f64N/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \frac{1}{\color{blue}{-2 \cdot a}}}}{\sqrt[3]{-1}} \]
    11. *-commutativeN/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \frac{1}{\color{blue}{a \cdot -2}}}}{\sqrt[3]{-1}} \]
    12. metadata-evalN/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \frac{1}{a \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}}}{\sqrt[3]{-1}} \]
    13. div-invN/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \frac{1}{\color{blue}{\frac{a}{\frac{-1}{2}}}}}}{\sqrt[3]{-1}} \]
    14. clear-numN/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \color{blue}{\frac{\frac{-1}{2}}{a}}}}{\sqrt[3]{-1}} \]
    15. lift-/.f64N/A

      \[\leadsto \frac{\sqrt[3]{g \cdot \color{blue}{\frac{\frac{-1}{2}}{a}}}}{\sqrt[3]{-1}} \]
    16. *-commutativeN/A

      \[\leadsto \frac{\sqrt[3]{\color{blue}{\frac{\frac{-1}{2}}{a} \cdot g}}}{\sqrt[3]{-1}} \]
    17. lift-cbrt.f64N/A

      \[\leadsto \frac{\sqrt[3]{\frac{\frac{-1}{2}}{a} \cdot g}}{\color{blue}{\sqrt[3]{-1}}} \]
    18. cbrt-divN/A

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{\frac{-1}{2}}{a} \cdot g}{-1}}} \]
    19. associate-*l/N/A

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{\frac{-1}{2}}{a}}{-1} \cdot g}} \]
  6. Applied rewrites75.1%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{0.5}{a} \cdot g}} \]
  7. Add Preprocessing

Reproduce

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