2-ancestry mixing, positive discriminant

Percentage Accurate: 44.3% → 93.9%
Time: 12.1s
Alternatives: 9
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 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.3% 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: 93.9% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000013e139 < g

    1. Initial program 5.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. Step-by-step derivation
      1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot h\right) \cdot \left(0 \cdot h\right)\right)}{a}}\right) \]
      9. distribute-rgt1-inN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\frac{1}{4} \cdot \left(\left(\color{blue}{0} \cdot h\right) \cdot \left(h + -1 \cdot h\right)\right)}{a}}\right) \]
      16. distribute-rgt1-inN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\color{blue}{0}}{a}}\right) \]
      22. lower-/.f6498.8

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{0.5}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\color{blue}{\frac{0}{a}}}\right) \]
    11. Applied rewrites98.8%

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

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

Alternative 2: 86.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;g \leq -2 \cdot 10^{-293}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, \sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}, \sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}}\right)\\

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


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

    1. Initial program 7.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.f644.8

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

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

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

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

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

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

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

      if -6.10000000000000004e137 < g < -2.0000000000000001e-293

      1. Initial program 80.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 \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.f6416.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.0000000000000001e-293 < g

      1. Initial program 45.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. Step-by-step derivation
        1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 85.0% accurate, 0.8× speedup?

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

      1. Initial program 46.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.f6411.5

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

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

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

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

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

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

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

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

      if 1.14999999999999995e-181 < g

      1. Initial program 46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot h\right) \cdot \left(0 \cdot h\right)\right)}{a}}\right) \]
        9. distribute-rgt1-inN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\frac{1}{4} \cdot \left(\left(\color{blue}{0} \cdot h\right) \cdot \left(h + -1 \cdot h\right)\right)}{a}}\right) \]
        16. distribute-rgt1-inN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{1}{2}}{a}}, \sqrt[3]{-\mathsf{fma}\left(\sqrt{h + g}, \sqrt{g - h}, g\right)}, \sqrt[3]{\frac{\color{blue}{0}}{a}}\right) \]
        22. lower-/.f6496.6

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

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

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

    Alternative 4: 75.1% accurate, 0.9× speedup?

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

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

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

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

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

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

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

      \[\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.f6475.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 rewrites75.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-+.f6475.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 rewrites75.5%

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

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

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

    Alternative 5: 75.0% accurate, 0.9× speedup?

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

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

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

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

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

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

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

      \[\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.f6475.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 rewrites75.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-+.f6475.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 rewrites75.5%

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

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

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

      Alternative 6: 74.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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

        \[\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.f6475.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 rewrites75.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-+.f6475.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 rewrites75.5%

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

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

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

        Alternative 7: 75.0% accurate, 1.2× speedup?

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

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

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

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

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

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

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

          \[\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.f6475.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 rewrites75.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-+.f6475.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 rewrites75.5%

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

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

        Alternative 8: 71.5% accurate, 1.2× speedup?

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

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

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

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

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

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

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

          \[\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.f6475.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 rewrites75.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-+.f6475.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 rewrites75.5%

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

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

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

          Alternative 9: 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 46.5%

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

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

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

              \[\leadsto \color{blue}{\sqrt[3]{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}} \cdot \sqrt[3]{\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. pow1/3N/A

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

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

              \[\leadsto {\left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)}^{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{\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)} \]
            8. associate-/r*N/A

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{{\left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)}^{\frac{1}{3}} \cdot {\frac{1}{2}}^{\frac{1}{3}}}{\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 rewrites49.5%

            \[\leadsto \color{blue}{\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g} \cdot \sqrt[3]{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. +-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}} \]
            7. 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}} \]
            8. rem-square-sqrtN/A

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

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

              \[\leadsto -\sqrt[3]{\frac{\color{blue}{g \cdot 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. Step-by-step derivation
            1. Applied rewrites3.0%

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

            Reproduce

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