2-ancestry mixing, positive discriminant

Percentage Accurate: 42.8% → 96.6%
Time: 12.7s
Alternatives: 7
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 7 alternatives:

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

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

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{2 \cdot a}\\
t_1 := \frac{h}{g} \cdot \left(-0.5 \cdot h\right)\\
\mathbf{if}\;g \leq 1.6 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, -\sqrt[3]{2 \cdot g}, \sqrt[3]{t\_1 \cdot \frac{0.5}{a}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{-\mathsf{fma}\left(\sqrt{g - h}, \sqrt{h + g}, g\right)}, t\_0, \sqrt[3]{t\_1} \cdot t\_0\right)}{t\_0 \cdot t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if g < 1.6000000000000001e168

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, -\sqrt[3]{g \cdot \color{blue}{2}}, \sqrt[3]{\left(\left(\frac{-1}{2} \cdot h\right) \cdot \frac{h}{g}\right) \cdot \frac{\frac{1}{2}}{a}}\right) \]
      7. lower-*.f6496.2

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

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

    if 1.6000000000000001e168 < g

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt[3]{-\mathsf{fma}\left(\sqrt{g - h}, \sqrt{h + g}, g\right)}, \sqrt[3]{a \cdot 2}, \sqrt[3]{a \cdot 2} \cdot \sqrt[3]{\left(-0.5 \cdot h\right) \cdot \frac{h}{g}}\right)}{\sqrt[3]{a \cdot 2} \cdot \sqrt[3]{a \cdot 2}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.2%

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

Alternative 2: 96.5% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{t\_0} + \sqrt[3]{-\mathsf{fma}\left(\sqrt{g - h}, \sqrt{h + g}, g\right)}\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if g < 2.99999999999999982e186

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, -\sqrt[3]{g \cdot \color{blue}{2}}, \sqrt[3]{\left(\left(\frac{-1}{2} \cdot h\right) \cdot \frac{h}{g}\right) \cdot \frac{\frac{1}{2}}{a}}\right) \]
      7. lower-*.f6496.3

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

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

    if 2.99999999999999982e186 < g

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\frac{0.5}{a}} \cdot \left(\sqrt[3]{-\mathsf{fma}\left(\sqrt{g - h}, \sqrt{h + g}, g\right)} + \sqrt[3]{\left(-0.5 \cdot h\right) \cdot \frac{h}{g}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

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

Alternative 3: 95.8% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 92.5% accurate, 0.9× speedup?

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

      1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{-0.25}{a} \cdot \frac{\color{blue}{h \cdot h}}{g}} + \frac{\sqrt[3]{-g}}{\sqrt[3]{a}} \]
      13. Applied rewrites93.8%

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\color{blue}{\frac{\mathsf{neg}\left(g\right)}{a}}} \]
        4. lower-neg.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{\color{blue}{-g}}{a}} \]
      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]{\color{blue}{\frac{-g}{a}}} \]
      6. Taylor expanded in g around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 74.6% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 15.2% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 2.9% accurate, 302.0× speedup?

    \[\begin{array}{l} \\ 0 \end{array} \]
    (FPCore (g h a) :precision binary64 0.0)
    double code(double g, double h, double a) {
    	return 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 = 0.0d0
    end function
    
    public static double code(double g, double h, double a) {
    	return 0.0;
    }
    
    def code(g, h, a):
    	return 0.0
    
    function code(g, h, a)
    	return 0.0
    end
    
    function tmp = code(g, h, a)
    	tmp = 0.0;
    end
    
    code[g_, h_, a_] := 0.0
    
    \begin{array}{l}
    
    \\
    0
    \end{array}
    
    Derivation
    1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\sqrt[3]{\frac{1}{2}}\right) \cdot \sqrt[3]{\frac{\color{blue}{0}}{a}} \]
      20. lower-/.f643.0

        \[\leadsto \left(-\sqrt[3]{0.5}\right) \cdot \sqrt[3]{\color{blue}{\frac{0}{a}}} \]
    7. Applied rewrites3.0%

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

      \[\leadsto 0 \]
    9. Step-by-step derivation
      1. Applied rewrites3.0%

        \[\leadsto 0 \]
      2. Add Preprocessing

      Reproduce

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