2-ancestry mixing, zero discriminant

Percentage Accurate: 76.1% → 98.7%
Time: 9.2s
Alternatives: 7
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 7 alternatives:

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

Initial Program: 76.1% 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.3× speedup?

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

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

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
    4. /-lowering-/.f6474.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
  3. Simplified74.5%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
  6. Applied egg-rr98.8%

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

Alternative 2: 98.7% accurate, 0.5× speedup?

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

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

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
    4. /-lowering-/.f6474.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
  3. Simplified74.5%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
  6. Applied egg-rr98.8%

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt[3]{\frac{-2}{g}}}\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\sqrt[3]{\frac{-2}{g}}\right)\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    3. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-2}{g}\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{a}\right)\right)\right) \]
    4. /-lowering-/.f6498.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-2, g\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, a\right)\right)\right) \]
  8. Applied egg-rr98.8%

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

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

Alternative 3: 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 74.5%

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
    4. /-lowering-/.f6474.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
  3. Simplified74.5%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
  6. Applied egg-rr98.8%

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt[3]{\frac{-2}{g}}}\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\sqrt[3]{\frac{-2}{g}}\right)\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    3. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-2}{g}\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{a}\right)\right)\right) \]
    4. /-lowering-/.f6498.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-2, g\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, a\right)\right)\right) \]
  8. Applied egg-rr98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt[3]{g}\right), \color{blue}{\left(\sqrt[3]{2} \cdot \sqrt[3]{a}\right)}\right) \]
    18. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \left(\color{blue}{\sqrt[3]{2}} \cdot \sqrt[3]{a}\right)\right) \]
    19. cbrt-unprodN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \left(\sqrt[3]{2 \cdot a}\right)\right) \]
    20. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\left(2 \cdot a\right)\right)\right) \]
    21. *-lowering-*.f6498.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(2, a\right)\right)\right) \]
  10. Applied egg-rr98.8%

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

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

Alternative 4: 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 74.5%

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
    4. /-lowering-/.f6474.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
  3. Simplified74.5%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
  6. Applied egg-rr98.8%

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt[3]{\frac{-2}{g}}}\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\sqrt[3]{\frac{-2}{g}}\right)\right), \mathsf{cbrt.f64}\left(\color{blue}{\mathsf{/.f64}\left(-1, a\right)}\right)\right) \]
    3. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-2}{g}\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, \color{blue}{a}\right)\right)\right) \]
    4. /-lowering-/.f6498.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-2, g\right)\right)\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(-1, a\right)\right)\right) \]
  8. Applied egg-rr98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt[3]{g}\right), \color{blue}{\left(\sqrt[3]{2} \cdot \sqrt[3]{a}\right)}\right) \]
    18. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \left(\color{blue}{\sqrt[3]{2}} \cdot \sqrt[3]{a}\right)\right) \]
    19. cbrt-unprodN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \left(\sqrt[3]{2 \cdot a}\right)\right) \]
    20. cbrt-lowering-cbrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\left(2 \cdot a\right)\right)\right) \]
    21. *-lowering-*.f6498.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(2, a\right)\right)\right) \]
  10. Applied egg-rr98.8%

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt[3]{g}\right), \color{blue}{\left(\sqrt[3]{\frac{1}{2 \cdot a}}\right)}\right) \]
    5. cbrt-lowering-cbrt.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\left(\frac{1}{2 \cdot a}\right)\right)\right) \]
    7. associate-/r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\left(\frac{\frac{1}{2}}{a}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2}\right), a\right)\right)\right) \]
    9. metadata-eval98.7%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{cbrt.f64}\left(g\right), \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right)\right)\right) \]
  12. Applied egg-rr98.7%

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

Alternative 5: 90.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{g \cdot \frac{0.5}{a}}\\ t_1 := \frac{g}{a \cdot 2}\\ t_2 := \frac{\sqrt[3]{\frac{a \cdot \left(g \cdot a\right)}{2}}}{a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-309}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-320}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+293}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (g a)
 :precision binary64
 (let* ((t_0 (cbrt (* g (/ 0.5 a))))
        (t_1 (/ g (* a 2.0)))
        (t_2 (/ (cbrt (/ (* a (* g a)) 2.0)) a)))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -2e-309)
       t_0
       (if (<= t_1 2e-320) t_2 (if (<= t_1 5e+293) t_0 t_2))))))
