2-ancestry mixing, zero discriminant

Percentage Accurate: 76.0% → 98.7%
Time: 8.6s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 76.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \sqrt[3]{-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(Float64(-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.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
t_1 := \frac{\sqrt[3]{a \cdot \left(a \cdot \left(g \cdot 0.5\right)\right)}}{a}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{\frac{g}{a} \cdot \left(\sqrt{0.5} \cdot \sqrt{0.5}\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -9.99999999999999988e254 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a))

    1. Initial program 14.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{-g} \cdot \sqrt[3]{\frac{-0.5}{a}}} \]
    6. Applied rewrites83.3%

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

    if -9.99999999999999988e254 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999999e-302

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{g \cdot 0.5}}{\sqrt[3]{a}}} \]
    5. Applied rewrites98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000007e-294 < (*.f64 #s(literal 2 binary64) a)

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.7% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.7% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{g}{a \cdot 2}\\
t_1 := \frac{\sqrt[3]{a \cdot \left(a \cdot \left(g \cdot 0.5\right)\right)}}{a}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\sqrt[3]{\frac{a}{g \cdot 0.5}}}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -9.99999999999999988e254 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a))

    1. Initial program 14.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{-g} \cdot \sqrt[3]{\frac{-0.5}{a}}} \]
    6. Applied rewrites83.3%

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

    if -9.99999999999999988e254 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -1.9999999999999999e-302

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277

    1. Initial program 98.1%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification95.2%

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

Alternative 7: 90.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\sqrt[3]{\frac{0.5}{\frac{a}{g}}}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\sqrt[3]{t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 g (*.f64 #s(literal 2 binary64) a)) < -inf.0 or -1.9999999999999999e-302 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 0.0 or 2.00000000000000001e277 < (/.f64 g (*.f64 #s(literal 2 binary64) a))

    1. Initial program 8.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 g (*.f64 #s(literal 2 binary64) a)) < 2.00000000000000001e277

    1. Initial program 98.1%

      \[\sqrt[3]{\frac{g}{2 \cdot a}} \]
    2. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification95.1%

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

Alternative 8: 76.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 9: 76.0% 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.5%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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