2-ancestry mixing, positive discriminant

Percentage Accurate: 44.4% → 85.2%
Time: 14.9s
Alternatives: 8
Speedup: 1.4×

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 8 alternatives:

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

Initial Program: 44.4% 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: 85.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;g \leq -5 \cdot 10^{-281}:\\ \;\;\;\;\sqrt[3]{\frac{-g}{a}} + {\left(\sqrt[3]{a}\right)}^{-1} \cdot {\left(-0.25 \cdot \left(\frac{h}{g} \cdot h\right)\right)}^{0.3333333333333333}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}}{\sqrt[3]{a \cdot 2}} + \frac{1}{\sqrt[3]{\frac{-2 \cdot a}{0 \cdot g}}}\\ \end{array} \end{array} \]
(FPCore (g h a)
 :precision binary64
 (if (<= g -5e-281)
   (+
    (cbrt (/ (- g) a))
    (* (pow (cbrt a) -1.0) (pow (* -0.25 (* (/ h g) h)) 0.3333333333333333)))
   (+
    (/ (cbrt (- (fma (sqrt (+ h g)) (sqrt (- g h)) g))) (cbrt (* a 2.0)))
    (/ 1.0 (cbrt (/ (* -2.0 a) (* 0.0 g)))))))
double code(double g, double h, double a) {
	double tmp;
	if (g <= -5e-281) {
		tmp = cbrt((-g / a)) + (pow(cbrt(a), -1.0) * pow((-0.25 * ((h / g) * h)), 0.3333333333333333));
	} else {
		tmp = (cbrt(-fma(sqrt((h + g)), sqrt((g - h)), g)) / cbrt((a * 2.0))) + (1.0 / cbrt(((-2.0 * a) / (0.0 * g))));
	}
	return tmp;
}
function code(g, h, a)
	tmp = 0.0
	if (g <= -5e-281)
		tmp = Float64(cbrt(Float64(Float64(-g) / a)) + Float64((cbrt(a) ^ -1.0) * (Float64(-0.25 * Float64(Float64(h / g) * h)) ^ 0.3333333333333333)));
	else
		tmp = Float64(Float64(cbrt(Float64(-fma(sqrt(Float64(h + g)), sqrt(Float64(g - h)), g))) / cbrt(Float64(a * 2.0))) + Float64(1.0 / cbrt(Float64(Float64(-2.0 * a) / Float64(0.0 * g)))));
	end
	return tmp
end
code[g_, h_, a_] := If[LessEqual[g, -5e-281], N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[Power[a, 1/3], $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(-0.25 * N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[(-N[(N[Sqrt[N[(h + g), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(g - h), $MachinePrecision]], $MachinePrecision] + g), $MachinePrecision]), 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Power[N[(N[(-2.0 * a), $MachinePrecision] / N[(0.0 * g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;g \leq -5 \cdot 10^{-281}:\\
\;\;\;\;\sqrt[3]{\frac{-g}{a}} + {\left(\sqrt[3]{a}\right)}^{-1} \cdot {\left(-0.25 \cdot \left(\frac{h}{g} \cdot h\right)\right)}^{0.3333333333333333}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}}{\sqrt[3]{a \cdot 2}} + \frac{1}{\sqrt[3]{\frac{-2 \cdot a}{0 \cdot g}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if g < -4.9999999999999998e-281

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{-0.25}{a}} \cdot \color{blue}{\sqrt[3]{\frac{h}{g} \cdot h}} + \sqrt[3]{\frac{-g}{a}} \]
      2. Step-by-step derivation
        1. Applied rewrites71.7%

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

        if -4.9999999999999998e-281 < g

        1. Initial program 47.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. Applied rewrites47.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 85.2% accurate, 0.8× speedup?

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

        1. Initial program 44.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 9.59999999999999959e-279 < g

          1. Initial program 47.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. Applied rewrites47.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 75.2% accurate, 0.8× speedup?

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

          1. Initial program 47.6%

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
          5. Applied rewrites30.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 \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. times-fracN/A

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

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

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

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

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

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

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

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

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

            if 5e176 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

            1. Initial program 30.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. Applied rewrites33.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 75.3% accurate, 0.9× speedup?

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

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

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

            \[\leadsto \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. times-fracN/A

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{-0.25}{a}} \cdot \color{blue}{\sqrt[3]{\frac{h}{g} \cdot h}} + \sqrt[3]{\frac{-g}{a}} \]
            2. Final simplification73.7%

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

            Alternative 5: 75.3% accurate, 0.9× speedup?

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

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

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

              \[\leadsto \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. times-fracN/A

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

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

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

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

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

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

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

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

                \[\leadsto \sqrt[3]{h} \cdot \color{blue}{\sqrt[3]{\frac{h}{g} \cdot \frac{-0.25}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
              2. Final simplification73.7%

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

              Alternative 6: 75.2% accurate, 1.2× speedup?

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

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

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

                \[\leadsto \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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 73.6% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ \sqrt[3]{-1} \cdot \sqrt[3]{\frac{g}{a}} \end{array} \]
              (FPCore (g h a) :precision binary64 (* (cbrt -1.0) (cbrt (/ g a))))
              double code(double g, double h, double a) {
              	return cbrt(-1.0) * cbrt((g / a));
              }
              
              public static double code(double g, double h, double a) {
              	return Math.cbrt(-1.0) * Math.cbrt((g / a));
              }
              
              function code(g, h, a)
              	return Float64(cbrt(-1.0) * cbrt(Float64(g / a)))
              end
              
              code[g_, h_, a_] := N[(N[Power[-1.0, 1/3], $MachinePrecision] * N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \sqrt[3]{-1} \cdot \sqrt[3]{\frac{g}{a}}
              \end{array}
              
              Derivation
              1. Initial program 45.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. Applied rewrites46.1%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-1}} \]
              7. Step-by-step derivation
                1. lower-*.f64N/A

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

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

                  \[\leadsto \sqrt[3]{\color{blue}{\frac{g}{a}}} \cdot \sqrt[3]{-1} \]
                4. lower-cbrt.f6472.3

                  \[\leadsto \sqrt[3]{\frac{g}{a}} \cdot \color{blue}{\sqrt[3]{-1}} \]
              8. Applied rewrites72.3%

                \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-1}} \]
              9. Final simplification72.3%

                \[\leadsto \sqrt[3]{-1} \cdot \sqrt[3]{\frac{g}{a}} \]
              10. Add Preprocessing

              Alternative 8: 3.0% 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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{-\sqrt[3]{\frac{g \cdot 0}{a}} \cdot \sqrt[3]{0.5}} \]
              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 2024268 
                (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))))))))