2-ancestry mixing, positive discriminant

Percentage Accurate: 44.5% → 95.8%
Time: 10.9s
Alternatives: 6
Speedup: 2.6×

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 6 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.5% 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: 95.8% accurate, 0.8× speedup?

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

\\
\frac{\sqrt[3]{-g}}{\sqrt[3]{a}} + \sqrt[3]{\left(-0.5 \cdot \left(\frac{h}{g} \cdot h\right)\right) \cdot \frac{1}{a \cdot 2}}
\end{array}
Derivation
  1. Initial program 38.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-*.f6421.3

      \[\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 rewrites21.3%

    \[\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 rewrites25.3%

    \[\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.f6489.3

      \[\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 rewrites89.3%

    \[\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 rewrites95.6%

      \[\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 simplification95.6%

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

    Alternative 2: 93.2% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt[3]{-g}}{\sqrt[3]{a}}\\ \mathbf{if}\;h \cdot h \leq 5 \cdot 10^{-247}:\\ \;\;\;\;{\left(\frac{a \cdot 2}{\frac{h \cdot h}{g} \cdot -0.5}\right)}^{-0.3333333333333333} + t\_0\\ \mathbf{elif}\;h \cdot h \leq 4 \cdot 10^{+306}:\\ \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot a}} + t\_0\\ \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
     (let* ((t_0 (/ (cbrt (- g)) (cbrt a))))
       (if (<= (* h h) 5e-247)
         (+ (pow (/ (* a 2.0) (* (/ (* h h) g) -0.5)) -0.3333333333333333) t_0)
         (if (<= (* h h) 4e+306)
           (+ (cbrt (/ (* -0.25 (* h h)) (* g a))) t_0)
           (+ (cbrt (* (* (/ h a) (/ h g)) -0.25)) (cbrt (/ (- g) a)))))))
    double code(double g, double h, double a) {
    	double t_0 = cbrt(-g) / cbrt(a);
    	double tmp;
    	if ((h * h) <= 5e-247) {
    		tmp = pow(((a * 2.0) / (((h * h) / g) * -0.5)), -0.3333333333333333) + t_0;
    	} else if ((h * h) <= 4e+306) {
    		tmp = cbrt(((-0.25 * (h * h)) / (g * a))) + t_0;
    	} 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 t_0 = Math.cbrt(-g) / Math.cbrt(a);
    	double tmp;
    	if ((h * h) <= 5e-247) {
    		tmp = Math.pow(((a * 2.0) / (((h * h) / g) * -0.5)), -0.3333333333333333) + t_0;
    	} else if ((h * h) <= 4e+306) {
    		tmp = Math.cbrt(((-0.25 * (h * h)) / (g * a))) + t_0;
    	} else {
    		tmp = Math.cbrt((((h / a) * (h / g)) * -0.25)) + Math.cbrt((-g / a));
    	}
    	return tmp;
    }
    
    function code(g, h, a)
    	t_0 = Float64(cbrt(Float64(-g)) / cbrt(a))
    	tmp = 0.0
    	if (Float64(h * h) <= 5e-247)
    		tmp = Float64((Float64(Float64(a * 2.0) / Float64(Float64(Float64(h * h) / g) * -0.5)) ^ -0.3333333333333333) + t_0);
    	elseif (Float64(h * h) <= 4e+306)
    		tmp = Float64(cbrt(Float64(Float64(-0.25 * Float64(h * h)) / Float64(g * a))) + t_0);
    	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_] := Block[{t$95$0 = N[(N[Power[(-g), 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(h * h), $MachinePrecision], 5e-247], N[(N[Power[N[(N[(a * 2.0), $MachinePrecision] / N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], -0.3333333333333333], $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[N[(h * h), $MachinePrecision], 4e+306], N[(N[Power[N[(N[(-0.25 * N[(h * h), $MachinePrecision]), $MachinePrecision] / N[(g * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $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}
    t_0 := \frac{\sqrt[3]{-g}}{\sqrt[3]{a}}\\
    \mathbf{if}\;h \cdot h \leq 5 \cdot 10^{-247}:\\
    \;\;\;\;{\left(\frac{a \cdot 2}{\frac{h \cdot h}{g} \cdot -0.5}\right)}^{-0.3333333333333333} + t\_0\\
    
    \mathbf{elif}\;h \cdot h \leq 4 \cdot 10^{+306}:\\
    \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot a}} + t\_0\\
    
    \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 3 regimes
    2. if (*.f64 h h) < 4.99999999999999978e-247

      1. Initial program 47.8%

        \[\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-*.f6428.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 rewrites28.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-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 rewrites35.9%

        \[\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.f6498.0

          \[\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 rewrites98.0%

        \[\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. lift-cbrt.f64N/A

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

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

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

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

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

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

      if 4.99999999999999978e-247 < (*.f64 h h) < 4.00000000000000007e306

      1. Initial program 36.2%

        \[\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-*.f6417.1

          \[\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 rewrites17.1%

        \[\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 rewrites17.9%

        \[\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.f6497.4

          \[\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 rewrites97.4%

        \[\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. lower-/.f64N/A

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

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

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

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

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

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

      if 4.00000000000000007e306 < (*.f64 h h)

      1. Initial program 0.0%

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-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.f6445.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 rewrites45.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-+.f6445.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 rewrites45.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 3 regimes into one program.
    4. Final simplification92.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;h \cdot h \leq 5 \cdot 10^{-247}:\\ \;\;\;\;{\left(\frac{a \cdot 2}{\frac{h \cdot h}{g} \cdot -0.5}\right)}^{-0.3333333333333333} + \frac{\sqrt[3]{-g}}{\sqrt[3]{a}}\\ \mathbf{elif}\;h \cdot h \leq 4 \cdot 10^{+306}:\\ \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot 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 3: 91.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \cdot h \leq 4 \cdot 10^{+306}:\\ \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot 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 h) 4e+306)
       (+ (cbrt (/ (* -0.25 (* h h)) (* g 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 * h) <= 4e+306) {
    		tmp = cbrt(((-0.25 * (h * h)) / (g * 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 * h) <= 4e+306) {
    		tmp = Math.cbrt(((-0.25 * (h * h)) / (g * 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 (Float64(h * h) <= 4e+306)
    		tmp = Float64(cbrt(Float64(Float64(-0.25 * Float64(h * h)) / Float64(g * 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[N[(h * h), $MachinePrecision], 4e+306], N[(N[Power[N[(N[(-0.25 * N[(h * h), $MachinePrecision]), $MachinePrecision] / N[(g * 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 \cdot h \leq 4 \cdot 10^{+306}:\\
    \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot 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 (*.f64 h h) < 4.00000000000000007e306

      1. Initial program 42.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-*.f6423.4

          \[\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 rewrites23.4%

        \[\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 rewrites27.6%

        \[\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.f6497.7

          \[\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 rewrites97.7%

        \[\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. lower-/.f64N/A

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

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

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

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

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

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

      if 4.00000000000000007e306 < (*.f64 h h)

      1. Initial program 0.0%

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-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.f6445.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 rewrites45.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-+.f6445.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 rewrites45.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 simplification88.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;h \cdot h \leq 4 \cdot 10^{+306}:\\ \;\;\;\;\sqrt[3]{\frac{-0.25 \cdot \left(h \cdot h\right)}{g \cdot 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 4: 74.5% 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 38.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.f6423.7

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

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

      \[\leadsto \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.f6473.9

        \[\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 rewrites73.9%

      \[\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-+.f6473.9

        \[\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 rewrites73.9%

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

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

    Alternative 5: 72.9% accurate, 2.6× speedup?

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

        \[\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 rewrites21.3%

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

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

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{2 \cdot a}} \cdot \left(\frac{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)} \]
      4. associate-*l/N/A

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

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{\frac{2 \cdot a}{1 \cdot \left(\frac{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)} \]
      6. cbrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt[3]{1}}{\sqrt[3]{\frac{2 \cdot a}{1 \cdot \left(\frac{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)} \]
      7. metadata-evalN/A

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

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

        \[\leadsto \frac{1}{\color{blue}{\sqrt[3]{\frac{2 \cdot a}{1 \cdot \left(\frac{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)} \]
    7. Applied rewrites21.3%

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

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

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

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

        \[\leadsto -\color{blue}{\sqrt[3]{\frac{g}{a}}} \]
      4. lower-/.f6472.5

        \[\leadsto -\sqrt[3]{\color{blue}{\frac{g}{a}}} \]
    10. Applied rewrites72.5%

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

    Alternative 6: 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 38.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. Step-by-step derivation
      1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{neg}\left(\sqrt[3]{\frac{g \cdot \left(1 + {\left(\sqrt{-1}\right)}^{2}\right)}{a}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
      2. *-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}} \]
    7. Applied rewrites2.9%

      \[\leadsto \color{blue}{\left(-\sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{0}{a}}} \]
    8. Step-by-step derivation
      1. Applied rewrites2.9%

        \[\leadsto \color{blue}{0} \]
      2. Add Preprocessing

      Reproduce

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