2-ancestry mixing, zero discriminant

Percentage Accurate: 77.3% → 98.7%
Time: 7.1s
Alternatives: 9
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 9 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: 77.3% 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} \\ \sqrt[3]{\frac{-1}{a}} \cdot \sqrt[3]{g \cdot -0.5} \end{array} \]
(FPCore (g a) :precision binary64 (* (cbrt (/ -1.0 a)) (cbrt (* g -0.5))))
double code(double g, double a) {
	return cbrt((-1.0 / a)) * cbrt((g * -0.5));
}
public static double code(double g, double a) {
	return Math.cbrt((-1.0 / a)) * Math.cbrt((g * -0.5));
}
function code(g, a)
	return Float64(cbrt(Float64(-1.0 / a)) * cbrt(Float64(g * -0.5)))
end
code[g_, a_] := N[(N[Power[N[(-1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(g * -0.5), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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. inv-powN/A

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

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

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(2 \cdot a\right)}^{\left(2 \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}}}} \]
    5. 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)}}}} \]
    6. pow-powN/A

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

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

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

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right) \cdot \color{blue}{\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)}}}} \]
    10. sqr-negN/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)}}}} \]
    11. pow-prod-downN/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-upN/A

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{\color{blue}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}}} \]
    13. 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) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}} \]
    14. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{a \cdot \left(a \cdot \color{blue}{\frac{\mathsf{neg}\left(2\right)}{a}}\right)}} \]
    22. metadata-eval98.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt[3]{\frac{-1}{a}} \cdot \sqrt[3]{\frac{g}{\color{blue}{-2 \cdot \left(\frac{1}{a} \cdot a\right)}}} \]
    18. lft-mult-inverseN/A

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

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

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

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

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

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

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

