2-ancestry mixing, positive discriminant

Percentage Accurate: 44.0% → 97.0%
Time: 17.1s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 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: 97.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \mathsf{fma}\left(\sqrt[3]{g}, \sqrt[3]{-1} \cdot \sqrt[3]{2}, \sqrt[3]{\mathsf{fma}\left(-0.5, h \cdot \frac{h}{g}, \frac{0.5 \cdot \left(h \cdot \left(g - g\right)\right)}{g}\right)}\right) \end{array} \]
(FPCore (g h a)
 :precision binary64
 (*
  (* (cbrt (/ 1.0 a)) (cbrt 0.5))
  (fma
   (cbrt g)
   (* (cbrt -1.0) (cbrt 2.0))
   (cbrt (fma -0.5 (* h (/ h g)) (/ (* 0.5 (* h (- g g))) g))))))
double code(double g, double h, double a) {
	return (cbrt((1.0 / a)) * cbrt(0.5)) * fma(cbrt(g), (cbrt(-1.0) * cbrt(2.0)), cbrt(fma(-0.5, (h * (h / g)), ((0.5 * (h * (g - g))) / g))));
}
function code(g, h, a)
	return Float64(Float64(cbrt(Float64(1.0 / a)) * cbrt(0.5)) * fma(cbrt(g), Float64(cbrt(-1.0) * cbrt(2.0)), cbrt(fma(-0.5, Float64(h * Float64(h / g)), Float64(Float64(0.5 * Float64(h * Float64(g - g))) / g)))))