double code(double g, double a) {
	double t_0 = cbrt((g * (0.5 / a)));
	double t_1 = g / (a * 2.0);
	double t_2 = cbrt(((a * (g * a)) / 2.0)) / a;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -2e-309) {
		tmp = t_0;
	} else if (t_1 <= 2e-320) {
		tmp = t_2;
	} else if (t_1 <= 5e+293) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double g, double a) {
	double t_0 = Math.cbrt((g * (0.5 / a)));
	double t_1 = g / (a * 2.0);
	double t_2 = Math.cbrt(((a * (g * a)) / 2.0)) / a;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= -2e-309) {
		tmp = t_0;
	} else if (t_1 <= 2e-320) {
		tmp = t_2;
	} else if (t_1 <= 5e+293) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(g, a)
	t_0 = cbrt(Float64(g * Float64(0.5 / a)))
	t_1 = Float64(g / Float64(a * 2.0))
	t_2 = Float64(cbrt(Float64(Float64(a * Float64(g * a)) / 2.0)) / a)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -2e-309)
		tmp = t_0;
	elseif (t_1 <= 2e-320)
		tmp = t_2;
	elseif (t_1 <= 5e+293)
		tmp = t_0;
	else
		tmp = t_2;
	end
	return tmp
end
code[g_, a_] := Block[{t$95$0 = N[Power[N[(g * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[(N[(a * N[(g * a), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-309], t$95$0, If[LessEqual[t$95$1, 2e-320], t$95$2, If[LessEqual[t$95$1, 5e+293], t$95$0, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt[3]{g \cdot \frac{0.5}{a}}\\
t_1 := \frac{g}{a \cdot 2}\\
t_2 := \frac{\sqrt[3]{\frac{a \cdot \left(g \cdot a\right)}{2}}}{a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -inf.0 or -1.9999999999999988e-309 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 1.99998e-320 or 5.00000000000000033e293 < (/.f64 g (*.f64 #s(literal 2 binary64) a))

    1. Initial program 5.0%

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

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
      4. /-lowering-/.f645.0%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
    3. Simplified5.0%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
    6. Applied egg-rr98.8%

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{0 - a}} \]
      8. flip--N/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 \cdot 0 - a \cdot a}{0 + a}}} \]
      9. +-lft-identityN/A

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

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 - a \cdot a}{a}}} \]
      11. sub-divN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0}{a} - \frac{a \cdot a}{a}}} \]
      12. frac-subN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 \cdot a - a \cdot \left(a \cdot a\right)}{a \cdot a}}} \]
      13. mul0-lftN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 - a \cdot \left(a \cdot a\right)}{a \cdot a}}} \]
      14. clear-numN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{a \cdot a}{0 - a \cdot \left(a \cdot a\right)}} \]
      15. cbrt-prodN/A

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

        \[\leadsto \sqrt[3]{\frac{\frac{g}{-2} \cdot \left(a \cdot a\right)}{0 - a \cdot \left(a \cdot a\right)}} \]
    8. Applied egg-rr24.3%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\left(g \cdot a\right) \cdot a\right), 2\right)\right), a\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\left(a \cdot g\right) \cdot a\right), 2\right)\right), a\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(a \cdot g\right), a\right), 2\right)\right), a\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(g \cdot a\right), a\right), 2\right)\right), a\right) \]
      5. *-lowering-*.f6467.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(g, a\right), a\right), 2\right)\right), a\right) \]
    10. Applied egg-rr67.4%

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

    if -inf.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999988e-309 or 1.99998e-320 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 5.00000000000000033e293

    1. Initial program 99.1%

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

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
      4. /-lowering-/.f6499.1%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
    3. Simplified99.1%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{a}}{2}\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(g \cdot \frac{\frac{1}{a}}{2}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{1}{a}}{2} \cdot g\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{a}}{2}\right), g\right)\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), g\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), g\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2}\right), a\right), g\right)\right) \]
      8. metadata-eval99.2%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), g\right)\right) \]
    6. Applied egg-rr99.2%

      \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5}{a} \cdot g}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{g}{a \cdot 2} \leq -\infty:\\ \;\;\;\;\frac{\sqrt[3]{\frac{a \cdot \left(g \cdot a\right)}{2}}}{a}\\ \mathbf{elif}\;\frac{g}{a \cdot 2} \leq -2 \cdot 10^{-309}:\\ \;\;\;\;\sqrt[3]{g \cdot \frac{0.5}{a}}\\ \mathbf{elif}\;\frac{g}{a \cdot 2} \leq 2 \cdot 10^{-320}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{a \cdot \left(g \cdot a\right)}{2}}}{a}\\ \mathbf{elif}\;\frac{g}{a \cdot 2} \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\sqrt[3]{g \cdot \frac{0.5}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{a \cdot \left(g \cdot a\right)}{2}}}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{g}{a \cdot 2} \leq -\infty:\\ \;\;\;\;\frac{\sqrt[3]{\frac{g}{\frac{2}{a \cdot a}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{g \cdot \frac{0.5}{a}}\\ \end{array} \end{array} \]
(FPCore (g a)
 :precision binary64
 (if (<= (/ g (* a 2.0)) (- INFINITY))
   (/ (cbrt (/ g (/ 2.0 (* a a)))) a)
   (cbrt (* g (/ 0.5 a)))))
double code(double g, double a) {
	double tmp;
	if ((g / (a * 2.0)) <= -((double) INFINITY)) {
		tmp = cbrt((g / (2.0 / (a * a)))) / a;
	} else {
		tmp = cbrt((g * (0.5 / a)));
	}
	return tmp;
}
public static double code(double g, double a) {
	double tmp;
	if ((g / (a * 2.0)) <= -Double.POSITIVE_INFINITY) {
		tmp = Math.cbrt((g / (2.0 / (a * a)))) / a;
	} else {
		tmp = Math.cbrt((g * (0.5 / a)));
	}
	return tmp;
}
function code(g, a)
	tmp = 0.0
	if (Float64(g / Float64(a * 2.0)) <= Float64(-Inf))
		tmp = Float64(cbrt(Float64(g / Float64(2.0 / Float64(a * a)))) / a);
	else
		tmp = cbrt(Float64(g * Float64(0.5 / a)));
	end
	return tmp
end
code[g_, a_] := If[LessEqual[N[(g / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[Power[N[(g / N[(2.0 / N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / a), $MachinePrecision], N[Power[N[(g * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{g}{a \cdot 2} \leq -\infty:\\
\;\;\;\;\frac{\sqrt[3]{\frac{g}{\frac{2}{a \cdot a}}}}{a}\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{g \cdot \frac{0.5}{a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -inf.0

    1. Initial program 4.4%

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

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
      4. /-lowering-/.f644.4%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
    3. Simplified4.4%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cbrt-divN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\sqrt[3]{2}}{\sqrt[3]{\mathsf{neg}\left(g\right)}}\right)}^{-1}\right), \color{blue}{\left({\left(\frac{1}{\mathsf{neg}\left(a\right)}\right)}^{\frac{1}{3}}\right)}\right) \]
    6. Applied egg-rr98.9%

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{0 - a}} \]
      8. flip--N/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 \cdot 0 - a \cdot a}{0 + a}}} \]
      9. +-lft-identityN/A

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

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 - a \cdot a}{a}}} \]
      11. sub-divN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0}{a} - \frac{a \cdot a}{a}}} \]
      12. frac-subN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 \cdot a - a \cdot \left(a \cdot a\right)}{a \cdot a}}} \]
      13. mul0-lftN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{1}{\frac{0 - a \cdot \left(a \cdot a\right)}{a \cdot a}}} \]
      14. clear-numN/A

        \[\leadsto \sqrt[3]{\frac{g}{-2}} \cdot \sqrt[3]{\frac{a \cdot a}{0 - a \cdot \left(a \cdot a\right)}} \]
      15. cbrt-prodN/A

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

        \[\leadsto \sqrt[3]{\frac{\frac{g}{-2} \cdot \left(a \cdot a\right)}{0 - a \cdot \left(a \cdot a\right)}} \]
    8. Applied egg-rr27.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g \cdot \left(a \cdot a\right)}{2}\right)\right), a\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\left(g \cdot \frac{a \cdot a}{2}\right)\right), a\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\left(g \cdot \frac{1}{\frac{2}{a \cdot a}}\right)\right), a\right) \]
      4. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\left(\frac{g}{\frac{2}{a \cdot a}}\right)\right), a\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, \left(\frac{2}{a \cdot a}\right)\right)\right), a\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, \mathsf{/.f64}\left(2, \left(a \cdot a\right)\right)\right)\right), a\right) \]
      7. *-lowering-*.f6427.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(a, a\right)\right)\right)\right), a\right) \]
    10. Applied egg-rr27.8%

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

    if -inf.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a))

    1. Initial program 80.1%

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

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
      4. /-lowering-/.f6480.1%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
    3. Simplified80.1%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{a}}{2}\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(g \cdot \frac{\frac{1}{a}}{2}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{1}{a}}{2} \cdot g\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{a}}{2}\right), g\right)\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), g\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), g\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2}\right), a\right), g\right)\right) \]
      8. metadata-eval80.2%

        \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), g\right)\right) \]
    6. Applied egg-rr80.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{g}{a \cdot 2} \leq -\infty:\\ \;\;\;\;\frac{\sqrt[3]{\frac{g}{\frac{2}{a \cdot a}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{g \cdot \frac{0.5}{a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 76.2% 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 74.5%

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g}{2 \cdot a}\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{g}{a}}{2}\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{g}{a}\right), 2\right)\right) \]
    4. /-lowering-/.f6474.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(g, a\right), 2\right)\right) \]
  3. Simplified74.5%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{g}{a}}{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. div-invN/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{a}}{2}\right)\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(g \cdot \frac{\frac{1}{a}}{2}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{\frac{1}{a}}{2} \cdot g\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{a}}{2}\right), g\right)\right) \]
    5. associate-/l/N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), g\right)\right) \]
    6. associate-/r*N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), g\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2}\right), a\right), g\right)\right) \]
    8. metadata-eval74.5%

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), g\right)\right) \]
  6. Applied egg-rr74.5%

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

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

Reproduce

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