2-ancestry mixing, positive discriminant

Percentage Accurate: 44.0% → 77.1%
Time: 14.3s
Alternatives: 12
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{2 \cdot a}\\ t_1 := \sqrt{g \cdot g - h \cdot h}\\ \sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)} \end{array} \end{array} \]
(FPCore (g h a)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* 2.0 a))) (t_1 (sqrt (- (* g g) (* h h)))))
   (+ (cbrt (* t_0 (+ (- g) t_1))) (cbrt (* t_0 (- (- g) t_1))))))
double code(double g, double h, double a) {
	double t_0 = 1.0 / (2.0 * a);
	double t_1 = sqrt(((g * g) - (h * h)));
	return cbrt((t_0 * (-g + t_1))) + cbrt((t_0 * (-g - t_1)));
}
public static double code(double g, double h, double a) {
	double t_0 = 1.0 / (2.0 * a);
	double t_1 = Math.sqrt(((g * g) - (h * h)));
	return Math.cbrt((t_0 * (-g + t_1))) + Math.cbrt((t_0 * (-g - t_1)));
}
function code(g, h, a)
	t_0 = Float64(1.0 / Float64(2.0 * a))
	t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
	return Float64(cbrt(Float64(t_0 * Float64(Float64(-g) + t_1))) + cbrt(Float64(t_0 * Float64(Float64(-g) - t_1))))
end
code[g_, h_, a_] := Block[{t$95$0 = N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(t$95$0 * N[((-g) + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$0 * N[((-g) - t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{2 \cdot a}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
\sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)}
\end{array}
\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 12 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: 44.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{2 \cdot a}\\ t_1 := \sqrt{g \cdot g - h \cdot h}\\ \sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)} \end{array} \end{array} \]
(FPCore (g h a)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* 2.0 a))) (t_1 (sqrt (- (* g g) (* h h)))))
   (+ (cbrt (* t_0 (+ (- g) t_1))) (cbrt (* t_0 (- (- g) t_1))))))
double code(double g, double h, double a) {
	double t_0 = 1.0 / (2.0 * a);
	double t_1 = sqrt(((g * g) - (h * h)));
	return cbrt((t_0 * (-g + t_1))) + cbrt((t_0 * (-g - t_1)));
}
public static double code(double g, double h, double a) {
	double t_0 = 1.0 / (2.0 * a);
	double t_1 = Math.sqrt(((g * g) - (h * h)));
	return Math.cbrt((t_0 * (-g + t_1))) + Math.cbrt((t_0 * (-g - t_1)));
}
function code(g, h, a)
	t_0 = Float64(1.0 / Float64(2.0 * a))
	t_1 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
	return Float64(cbrt(Float64(t_0 * Float64(Float64(-g) + t_1))) + cbrt(Float64(t_0 * Float64(Float64(-g) - t_1))))
