2-ancestry mixing, zero discriminant

Percentage Accurate: 76.3% → 98.7%
Time: 9.3s
Alternatives: 8
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 8 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.7% accurate, 0.5× speedup?

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

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

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\mathsf{neg}\left(a\right)}\right)\right) \]
    11. pow1/3N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \color{blue}{\frac{1}{3}}\right)\right) \]
    13. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(0 - a\right), \frac{1}{3}\right)\right) \]
    14. --lowering--.f6443.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, a\right), \frac{1}{3}\right)\right) \]
  4. Applied egg-rr43.2%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{g}{-2}}}{{\left(0 - a\right)}^{0.3333333333333333}}} \]
  5. Step-by-step derivation
    1. unpow1/3N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{0 - a}\right)\right) \]
    2. flip3--N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\frac{1}{\frac{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}{{0}^{3} - {a}^{3}}}}\right)\right) \]
    4. cbrt-divN/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{\frac{{0}^{3} - {a}^{3}}{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}}\right)\right)\right)\right) \]
    9. flip3--N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{0 - a}\right)\right)\right)\right) \]
    10. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    12. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)}\right)\right)\right)\right) \]
    13. remove-double-negN/A

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

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

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.5× speedup?

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

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

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\mathsf{neg}\left(a\right)}\right)\right) \]
    11. pow1/3N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \color{blue}{\frac{1}{3}}\right)\right) \]
    13. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(0 - a\right), \frac{1}{3}\right)\right) \]
    14. --lowering--.f6443.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, a\right), \frac{1}{3}\right)\right) \]
  4. Applied egg-rr43.2%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{g}{-2}}}{{\left(0 - a\right)}^{0.3333333333333333}}} \]
  5. Step-by-step derivation
    1. unpow1/3N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{0 - a}\right)\right) \]
    2. flip3--N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\frac{1}{\frac{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}{{0}^{3} - {a}^{3}}}}\right)\right) \]
    4. cbrt-divN/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{\frac{{0}^{3} - {a}^{3}}{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}}\right)\right)\right)\right) \]
    9. flip3--N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{0 - a}\right)\right)\right)\right) \]
    10. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    12. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)}\right)\right)\right)\right) \]
    13. remove-double-negN/A

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

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

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

Alternative 3: 98.7% accurate, 0.5× speedup?

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

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

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\left(\mathsf{neg}\left(\frac{g}{2}\right)\right)\right), \left({-1}^{\frac{1}{3}}\right)\right), \left(\sqrt[3]{a}\right)\right) \]
    13. distribute-neg-frac2N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left({-1}^{\frac{1}{3}}\right)\right), \left(\sqrt[3]{a}\right)\right) \]
    16. pow1/3N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{cbrt.f64}\left(-1\right)\right), \left(\sqrt[3]{a}\right)\right) \]
    18. cbrt-lowering-cbrt.f6498.7%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, 2\right)\right), \left(\sqrt[3]{a}\right)\right) \]
    7. cbrt-lowering-cbrt.f6498.7%

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

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{g}{2}}}{\sqrt[3]{a}}} \]
  7. 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 79.4%

    \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\mathsf{neg}\left(a\right)}\right)\right) \]
    11. pow1/3N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(a\right)\right), \color{blue}{\frac{1}{3}}\right)\right) \]
    13. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\left(0 - a\right), \frac{1}{3}\right)\right) \]
    14. --lowering--.f6443.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, a\right), \frac{1}{3}\right)\right) \]
  4. Applied egg-rr43.2%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{g}{-2}}}{{\left(0 - a\right)}^{0.3333333333333333}}} \]
  5. Step-by-step derivation
    1. unpow1/3N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{0 - a}\right)\right) \]
    2. flip3--N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \left(\sqrt[3]{\frac{1}{\frac{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}{{0}^{3} - {a}^{3}}}}\right)\right) \]
    4. cbrt-divN/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{\frac{{0}^{3} - {a}^{3}}{0 \cdot 0 + \left(a \cdot a + 0 \cdot a\right)}}\right)\right)\right)\right) \]
    9. flip3--N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{1}{0 - a}\right)\right)\right)\right) \]
    10. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(0 - a\right)\right)}\right)\right)\right)\right) \]
    12. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(g, -2\right)\right), \mathsf{/.f64}\left(1, \mathsf{cbrt.f64}\left(\left(\frac{-1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(a\right)\right)\right)}\right)\right)\right)\right) \]
    13. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt[3]{g \cdot \left(\frac{1}{2} \cdot 1\right)}}{1 \cdot \sqrt[3]{a}} \]
    16. *-inversesN/A

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

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

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

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

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

      \[\leadsto \frac{\sqrt[3]{\frac{g \cdot \left(a \cdot \frac{1}{2}\right)}{a}}}{1 \cdot \sqrt[3]{a}} \]
    22. *-lft-identityN/A

      \[\leadsto \frac{\sqrt[3]{\frac{g \cdot \left(a \cdot \frac{1}{2}\right)}{a}}}{\sqrt[3]{a}} \]
  10. Applied egg-rr98.6%

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

Alternative 5: 76.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \mathsf{cbrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2}\right), \left(\frac{a}{g}\right)\right)\right) \]
    6. metadata-evalN/A

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

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

    \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5}{\frac{a}{g}}}} \]
  5. Step-by-step derivation
    1. associate-/r/N/A

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

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

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

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{2}}{{a}^{1}}\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{2}}{{a}^{\left(2 + -1\right)}}\right)\right) \]
    6. pow-prod-upN/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{2}}{{a}^{2} \cdot {a}^{-1}}\right)\right) \]
    7. pow2N/A

      \[\leadsto \mathsf{cbrt.f64}\left(\left(\frac{g \cdot \frac{1}{2}}{\left(a \cdot a\right) \cdot {a}^{-1}}\right)\right) \]
    8. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.3% accurate, 1.0× speedup?

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

\\
\sqrt[3]{\frac{\frac{g}{a}}{2}}
\end{array}
Derivation
  1. Initial program 79.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-/.f6479.8%

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

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

Alternative 8: 76.4% 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 79.4%

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

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

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

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

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

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

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

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

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

Reproduce

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