end
code[g_, h_, a_] := N[(N[(N[Power[N[(1.0 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[0.5, 1/3], $MachinePrecision]), $MachinePrecision] * N[(N[Power[g, 1/3], $MachinePrecision] * N[(N[Power[-1.0, 1/3], $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision]), $MachinePrecision] + N[Power[N[(-0.5 * N[(h * N[(h / g), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(h * N[(g - g), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \mathsf{fma}\left(\sqrt[3]{g}, \sqrt[3]{-1} \cdot \sqrt[3]{2}, \sqrt[3]{\mathsf{fma}\left(-0.5, h \cdot \frac{h}{g}, \frac{0.5 \cdot \left(h \cdot \left(g - g\right)\right)}{g}\right)}\right)
\end{array}
Derivation
  1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)}} \]
  4. Step-by-step derivation
    1. associate-*r/N/A

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

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

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{\frac{-1}{2} \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
    5. lower-*.f6431.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{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
  5. Applied rewrites31.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{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} \]
  6. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \mathsf{fma}\left(\sqrt[3]{g}, \sqrt[3]{-1} \cdot \sqrt[3]{2}, \sqrt[3]{\mathsf{fma}\left(-0.5, h \cdot \frac{h}{g}, \frac{0.5 \cdot \left(h \cdot \left(g + \left(-g\right)\right)\right)}{g}\right)}\right) \]
    2. Final simplification97.3%

      \[\leadsto \left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{0.5}\right) \cdot \mathsf{fma}\left(\sqrt[3]{g}, \sqrt[3]{-1} \cdot \sqrt[3]{2}, \sqrt[3]{\mathsf{fma}\left(-0.5, h \cdot \frac{h}{g}, \frac{0.5 \cdot \left(h \cdot \left(g - g\right)\right)}{g}\right)}\right) \]
    3. Add Preprocessing

    Alternative 2: 93.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \cdot h \leq 2 \cdot 10^{+300}:\\ \;\;\;\;\sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \left(h \cdot h\right)}{g}} + \frac{\sqrt[3]{g + g}}{\sqrt[3]{a \cdot -2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{g} \cdot \left(\sqrt[3]{-1} \cdot \sqrt[3]{2}\right)\right)\\ \end{array} \end{array} \]
    (FPCore (g h a)
     :precision binary64
     (if (<= (* h h) 2e+300)
       (+
        (cbrt (* (/ 1.0 (* 2.0 a)) (/ (* -0.5 (* h h)) g)))
        (/ (cbrt (+ g g)) (cbrt (* a -2.0))))
       (*
        (pow (* 2.0 a) -0.3333333333333333)
        (* (cbrt g) (* (cbrt -1.0) (cbrt 2.0))))))
    double code(double g, double h, double a) {
    	double tmp;
    	if ((h * h) <= 2e+300) {
    		tmp = cbrt(((1.0 / (2.0 * a)) * ((-0.5 * (h * h)) / g))) + (cbrt((g + g)) / cbrt((a * -2.0)));
    	} else {
    		tmp = pow((2.0 * a), -0.3333333333333333) * (cbrt(g) * (cbrt(-1.0) * cbrt(2.0)));
    	}
    	return tmp;
    }
    
    public static double code(double g, double h, double a) {
    	double tmp;
    	if ((h * h) <= 2e+300) {
    		tmp = Math.cbrt(((1.0 / (2.0 * a)) * ((-0.5 * (h * h)) / g))) + (Math.cbrt((g + g)) / Math.cbrt((a * -2.0)));
    	} else {
    		tmp = Math.pow((2.0 * a), -0.3333333333333333) * (Math.cbrt(g) * (Math.cbrt(-1.0) * Math.cbrt(2.0)));
    	}
    	return tmp;
    }
    
    function code(g, h, a)
    	tmp = 0.0
    	if (Float64(h * h) <= 2e+300)
    		tmp = Float64(cbrt(Float64(Float64(1.0 / Float64(2.0 * a)) * Float64(Float64(-0.5 * Float64(h * h)) / g))) + Float64(cbrt(Float64(g + g)) / cbrt(Float64(a * -2.0))));
    	else
    		tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * Float64(cbrt(g) * Float64(cbrt(-1.0) * cbrt(2.0))));
    	end
    	return tmp
    end
    
    code[g_, h_, a_] := If[LessEqual[N[(h * h), $MachinePrecision], 2e+300], N[(N[Power[N[(N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(h * h), $MachinePrecision]), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(g + g), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(a * -2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[(N[Power[g, 1/3], $MachinePrecision] * N[(N[Power[-1.0, 1/3], $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;h \cdot h \leq 2 \cdot 10^{+300}:\\
    \;\;\;\;\sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \left(h \cdot h\right)}{g}} + \frac{\sqrt[3]{g + g}}{\sqrt[3]{a \cdot -2}}\\
    
    \mathbf{else}:\\
    \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{g} \cdot \left(\sqrt[3]{-1} \cdot \sqrt[3]{2}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 h h) < 2.0000000000000001e300

      1. Initial program 50.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 \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) - \sqrt{g \cdot g - h \cdot h}\right)}} \]
        2. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\frac{\sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot -2}}} \]
      5. 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)}} + \frac{\sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot -2}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.0000000000000001e300 < (*.f64 h h)

      1. Initial program 0.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)}} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{\frac{-1}{2} \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
        5. lower-*.f640.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{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
      5. Applied rewrites0.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{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} \]
      6. Step-by-step derivation
        1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{g} \cdot \left(\sqrt[3]{-1} \cdot \color{blue}{\sqrt[3]{2}}\right)\right) \]
      10. Applied rewrites65.7%

        \[\leadsto {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \color{blue}{\left(\sqrt[3]{g} \cdot \left(\sqrt[3]{-1} \cdot \sqrt[3]{2}\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification94.8%

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

    Alternative 3: 94.5% accurate, 0.8× speedup?

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

      1. Initial program 50.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 \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) - \sqrt{g \cdot g - h \cdot h}\right)}} \]
        2. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\frac{\sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot -2}}} \]
      5. 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)}} + \frac{\sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot -2}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.9999999999999998e293 < (*.f64 h h)

      1. Initial program 0.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\mathsf{neg}\left(\frac{g}{a}\right)}} \]
        3. lower-/.f640.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}}} \]
      5. Applied rewrites0.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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(h \cdot -0.5\right) \cdot \color{blue}{\frac{h}{g}}\right)} + \sqrt[3]{-\frac{g}{a}} \]
      10. Recombined 2 regimes into one program.
      11. Final simplification94.0%

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

      Alternative 4: 82.1% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{2 \cdot a}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+61}:\\ \;\;\;\;\sqrt[3]{t\_0 \cdot \left(\frac{h}{g} \cdot \left(h \cdot -0.5\right)\right)} + \sqrt[3]{\frac{g}{-a}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{\mathsf{fma}\left(h \cdot h, \frac{-0.5}{g}, h \cdot 0\right)} + \sqrt[3]{g \cdot -2}\right)\\ \end{array} \end{array} \]
      (FPCore (g h a)
       :precision binary64
       (let* ((t_0 (/ 1.0 (* 2.0 a))))
         (if (<= t_0 5e+61)
           (+ (cbrt (* t_0 (* (/ h g) (* h -0.5)))) (cbrt (/ g (- a))))
           (*
            (pow (* 2.0 a) -0.3333333333333333)
            (+ (cbrt (fma (* h h) (/ -0.5 g) (* h 0.0))) (cbrt (* g -2.0)))))))
      double code(double g, double h, double a) {
      	double t_0 = 1.0 / (2.0 * a);
      	double tmp;
      	if (t_0 <= 5e+61) {
      		tmp = cbrt((t_0 * ((h / g) * (h * -0.5)))) + cbrt((g / -a));
      	} else {
      		tmp = pow((2.0 * a), -0.3333333333333333) * (cbrt(fma((h * h), (-0.5 / g), (h * 0.0))) + cbrt((g * -2.0)));
      	}
      	return tmp;
      }
      
      function code(g, h, a)
      	t_0 = Float64(1.0 / Float64(2.0 * a))
      	tmp = 0.0
      	if (t_0 <= 5e+61)
      		tmp = Float64(cbrt(Float64(t_0 * Float64(Float64(h / g) * Float64(h * -0.5)))) + cbrt(Float64(g / Float64(-a))));
      	else
      		tmp = Float64((Float64(2.0 * a) ^ -0.3333333333333333) * Float64(cbrt(fma(Float64(h * h), Float64(-0.5 / g), Float64(h * 0.0))) + cbrt(Float64(g * -2.0))));
      	end
      	return tmp
      end
      
      code[g_, h_, a_] := Block[{t$95$0 = N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+61], N[(N[Power[N[(t$95$0 * N[(N[(h / g), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * N[(N[Power[N[(N[(h * h), $MachinePrecision] * N[(-0.5 / g), $MachinePrecision] + N[(h * 0.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(g * -2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{1}{2 \cdot a}\\
      \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+61}:\\
      \;\;\;\;\sqrt[3]{t\_0 \cdot \left(\frac{h}{g} \cdot \left(h \cdot -0.5\right)\right)} + \sqrt[3]{\frac{g}{-a}}\\
      
      \mathbf{else}:\\
      \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{\mathsf{fma}\left(h \cdot h, \frac{-0.5}{g}, h \cdot 0\right)} + \sqrt[3]{g \cdot -2}\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < 5.00000000000000018e61

        1. Initial program 50.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. Taylor expanded in g around inf

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

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

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

            \[\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}}} \]
        5. Applied rewrites27.3%

          \[\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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} + \sqrt[3]{-\frac{g}{a}} \]
        9. Step-by-step derivation
          1. Applied rewrites84.6%

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

          if 5.00000000000000018e61 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 39.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)}} \]
          4. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{\frac{-1}{2} \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
            5. lower-*.f6427.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{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
          5. Applied rewrites27.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{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} \]
          6. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(h \cdot h, \frac{-0.5}{g}, h \cdot 0\right)} + \sqrt[3]{g \cdot -2}\right) \cdot {\left(2 \cdot a\right)}^{-0.3333333333333333}} \]
          12. Recombined 2 regimes into one program.
          13. Final simplification84.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{2 \cdot a} \leq 5 \cdot 10^{+61}:\\ \;\;\;\;\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{h}{g} \cdot \left(h \cdot -0.5\right)\right)} + \sqrt[3]{\frac{g}{-a}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(\sqrt[3]{\mathsf{fma}\left(h \cdot h, \frac{-0.5}{g}, h \cdot 0\right)} + \sqrt[3]{g \cdot -2}\right)\\ \end{array} \]
          14. Add Preprocessing

          Alternative 5: 75.7% accurate, 1.2× speedup?

          \[\begin{array}{l} \\ \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{h}{g} \cdot \left(h \cdot -0.5\right)\right)} + \sqrt[3]{\frac{g}{-a}} \end{array} \]
          (FPCore (g h a)
           :precision binary64
           (+ (cbrt (* (/ 1.0 (* 2.0 a)) (* (/ h g) (* h -0.5)))) (cbrt (/ g (- a)))))
          double code(double g, double h, double a) {
          	return cbrt(((1.0 / (2.0 * a)) * ((h / g) * (h * -0.5)))) + cbrt((g / -a));
          }
          
          public static double code(double g, double h, double a) {
          	return Math.cbrt(((1.0 / (2.0 * a)) * ((h / g) * (h * -0.5)))) + Math.cbrt((g / -a));
          }
          
          function code(g, h, a)
          	return Float64(cbrt(Float64(Float64(1.0 / Float64(2.0 * a)) * Float64(Float64(h / g) * Float64(h * -0.5)))) + cbrt(Float64(g / Float64(-a))))
          end
          
          code[g_, h_, a_] := N[(N[Power[N[(N[(1.0 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * N[(N[(h / g), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\frac{h}{g} \cdot \left(h \cdot -0.5\right)\right)} + \sqrt[3]{\frac{g}{-a}}
          \end{array}
          
          Derivation
          1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\mathsf{neg}\left(\frac{g}{a}\right)}} \]
            3. lower-/.f6425.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}}} \]
          5. Applied rewrites25.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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
          7. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

            \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} + \sqrt[3]{-\frac{g}{a}} \]
          9. Step-by-step derivation
            1. Applied rewrites75.7%

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

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

            Alternative 6: 72.2% accurate, 1.2× speedup?

            \[\begin{array}{l} \\ \sqrt[3]{\frac{g}{-a}} + \sqrt[3]{\frac{0.5 \cdot \frac{-0.5 \cdot \left(h \cdot h\right)}{g}}{a}} \end{array} \]
            (FPCore (g h a)
             :precision binary64
             (+ (cbrt (/ g (- a))) (cbrt (/ (* 0.5 (/ (* -0.5 (* h h)) g)) a))))
            double code(double g, double h, double a) {
            	return cbrt((g / -a)) + cbrt(((0.5 * ((-0.5 * (h * h)) / g)) / a));
            }
            
            public static double code(double g, double h, double a) {
            	return Math.cbrt((g / -a)) + Math.cbrt(((0.5 * ((-0.5 * (h * h)) / g)) / a));
            }
            
            function code(g, h, a)
            	return Float64(cbrt(Float64(g / Float64(-a))) + cbrt(Float64(Float64(0.5 * Float64(Float64(-0.5 * Float64(h * h)) / g)) / a)))
            end
            
            code[g_, h_, a_] := N[(N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.5 * N[(N[(-0.5 * N[(h * h), $MachinePrecision]), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \sqrt[3]{\frac{g}{-a}} + \sqrt[3]{\frac{0.5 \cdot \frac{-0.5 \cdot \left(h \cdot h\right)}{g}}{a}}
            \end{array}
            
            Derivation
            1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\mathsf{neg}\left(\frac{g}{a}\right)}} \]
              3. lower-/.f6425.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}}} \]
            5. Applied rewrites25.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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
            7. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} + \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 \frac{\frac{-1}{2} \cdot \left(h \cdot h\right)}{g}}} + \sqrt[3]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
              2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

            Alternative 7: 68.7% accurate, 1.2× speedup?

            \[\begin{array}{l} \\ \sqrt[3]{\frac{g}{-a}} + \sqrt[3]{\frac{\left(h \cdot h\right) \cdot -0.25}{a \cdot g}} \end{array} \]
            (FPCore (g h a)
             :precision binary64
             (+ (cbrt (/ g (- a))) (cbrt (/ (* (* h h) -0.25) (* a g)))))
            double code(double g, double h, double a) {
            	return cbrt((g / -a)) + cbrt((((h * h) * -0.25) / (a * g)));
            }
            
            public static double code(double g, double h, double a) {
            	return Math.cbrt((g / -a)) + Math.cbrt((((h * h) * -0.25) / (a * g)));
            }
            
            function code(g, h, a)
            	return Float64(cbrt(Float64(g / Float64(-a))) + cbrt(Float64(Float64(Float64(h * h) * -0.25) / Float64(a * g))))
            end
            
            code[g_, h_, a_] := N[(N[Power[N[(g / (-a)), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(N[(h * h), $MachinePrecision] * -0.25), $MachinePrecision] / N[(a * g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \sqrt[3]{\frac{g}{-a}} + \sqrt[3]{\frac{\left(h \cdot h\right) \cdot -0.25}{a \cdot g}}
            \end{array}
            
            Derivation
            1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\mathsf{neg}\left(\frac{g}{a}\right)}} \]
              3. lower-/.f6425.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}}} \]
            5. Applied rewrites25.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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
            7. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} + \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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
            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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
              2. lower-/.f64N/A

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

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

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

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

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

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

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

            Alternative 8: 15.4% 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(g / Float64(-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 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\mathsf{neg}\left(\frac{g}{a}\right)}} \]
              3. lower-/.f6425.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}}} \]
            5. Applied rewrites25.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]{\mathsf{neg}\left(\frac{g}{a}\right)} \]
            7. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{a}}} + \sqrt[3]{-\frac{g}{a}} \]
            12. Final simplification15.4%

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

            Alternative 9: 2.9% accurate, 1.3× speedup?

            \[\begin{array}{l} \\ \sqrt[3]{\frac{g \cdot 0}{a}} \cdot \left(-\sqrt[3]{0.5}\right) \end{array} \]
            (FPCore (g h a) :precision binary64 (* (cbrt (/ (* g 0.0) a)) (- (cbrt 0.5))))
            double code(double g, double h, double a) {
            	return cbrt(((g * 0.0) / a)) * -cbrt(0.5);
            }
            
            public static double code(double g, double h, double a) {
            	return Math.cbrt(((g * 0.0) / a)) * -Math.cbrt(0.5);
            }
            
            function code(g, h, a)
            	return Float64(cbrt(Float64(Float64(g * 0.0) / a)) * Float64(-cbrt(0.5)))
            end
            
            code[g_, h_, a_] := N[(N[Power[N[(N[(g * 0.0), $MachinePrecision] / a), $MachinePrecision], 1/3], $MachinePrecision] * (-N[Power[0.5, 1/3], $MachinePrecision])), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \sqrt[3]{\frac{g \cdot 0}{a}} \cdot \left(-\sqrt[3]{0.5}\right)
            \end{array}
            
            Derivation
            1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)}} \]
            4. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{\frac{-1}{2} \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
              5. lower-*.f6431.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{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
            5. Applied rewrites31.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{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\mathsf{fma}\left(\sqrt{g - h}, \sqrt{g + h}, -g\right)}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \left(h \cdot h\right)}{g}} \]
            8. 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)} \]
            9. 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}{\mathsf{neg}\left(\sqrt[3]{\frac{g \cdot \left(1 + {\left(\sqrt{-1}\right)}^{2}\right)}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
              3. lower-*.f64N/A

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

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

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

            Alternative 10: 1.5% accurate, 2.7× speedup?

            \[\begin{array}{l} \\ {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot 0 \end{array} \]
            (FPCore (g h a)
             :precision binary64
             (* (pow (* 2.0 a) -0.3333333333333333) 0.0))
            double code(double g, double h, double a) {
            	return pow((2.0 * a), -0.3333333333333333) * 0.0;
            }
            
            real(8) function code(g, h, a)
                real(8), intent (in) :: g
                real(8), intent (in) :: h
                real(8), intent (in) :: a
                code = ((2.0d0 * a) ** (-0.3333333333333333d0)) * 0.0d0
            end function
            
            public static double code(double g, double h, double a) {
            	return Math.pow((2.0 * a), -0.3333333333333333) * 0.0;
            }
            
            def code(g, h, a):
            	return math.pow((2.0 * a), -0.3333333333333333) * 0.0
            
            function code(g, h, a)
            	return Float64((Float64(2.0 * a) ^ -0.3333333333333333) * 0.0)
            end
            
            function tmp = code(g, h, a)
            	tmp = ((2.0 * a) ^ -0.3333333333333333) * 0.0;
            end
            
            code[g_, h_, a_] := N[(N[Power[N[(2.0 * a), $MachinePrecision], -0.3333333333333333], $MachinePrecision] * 0.0), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot 0
            \end{array}
            
            Derivation
            1. Initial program 48.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(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\frac{-1}{2} \cdot \frac{{h}^{2}}{g}\right)}} \]
            4. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

                \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(\mathsf{neg}\left(g\right)\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \frac{\frac{-1}{2} \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
              5. lower-*.f6431.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{1}{2 \cdot a} \cdot \frac{-0.5 \cdot \color{blue}{\left(h \cdot h\right)}}{g}} \]
            5. Applied rewrites31.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{1}{2 \cdot a} \cdot \color{blue}{\frac{-0.5 \cdot \left(h \cdot h\right)}{g}}} \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \left(-\sqrt[3]{\color{blue}{g \cdot 0}}\right) \]
            10. Applied rewrites1.6%

              \[\leadsto {\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot \color{blue}{\left(-\sqrt[3]{g \cdot 0}\right)} \]
            11. Step-by-step derivation
              1. Applied rewrites1.6%

                \[\leadsto \color{blue}{{\left(2 \cdot a\right)}^{-0.3333333333333333} \cdot 0} \]
              2. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2024231 
              (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))))))))