end
code[g_, h_, a_] := Block[{t$95$0 = N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(t$95$0 * N[((-g) + t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(t$95$0 * N[((-g) - t$95$1), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{2 \cdot a}\\
t_1 := \sqrt{g \cdot g - h \cdot h}\\
\sqrt[3]{t\_0 \cdot \left(\left(-g\right) + t\_1\right)} + \sqrt[3]{t\_0 \cdot \left(\left(-g\right) - t\_1\right)}
\end{array}
\end{array}

Alternative 1: 77.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{h}{g} \cdot h\\
t_1 := \sqrt{\sqrt{\left(g - h\right) \cdot \left(h + g\right)}}\\
\mathbf{if}\;g \leq -1.02 \cdot 10^{+136}:\\
\;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\

\mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\
\;\;\;\;\sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)} + \sqrt[3]{0.5 \cdot \left(t\_1 \cdot t\_1 - g\right)} \cdot \sqrt[3]{{a}^{-1}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if g < -1.01999999999999996e136

    1. Initial program 7.1%

      \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around inf

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

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

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

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

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
    6. Taylor expanded in g around inf

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
      4. lower-*.f6464.1

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
    9. Taylor expanded in g around inf

      \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
      10. lower-cbrt.f6465.5

        \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
    11. Applied rewrites65.5%

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
      3. lower-+.f6465.5

        \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
    13. Applied rewrites65.5%

      \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

    if -1.01999999999999996e136 < g < -6e-124

    1. Initial program 74.5%

      \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{{a}^{-1}} \cdot \sqrt[3]{\left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right) \cdot \color{blue}{\frac{1}{2}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    4. Applied rewrites97.9%

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{{a}^{-1}} \cdot \sqrt[3]{\left(\sqrt{\left(g + h\right) \cdot \color{blue}{\left(g - h\right)}} - g\right) \cdot \frac{1}{2}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
      7. difference-of-squaresN/A

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

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

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

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

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

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

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

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

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

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

    if -6e-124 < g

    1. Initial program 46.6%

      \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in g around inf

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
      4. lower-neg.f6443.4

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
    5. Applied rewrites43.4%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
    6. Taylor expanded in g around inf

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
      4. lower-*.f6477.4

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
    9. Taylor expanded in h around 0

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
      7. unpow2N/A

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
      10. mul-1-negN/A

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
      12. lower-neg.f6477.5

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
    11. Applied rewrites77.5%

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
    12. Step-by-step derivation
      1. Applied rewrites81.0%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
    13. Recombined 3 regimes into one program.
    14. Final simplification80.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -1.02 \cdot 10^{+136}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)} + \sqrt[3]{0.5 \cdot \left(\sqrt{\sqrt{\left(g - h\right) \cdot \left(h + g\right)}} \cdot \sqrt{\sqrt{\left(g - h\right) \cdot \left(h + g\right)}} - g\right)} \cdot \sqrt[3]{{a}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
    15. Add Preprocessing

    Alternative 2: 77.4% accurate, 0.7× speedup?

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

      1. Initial program 4.4%

        \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in g around inf

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
        4. lower-neg.f644.1

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
      6. Taylor expanded in g around inf

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
        4. lower-*.f6463.0

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
      9. Taylor expanded in g around inf

        \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
      10. Step-by-step derivation
        1. lower-*.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
        10. lower-cbrt.f6464.5

          \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
      11. Applied rewrites64.5%

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

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

          \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
        3. lower-+.f6464.5

          \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
      13. Applied rewrites64.5%

        \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

      if -4.6e145 < g < -6e-124

      1. Initial program 75.3%

        \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

      if -6e-124 < g

      1. Initial program 46.6%

        \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in g around inf

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
        4. lower-neg.f6443.4

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
      5. Applied rewrites43.4%

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
      6. Taylor expanded in g around inf

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
        4. lower-*.f6477.4

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
      9. Taylor expanded in h around 0

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
      10. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
        10. mul-1-negN/A

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
        12. lower-neg.f6477.5

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
      11. Applied rewrites77.5%

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
      12. Step-by-step derivation
        1. Applied rewrites81.0%

          \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
      13. Recombined 3 regimes into one program.
      14. Final simplification80.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -4.6 \cdot 10^{+145}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
      15. Add Preprocessing

      Alternative 3: 77.5% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{h}{g} \cdot h\\ \mathbf{if}\;g \leq -2.5 \cdot 10^{+150}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot 0.5}}{\sqrt[3]{a}} + \sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}\\ \end{array} \end{array} \]
      (FPCore (g h a)
       :precision binary64
       (let* ((t_0 (* (/ h g) h)))
         (if (<= g -2.5e+150)
           (+ (cbrt (* (* (/ h a) (/ h g)) -0.25)) (cbrt (/ (- g) a)))
           (if (<= g -6e-124)
             (+
              (/ (cbrt (* (- (sqrt (* (- g h) (+ h g))) g) 0.5)) (cbrt a))
              (cbrt (* (/ -1.0 (* a 2.0)) (+ (sqrt (- (* g g) (* h h))) g))))
             (+
              (cbrt (/ (- (* 0.25 t_0) g) a))
              (cbrt (* (/ 0.5 a) (* -0.5 t_0))))))))
      double code(double g, double h, double a) {
      	double t_0 = (h / g) * h;
      	double tmp;
      	if (g <= -2.5e+150) {
      		tmp = cbrt((((h / a) * (h / g)) * -0.25)) + cbrt((-g / a));
      	} else if (g <= -6e-124) {
      		tmp = (cbrt(((sqrt(((g - h) * (h + g))) - g) * 0.5)) / cbrt(a)) + cbrt(((-1.0 / (a * 2.0)) * (sqrt(((g * g) - (h * h))) + g)));
      	} else {
      		tmp = cbrt((((0.25 * t_0) - g) / a)) + cbrt(((0.5 / a) * (-0.5 * t_0)));
      	}
      	return tmp;
      }
      
      public static double code(double g, double h, double a) {
      	double t_0 = (h / g) * h;
      	double tmp;
      	if (g <= -2.5e+150) {
      		tmp = Math.cbrt((((h / a) * (h / g)) * -0.25)) + Math.cbrt((-g / a));
      	} else if (g <= -6e-124) {
      		tmp = (Math.cbrt(((Math.sqrt(((g - h) * (h + g))) - g) * 0.5)) / Math.cbrt(a)) + Math.cbrt(((-1.0 / (a * 2.0)) * (Math.sqrt(((g * g) - (h * h))) + g)));
      	} else {
      		tmp = Math.cbrt((((0.25 * t_0) - g) / a)) + Math.cbrt(((0.5 / a) * (-0.5 * t_0)));
      	}
      	return tmp;
      }
      
      function code(g, h, a)
      	t_0 = Float64(Float64(h / g) * h)
      	tmp = 0.0
      	if (g <= -2.5e+150)
      		tmp = Float64(cbrt(Float64(Float64(Float64(h / a) * Float64(h / g)) * -0.25)) + cbrt(Float64(Float64(-g) / a)));
      	elseif (g <= -6e-124)
      		tmp = Float64(Float64(cbrt(Float64(Float64(sqrt(Float64(Float64(g - h) * Float64(h + g))) - g) * 0.5)) / cbrt(a)) + cbrt(Float64(Float64(-1.0 / Float64(a * 2.0)) * Float64(sqrt(Float64(Float64(g * g) - Float64(h * h))) + g))));
      	else
      		tmp = Float64(cbrt(Float64(Float64(Float64(0.25 * t_0) - g) / a)) + cbrt(Float64(Float64(0.5 / a) * Float64(-0.5 * t_0))));
      	end
      	return tmp
      end
      
      code[g_, h_, a_] := Block[{t$95$0 = N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision]}, If[LessEqual[g, -2.5e+150], N[(N[Power[N[(N[(N[(h / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[g, -6e-124], N[(N[(N[Power[N[(N[(N[Sqrt[N[(N[(g - h), $MachinePrecision] * N[(h + g), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision] * 0.5), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(N[(-1.0 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[(g * g), $MachinePrecision] - N[(h * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(0.25 * t$95$0), $MachinePrecision] - g), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.5 / a), $MachinePrecision] * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{h}{g} \cdot h\\
      \mathbf{if}\;g \leq -2.5 \cdot 10^{+150}:\\
      \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\
      
      \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\
      \;\;\;\;\frac{\sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot 0.5}}{\sqrt[3]{a}} + \sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if g < -2.50000000000000004e150

        1. Initial program 3.0%

          \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in g around inf

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
          4. lower-neg.f643.9

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
        5. Applied rewrites3.9%

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
        6. Taylor expanded in g around inf

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
          4. lower-*.f6462.5

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
        9. Taylor expanded in g around inf

          \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
        10. Step-by-step derivation
          1. lower-*.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
          10. lower-cbrt.f6464.0

            \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
        11. Applied rewrites64.0%

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

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

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

            \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
        13. Applied rewrites64.0%

          \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

        if -2.50000000000000004e150 < g < -6e-124

        1. Initial program 75.7%

          \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2}}}{\sqrt[3]{a}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
        4. Applied rewrites97.9%

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

        if -6e-124 < g

        1. Initial program 46.6%

          \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in g around inf

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
          4. lower-neg.f6443.4

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
        5. Applied rewrites43.4%

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
        6. Taylor expanded in g around inf

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
          4. lower-*.f6477.4

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
        9. Taylor expanded in h around 0

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
        10. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
          7. unpow2N/A

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
          10. mul-1-negN/A

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
          12. lower-neg.f6477.5

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
        11. Applied rewrites77.5%

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
        12. Step-by-step derivation
          1. Applied rewrites81.0%

            \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
        13. Recombined 3 regimes into one program.
        14. Final simplification80.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -2.5 \cdot 10^{+150}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot 0.5}}{\sqrt[3]{a}} + \sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\sqrt{g \cdot g - h \cdot h} + g\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
        15. Add Preprocessing

        Alternative 4: 77.6% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{h}{g} \cdot h\\ t_1 := \sqrt{\left(g - h\right) \cdot \left(h + g\right)}\\ \mathbf{if}\;g \leq -2.1 \cdot 10^{+152}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, \sqrt[3]{t\_1 - g}, \sqrt[3]{\frac{0.5}{-a} \cdot \left(t\_1 + g\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}\\ \end{array} \end{array} \]
        (FPCore (g h a)
         :precision binary64
         (let* ((t_0 (* (/ h g) h)) (t_1 (sqrt (* (- g h) (+ h g)))))
           (if (<= g -2.1e+152)
             (+ (cbrt (* (* (/ h a) (/ h g)) -0.25)) (cbrt (/ (- g) a)))
             (if (<= g -6e-124)
               (fma
                (cbrt (/ 0.5 a))
                (cbrt (- t_1 g))
                (cbrt (* (/ 0.5 (- a)) (+ t_1 g))))
               (+
                (cbrt (/ (- (* 0.25 t_0) g) a))
                (cbrt (* (/ 0.5 a) (* -0.5 t_0))))))))
        double code(double g, double h, double a) {
        	double t_0 = (h / g) * h;
        	double t_1 = sqrt(((g - h) * (h + g)));
        	double tmp;
        	if (g <= -2.1e+152) {
        		tmp = cbrt((((h / a) * (h / g)) * -0.25)) + cbrt((-g / a));
        	} else if (g <= -6e-124) {
        		tmp = fma(cbrt((0.5 / a)), cbrt((t_1 - g)), cbrt(((0.5 / -a) * (t_1 + g))));
        	} else {
        		tmp = cbrt((((0.25 * t_0) - g) / a)) + cbrt(((0.5 / a) * (-0.5 * t_0)));
        	}
        	return tmp;
        }
        
        function code(g, h, a)
        	t_0 = Float64(Float64(h / g) * h)
        	t_1 = sqrt(Float64(Float64(g - h) * Float64(h + g)))
        	tmp = 0.0
        	if (g <= -2.1e+152)
        		tmp = Float64(cbrt(Float64(Float64(Float64(h / a) * Float64(h / g)) * -0.25)) + cbrt(Float64(Float64(-g) / a)));
        	elseif (g <= -6e-124)
        		tmp = fma(cbrt(Float64(0.5 / a)), cbrt(Float64(t_1 - g)), cbrt(Float64(Float64(0.5 / Float64(-a)) * Float64(t_1 + g))));
        	else
        		tmp = Float64(cbrt(Float64(Float64(Float64(0.25 * t_0) - g) / a)) + cbrt(Float64(Float64(0.5 / a) * Float64(-0.5 * t_0))));
        	end
        	return tmp
        end
        
        code[g_, h_, a_] := Block[{t$95$0 = N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(g - h), $MachinePrecision] * N[(h + g), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[g, -2.1e+152], N[(N[Power[N[(N[(N[(h / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[g, -6e-124], N[(N[Power[N[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(t$95$1 - g), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.5 / (-a)), $MachinePrecision] * N[(t$95$1 + g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(0.25 * t$95$0), $MachinePrecision] - g), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.5 / a), $MachinePrecision] * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{h}{g} \cdot h\\
        t_1 := \sqrt{\left(g - h\right) \cdot \left(h + g\right)}\\
        \mathbf{if}\;g \leq -2.1 \cdot 10^{+152}:\\
        \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\
        
        \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\
        \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, \sqrt[3]{t\_1 - g}, \sqrt[3]{\frac{0.5}{-a} \cdot \left(t\_1 + g\right)}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if g < -2.1000000000000002e152

          1. Initial program 1.5%

            \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in g around inf

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

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

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
          6. Taylor expanded in g around inf

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
            4. lower-*.f6461.9

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
          9. Taylor expanded in g around inf

            \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
          10. Step-by-step derivation
            1. lower-*.f64N/A

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
            10. lower-cbrt.f6463.4

              \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
          11. Applied rewrites63.4%

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

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

              \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
            3. lower-+.f6463.4

              \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
          13. Applied rewrites63.4%

            \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

          if -2.1000000000000002e152 < g < -6e-124

          1. Initial program 76.1%

            \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\sqrt[3]{{a}^{-1}} \cdot \sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot 0.5}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
          5. Applied rewrites97.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}, \sqrt[3]{\left(\left(-g\right) - \sqrt{\left(h + g\right) \cdot \left(g - h\right)}\right) \cdot \frac{0.5}{a}}\right)} \]

          if -6e-124 < g

          1. Initial program 46.6%

            \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in g around inf

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
            4. lower-neg.f6443.4

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
          5. Applied rewrites43.4%

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
          6. Taylor expanded in g around inf

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
            4. lower-*.f6477.4

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
          9. Taylor expanded in h around 0

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
          10. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
            7. unpow2N/A

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
            10. mul-1-negN/A

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
            12. lower-neg.f6477.5

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
          11. Applied rewrites77.5%

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
          12. Step-by-step derivation
            1. Applied rewrites81.0%

              \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
          13. Recombined 3 regimes into one program.
          14. Final simplification80.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -2.1 \cdot 10^{+152}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -6 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, \sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}, \sqrt[3]{\frac{0.5}{-a} \cdot \left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
          15. Add Preprocessing

          Alternative 5: 76.9% accurate, 0.8× speedup?

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

            1. Initial program 4.4%

              \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in g around inf

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
              4. lower-neg.f644.1

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
            6. Taylor expanded in g around inf

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
              4. lower-*.f6463.0

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
            9. Taylor expanded in g around inf

              \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
            10. Step-by-step derivation
              1. lower-*.f64N/A

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

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

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

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

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

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

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

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

                \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
              10. lower-cbrt.f6464.5

                \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
            11. Applied rewrites64.5%

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

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

                \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
              3. lower-+.f6464.5

                \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
            13. Applied rewrites64.5%

              \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

            if -4.6e145 < g < -1.54999999999999999e-87

            1. Initial program 73.9%

              \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
            5. Taylor expanded in g around -inf

              \[\leadsto \frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \color{blue}{-1 \cdot g}\right)} \]
            6. Step-by-step derivation
              1. mul-1-negN/A

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

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

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

            if -1.54999999999999999e-87 < g

            1. Initial program 48.1%

              \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in g around inf

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
              4. lower-neg.f6442.6

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
            6. Taylor expanded in g around inf

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
              4. lower-*.f6477.7

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
            9. Taylor expanded in h around 0

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
            10. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
              7. unpow2N/A

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
              10. mul-1-negN/A

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
              12. lower-neg.f6477.9

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
            11. Applied rewrites77.9%

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
            12. Step-by-step derivation
              1. Applied rewrites81.3%

                \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
            13. Recombined 3 regimes into one program.
            14. Final simplification80.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -4.6 \cdot 10^{+145}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -1.55 \cdot 10^{-87}:\\ \;\;\;\;\sqrt[3]{\frac{-1}{a \cdot 2} \cdot \left(\left(-g\right) + g\right)} + \frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
            15. Add Preprocessing

            Alternative 6: 77.0% accurate, 0.8× speedup?

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

              1. Initial program 4.4%

                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                4. lower-neg.f644.1

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
              6. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                4. lower-*.f6463.0

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
              9. Taylor expanded in g around inf

                \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
              10. Step-by-step derivation
                1. lower-*.f64N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
                10. lower-cbrt.f6464.5

                  \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
              11. Applied rewrites64.5%

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

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

                  \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                3. lower-+.f6464.5

                  \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
              13. Applied rewrites64.5%

                \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]

              if -4.6e145 < g < -2.1000000000000001e-4

              1. Initial program 67.5%

                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              5. Taylor expanded in g around -inf

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

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

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

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

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

                  \[\leadsto \frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{\frac{-1}{4} \cdot \color{blue}{\left(h \cdot h\right)}}{a \cdot g}} \]
                6. lower-*.f6496.1

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

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

              if -2.1000000000000001e-4 < g

              1. Initial program 52.7%

                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                4. lower-neg.f6440.0

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
              6. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                4. lower-*.f6479.3

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
              9. Taylor expanded in h around 0

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
              10. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
                7. unpow2N/A

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
                10. mul-1-negN/A

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
                12. lower-neg.f6479.5

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
              11. Applied rewrites79.5%

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
              12. Step-by-step derivation
                1. Applied rewrites82.5%

                  \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
              13. Recombined 3 regimes into one program.
              14. Final simplification80.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;g \leq -4.6 \cdot 10^{+145}:\\ \;\;\;\;\sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\ \mathbf{elif}\;g \leq -0.00021:\\ \;\;\;\;\sqrt[3]{\frac{\left(h \cdot h\right) \cdot -0.25}{a \cdot g}} + \frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}}{\sqrt[3]{a \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)}\\ \end{array} \]
              15. Add Preprocessing

              Alternative 7: 75.5% accurate, 1.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{h}{g} \cdot h\\ \sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)} \end{array} \end{array} \]
              (FPCore (g h a)
               :precision binary64
               (let* ((t_0 (* (/ h g) h)))
                 (+ (cbrt (/ (- (* 0.25 t_0) g) a)) (cbrt (* (/ 0.5 a) (* -0.5 t_0))))))
              double code(double g, double h, double a) {
              	double t_0 = (h / g) * h;
              	return cbrt((((0.25 * t_0) - g) / a)) + cbrt(((0.5 / a) * (-0.5 * t_0)));
              }
              
              public static double code(double g, double h, double a) {
              	double t_0 = (h / g) * h;
              	return Math.cbrt((((0.25 * t_0) - g) / a)) + Math.cbrt(((0.5 / a) * (-0.5 * t_0)));
              }
              
              function code(g, h, a)
              	t_0 = Float64(Float64(h / g) * h)
              	return Float64(cbrt(Float64(Float64(Float64(0.25 * t_0) - g) / a)) + cbrt(Float64(Float64(0.5 / a) * Float64(-0.5 * t_0))))
              end
              
              code[g_, h_, a_] := Block[{t$95$0 = N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision]}, N[(N[Power[N[(N[(N[(0.25 * t$95$0), $MachinePrecision] - g), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.5 / a), $MachinePrecision] * N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{h}{g} \cdot h\\
              \sqrt[3]{\frac{0.25 \cdot t\_0 - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot t\_0\right)}
              \end{array}
              \end{array}
              
              Derivation
              1. Initial program 42.3%

                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                4. lower-neg.f6426.1

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
              6. Taylor expanded in g around inf

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                4. lower-*.f6472.6

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
              9. Taylor expanded in h around 0

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a} + \frac{1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} \]
              10. Step-by-step derivation
                1. +-commutativeN/A

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

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

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

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \color{blue}{\frac{{h}^{2}}{g}}, -1 \cdot \frac{g}{a}\right)} \]
                7. unpow2N/A

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

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{-1 \cdot g}{a}}\right)} \]
                10. mul-1-negN/A

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{\frac{1}{4}}{a}, \frac{h \cdot h}{g}, \color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}\right)} \]
                12. lower-neg.f6472.6

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{\color{blue}{-g}}{a}\right)} \]
              11. Applied rewrites72.6%

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(-0.5 \cdot \frac{h \cdot h}{g}\right)} + \sqrt[3]{\color{blue}{\mathsf{fma}\left(\frac{0.25}{a}, \frac{h \cdot h}{g}, \frac{-g}{a}\right)}} \]
              12. Step-by-step derivation
                1. Applied rewrites74.8%

                  \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\frac{h}{g} \cdot h\right) \cdot -0.5\right) \cdot \frac{0.5}{a}} + \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}}} \]
                2. Final simplification74.8%

                  \[\leadsto \sqrt[3]{\frac{0.25 \cdot \left(\frac{h}{g} \cdot h\right) - g}{a}} + \sqrt[3]{\frac{0.5}{a} \cdot \left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right)} \]
                3. Add Preprocessing

                Alternative 8: 75.3% accurate, 1.2× speedup?

                \[\begin{array}{l} \\ \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}} \end{array} \]
                (FPCore (g h a)
                 :precision binary64
                 (+ (cbrt (* (* (/ h a) (/ h g)) -0.25)) (cbrt (/ (- g) a))))
                double code(double g, double h, double a) {
                	return cbrt((((h / a) * (h / g)) * -0.25)) + cbrt((-g / a));
                }
                
                public static double code(double g, double h, double a) {
                	return Math.cbrt((((h / a) * (h / g)) * -0.25)) + Math.cbrt((-g / a));
                }
                
                function code(g, h, a)
                	return Float64(cbrt(Float64(Float64(Float64(h / a) * Float64(h / g)) * -0.25)) + cbrt(Float64(Float64(-g) / a)))
                end
                
                code[g_, h_, a_] := N[(N[Power[N[(N[(N[(h / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}
                \end{array}
                
                Derivation
                1. Initial program 42.3%

                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                  4. lower-neg.f6426.1

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
                6. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                  4. lower-*.f6472.6

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
                9. Taylor expanded in g around inf

                  \[\leadsto \color{blue}{\sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                10. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
                  10. lower-cbrt.f6474.5

                    \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \color{blue}{\sqrt[3]{0.5}}\right) + \sqrt[3]{\frac{-g}{a}} \]
                11. Applied rewrites74.5%

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

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

                    \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                  3. lower-+.f6474.5

                    \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} \]
                13. Applied rewrites74.5%

                  \[\leadsto \color{blue}{\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{-0.25 \cdot \left(\frac{h}{g} \cdot \frac{h}{a}\right)}} \]
                14. Final simplification74.5%

                  \[\leadsto \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} + \sqrt[3]{\frac{-g}{a}} \]
                15. Add Preprocessing

                Alternative 9: 71.6% accurate, 1.2× speedup?

                \[\begin{array}{l} \\ \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}} + \sqrt[3]{\frac{-g}{a}} \end{array} \]
                (FPCore (g h a)
                 :precision binary64
                 (+ (cbrt (* (/ (* h h) g) (/ -0.25 a))) (cbrt (/ (- g) a))))
                double code(double g, double h, double a) {
                	return cbrt((((h * h) / g) * (-0.25 / a))) + cbrt((-g / a));
                }
                
                public static double code(double g, double h, double a) {
                	return Math.cbrt((((h * h) / g) * (-0.25 / a))) + Math.cbrt((-g / a));
                }
                
                function code(g, h, a)
                	return Float64(cbrt(Float64(Float64(Float64(h * h) / g) * Float64(-0.25 / a))) + cbrt(Float64(Float64(-g) / a)))
                end
                
                code[g_, h_, a_] := N[(N[Power[N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * N[(-0.25 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}} + \sqrt[3]{\frac{-g}{a}}
                \end{array}
                
                Derivation
                1. Initial program 42.3%

                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                  4. lower-neg.f6426.1

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
                6. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                  4. lower-*.f6472.6

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
                9. Taylor expanded in g around inf

                  \[\leadsto \sqrt[3]{\color{blue}{\frac{-1}{4} \cdot \frac{{h}^{2}}{a \cdot g}}} + \sqrt[3]{\frac{-g}{a}} \]
                10. Step-by-step derivation
                  1. associate-*r/N/A

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

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

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

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

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

                    \[\leadsto \sqrt[3]{\frac{\frac{-1}{4}}{a} \cdot \frac{\color{blue}{h \cdot h}}{g}} + \sqrt[3]{\frac{-g}{a}} \]
                  7. lower-*.f6472.6

                    \[\leadsto \sqrt[3]{\frac{-0.25}{a} \cdot \frac{\color{blue}{h \cdot h}}{g}} + \sqrt[3]{\frac{-g}{a}} \]
                11. Applied rewrites72.6%

                  \[\leadsto \sqrt[3]{\color{blue}{\frac{-0.25}{a} \cdot \frac{h \cdot h}{g}}} + \sqrt[3]{\frac{-g}{a}} \]
                12. Final simplification72.6%

                  \[\leadsto \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                13. Add Preprocessing

                Alternative 10: 15.3% accurate, 1.3× speedup?

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

                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                  4. lower-neg.f6426.1

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
                6. Taylor expanded in g around -inf

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-2 \cdot g\right)}} + \sqrt[3]{\frac{-g}{a}} \]
                7. Step-by-step derivation
                  1. lower-*.f6415.3

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt[3]{0.5 \cdot \color{blue}{\frac{-2 \cdot g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                10. Applied rewrites15.3%

                  \[\leadsto \sqrt[3]{\color{blue}{0.5 \cdot \frac{-2 \cdot g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                11. Final simplification15.3%

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

                Alternative 11: 15.3% accurate, 1.3× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{\frac{-g}{a}}\\ t\_0 + t\_0 \end{array} \end{array} \]
                (FPCore (g h a)
                 :precision binary64
                 (let* ((t_0 (cbrt (/ (- g) a)))) (+ t_0 t_0)))
                double code(double g, double h, double a) {
                	double t_0 = cbrt((-g / a));
                	return t_0 + t_0;
                }
                
                public static double code(double g, double h, double a) {
                	double t_0 = Math.cbrt((-g / a));
                	return t_0 + t_0;
                }
                
                function code(g, h, a)
                	t_0 = cbrt(Float64(Float64(-g) / a))
                	return Float64(t_0 + t_0)
                end
                
                code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$0 + t$95$0), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \sqrt[3]{\frac{-g}{a}}\\
                t\_0 + t\_0
                \end{array}
                \end{array}
                
                Derivation
                1. Initial program 42.3%

                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
                  4. lower-neg.f6426.1

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
                6. Taylor expanded in g around inf

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

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

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

                    \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{h \cdot h}}{g}\right)} + \sqrt[3]{\frac{-g}{a}} \]
                  4. lower-*.f6472.6

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

                  \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-0.5 \cdot \frac{h \cdot h}{g}\right)}} + \sqrt[3]{\frac{-g}{a}} \]
                9. Taylor expanded in g around -inf

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

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

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

                    \[\leadsto \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                  4. lower-neg.f6415.3

                    \[\leadsto \sqrt[3]{\frac{\color{blue}{-g}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                11. Applied rewrites15.3%

                  \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                12. Add Preprocessing

                Alternative 12: 3.0% accurate, 1.4× speedup?

                \[\begin{array}{l} \\ \left(-\sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{0}{a}} \end{array} \]
                (FPCore (g h a) :precision binary64 (* (- (cbrt 0.5)) (cbrt (/ 0.0 a))))
                double code(double g, double h, double a) {
                	return -cbrt(0.5) * cbrt((0.0 / a));
                }
                
                public static double code(double g, double h, double a) {
                	return -Math.cbrt(0.5) * Math.cbrt((0.0 / a));
                }
                
                function code(g, h, a)
                	return Float64(Float64(-cbrt(0.5)) * cbrt(Float64(0.0 / a)))
                end
                
                code[g_, h_, a_] := N[((-N[Power[0.5, 1/3], $MachinePrecision]) * N[Power[N[(0.0 / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(-\sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{0}{a}}
                \end{array}
                
                Derivation
                1. Initial program 42.3%

                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt[3]{{a}^{-1}} \cdot \sqrt[3]{\left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right) \cdot \color{blue}{\frac{1}{2}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                4. Applied rewrites47.9%

                  \[\leadsto \color{blue}{\sqrt[3]{{a}^{-1}} \cdot \sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot 0.5}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                5. Taylor expanded in g around -inf

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

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

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

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

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

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

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

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

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

                    \[\leadsto -\sqrt[3]{\frac{\color{blue}{0}}{a}} \cdot \sqrt[3]{\frac{1}{2}} \]
                  10. mul0-lftN/A

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

                    \[\leadsto -\sqrt[3]{\frac{\color{blue}{\left(-1 + 1\right)} \cdot h}{a}} \cdot \sqrt[3]{\frac{1}{2}} \]
                  12. distribute-rgt1-inN/A

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

                    \[\leadsto -\color{blue}{\sqrt[3]{\frac{h + -1 \cdot h}{a}}} \cdot \sqrt[3]{\frac{1}{2}} \]
                  14. distribute-rgt1-inN/A

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

                    \[\leadsto -\sqrt[3]{\frac{\color{blue}{0} \cdot h}{a}} \cdot \sqrt[3]{\frac{1}{2}} \]
                  16. mul0-lftN/A

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

                    \[\leadsto -\sqrt[3]{\color{blue}{\frac{0}{a}}} \cdot \sqrt[3]{\frac{1}{2}} \]
                  18. lower-cbrt.f642.9

                    \[\leadsto -\sqrt[3]{\frac{0}{a}} \cdot \color{blue}{\sqrt[3]{0.5}} \]
                7. Applied rewrites2.9%

                  \[\leadsto \color{blue}{-\sqrt[3]{\frac{0}{a}} \cdot \sqrt[3]{0.5}} \]
                8. Final simplification2.9%

                  \[\leadsto \left(-\sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{0}{a}} \]
                9. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2024267 
                (FPCore (g h a)
                  :name "2-ancestry mixing, positive discriminant"
                  :precision binary64
                  (+ (cbrt (* (/ 1.0 (* 2.0 a)) (+ (- g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1.0 (* 2.0 a)) (- (- g) (sqrt (- (* g g) (* h h))))))))