2-ancestry mixing, zero discriminant

Percentage Accurate: 75.9% → 98.6%
Time: 7.5s
Alternatives: 10
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 10 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: 75.9% 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.6% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.6% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 91.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 72.7%

      \[\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. pow1/3N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\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)}} \cdot {\left(\frac{1}{2}\right)}^{\frac{1}{3}}\right) \cdot {\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}} \]
      14. sqr-negN/A

        \[\leadsto \left({\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)} \cdot {\left(\frac{1}{2}\right)}^{\frac{1}{3}}\right) \cdot {\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}} \]
      15. remove-double-negN/A

        \[\leadsto \left({\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)} \cdot {\left(\frac{1}{2}\right)}^{\frac{1}{3}}\right) \cdot {\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}} \]
      16. remove-double-negN/A

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

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

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

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

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

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

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

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

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

    if -4.99999999999999985e-305 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.9% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 72.7%

      \[\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. frac-2negN/A

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

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

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

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

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

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      8. metadata-evalN/A

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      10. metadata-evalN/A

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      11. pow-prod-upN/A

        \[\leadsto \sqrt[3]{\color{blue}{\left({\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)}\right)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      12. pow-prod-downN/A

        \[\leadsto \sqrt[3]{\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)}} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      13. sqr-negN/A

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      14. remove-double-negN/A

        \[\leadsto \sqrt[3]{{\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)} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
      15. remove-double-negN/A

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{2 \cdot a}} \cdot \left(\mathsf{neg}\left(g\right)\right)} \]
    4. Applied rewrites72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999985e-305 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;2 \cdot a \leq -5 \cdot 10^{-305}:\\ \;\;\;\;\sqrt[3]{\frac{\left(-g\right) \cdot \sqrt{\frac{-0.5}{a}}}{\sqrt{-2 \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{0.5 \cdot g} \cdot {a}^{-0.3333333333333333}\\ \end{array} \]
  5. 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 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.8% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.9% 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}
Derivation
  1. Initial program 77.6%

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

Alternative 10: 75.9% 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 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{a}}{\frac{2}{g}}}} \]
    20. lift-cbrt.f6477.6

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

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

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

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

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

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

Reproduce

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