Alternative 2: 91.9% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\


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

    1. Initial program 76.0%

      \[\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. inv-powN/A

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

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

        \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(2 \cdot a\right)}^{\left(2 \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}}}} \]
      5. 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)}}}} \]
      6. pow-powN/A

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

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

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

        \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right) \cdot \color{blue}{\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)}}}} \]
      10. sqr-negN/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)}}}} \]
      11. pow-prod-downN/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-upN/A

        \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{\color{blue}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}}} \]
      13. 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) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}} \]
      14. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{a \cdot \left(a \cdot \color{blue}{\frac{\mathsf{neg}\left(2\right)}{a}}\right)}} \]
      22. metadata-eval98.7

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{a \cdot \left(a \cdot \frac{-2}{a}\right)}} \cdot \sqrt[3]{\mathsf{neg}\left(g\right)}} \]
      5. lower-*.f6498.6

        \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{a \cdot \left(a \cdot \frac{-2}{a}\right)}} \cdot \sqrt[3]{-g}} \]
    8. Applied rewrites92.0%

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

    if -4.00000000000000011e-306 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 68.8%

      \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {a}^{\frac{-1}{3}} \cdot \sqrt[3]{\color{blue}{g \cdot \frac{1}{2}}} \]
      17. metadata-eval92.4

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

      \[\leadsto \color{blue}{{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;{\left(a \cdot -2\right)}^{-0.3333333333333333} \cdot \sqrt[3]{-g}\\ \mathbf{else}:\\ \;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.0% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\


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

    1. Initial program 76.0%

      \[\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. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt[3]{g}}{\sqrt[3]{\color{blue}{\frac{2}{\frac{1}{a}}}}} \]
      8. lower-/.f6498.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{g \cdot \color{blue}{\frac{-1}{2}}} \cdot {\left(\mathsf{neg}\left(\frac{1}{a}\right)\right)}^{\frac{1}{3}} \]
    8. Applied rewrites91.9%

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

    if -4.00000000000000011e-306 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 68.8%

      \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {a}^{\frac{-1}{3}} \cdot \sqrt[3]{\color{blue}{g \cdot \frac{1}{2}}} \]
      17. metadata-eval92.4

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

      \[\leadsto \color{blue}{{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;\sqrt[3]{g \cdot -0.5} \cdot {\left(-a\right)}^{-0.3333333333333333}\\ \mathbf{else}:\\ \;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.5% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{\color{blue}{0.5}}{a} \cdot g} \]
    4. Applied rewrites76.0%

      \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5}{a} \cdot g}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\left(\left(\sqrt{\frac{1}{2}} \cdot \color{blue}{\sqrt{\frac{1}{2}}}\right) \cdot \frac{1}{a}\right) \cdot g} \]
      25. lower-/.f6476.0

        \[\leadsto \sqrt[3]{\left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \color{blue}{\frac{1}{a}}\right) \cdot g} \]
    6. Applied rewrites76.0%

      \[\leadsto \sqrt[3]{\color{blue}{\left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \frac{1}{a}\right)} \cdot g} \]

    if -4.00000000000000011e-306 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 68.8%

      \[\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {a}^{\frac{-1}{3}} \cdot \sqrt[3]{\color{blue}{g \cdot \frac{1}{2}}} \]
      17. metadata-eval92.4

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

      \[\leadsto \color{blue}{{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot 2 \leq -4 \cdot 10^{-306}:\\ \;\;\;\;\sqrt[3]{g \cdot \left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \frac{1}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;{a}^{-0.3333333333333333} \cdot \sqrt[3]{g \cdot 0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.7% accurate, 0.5× speedup?

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

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

    \[\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. cbrt-divN/A

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt[3]{g}}{\sqrt[3]{2 \cdot a}}} \]
  5. Final simplification98.7%

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

Alternative 6: 98.7% accurate, 0.5× speedup?

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

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

    \[\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. inv-powN/A

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

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

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(2 \cdot a\right)}^{\left(2 \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}}}} \]
    5. 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)}}}} \]
    6. pow-powN/A

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

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

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

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(2 \cdot a\right)\right)\right)\right) \cdot \color{blue}{\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)}}}} \]
    10. sqr-negN/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)}}}} \]
    11. pow-prod-downN/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-upN/A

      \[\leadsto \sqrt[3]{\frac{g}{\frac{1}{\color{blue}{{\left(\mathsf{neg}\left(2 \cdot a\right)\right)}^{\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}}} \]
    13. 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) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}}}} \]
    14. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt[3]{\mathsf{neg}\left(g\right)}}{\sqrt[3]{a \cdot \left(a \cdot \color{blue}{\frac{\mathsf{neg}\left(2\right)}{a}}\right)}} \]
    22. metadata-eval98.7

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

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

    \[\leadsto \color{blue}{\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{g}} \]
  8. Final simplification98.7%

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

Alternative 7: 77.2% accurate, 0.8× speedup?

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

\\
\sqrt[3]{g \cdot \left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \frac{1}{a}\right)}
\end{array}
Derivation
  1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5}{a} \cdot g}} \]
  5. Step-by-step derivation
    1. rem-square-sqrtN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt[3]{\left(\left(\sqrt{\frac{1}{2}} \cdot \color{blue}{\sqrt{\frac{1}{2}}}\right) \cdot \frac{1}{a}\right) \cdot g} \]
    25. lower-/.f6472.3

      \[\leadsto \sqrt[3]{\left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \color{blue}{\frac{1}{a}}\right) \cdot g} \]
  6. Applied rewrites72.3%

    \[\leadsto \sqrt[3]{\color{blue}{\left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \frac{1}{a}\right)} \cdot g} \]
  7. Final simplification72.3%

    \[\leadsto \sqrt[3]{g \cdot \left(\left(\sqrt{0.5} \cdot \sqrt{0.5}\right) \cdot \frac{1}{a}\right)} \]
  8. Add Preprocessing

Alternative 8: 77.3% accurate, 1.0× speedup?

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

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

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Final simplification72.3%

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

Alternative 9: 77.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5}{a} \cdot g}} \]
  5. Final simplification72.3%

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

Reproduce

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