2-ancestry mixing, positive discriminant

Percentage Accurate: 43.9% → 78.0%
Time: 14.1s
Alternatives: 7
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 43.9% 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: 78.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25}\\ \mathbf{if}\;g \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_0 + \sqrt[3]{{a}^{-1} \cdot \left(-g\right)}\\ \mathbf{elif}\;g \leq -3.4 \cdot 10^{-160}:\\ \;\;\;\;\sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}} + \frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{-g}{a}} + t\_0\\ \end{array} \end{array} \]
(FPCore (g h a)
 :precision binary64
 (let* ((t_0 (cbrt (* (* (/ h a) (/ h g)) -0.25))))
   (if (<= g -1.35e+154)
     (+ t_0 (cbrt (* (pow a -1.0) (- g))))
     (if (<= g -3.4e-160)
       (+
        (cbrt (* (/ (* h h) g) (/ -0.25 a)))
        (/ (cbrt (- (sqrt (* (+ h g) (- g h))) g)) (cbrt (* a 2.0))))
       (+ (cbrt (/ (- g) a)) t_0)))))
double code(double g, double h, double a) {
	double t_0 = cbrt((((h / a) * (h / g)) * -0.25));
	double tmp;
	if (g <= -1.35e+154) {
		tmp = t_0 + cbrt((pow(a, -1.0) * -g));
	} else if (g <= -3.4e-160) {
		tmp = cbrt((((h * h) / g) * (-0.25 / a))) + (cbrt((sqrt(((h + g) * (g - h))) - g)) / cbrt((a * 2.0)));
	} else {
		tmp = cbrt((-g / a)) + t_0;
	}
	return tmp;
}
public static double code(double g, double h, double a) {
	double t_0 = Math.cbrt((((h / a) * (h / g)) * -0.25));
	double tmp;
	if (g <= -1.35e+154) {
		tmp = t_0 + Math.cbrt((Math.pow(a, -1.0) * -g));
	} else if (g <= -3.4e-160) {
		tmp = Math.cbrt((((h * h) / g) * (-0.25 / a))) + (Math.cbrt((Math.sqrt(((h + g) * (g - h))) - g)) / Math.cbrt((a * 2.0)));
	} else {
		tmp = Math.cbrt((-g / a)) + t_0;
	}
	return tmp;
}
function code(g, h, a)
	t_0 = cbrt(Float64(Float64(Float64(h / a) * Float64(h / g)) * -0.25))
	tmp = 0.0
	if (g <= -1.35e+154)
		tmp = Float64(t_0 + cbrt(Float64((a ^ -1.0) * Float64(-g))));
	elseif (g <= -3.4e-160)
		tmp = Float64(cbrt(Float64(Float64(Float64(h * h) / g) * Float64(-0.25 / a))) + Float64(cbrt(Float64(sqrt(Float64(Float64(h + g) * Float64(g - h))) - g)) / cbrt(Float64(a * 2.0))));
	else
		tmp = Float64(cbrt(Float64(Float64(-g) / a)) + t_0);
	end
	return tmp
end
code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(N[(N[(h / a), $MachinePrecision] * N[(h / g), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[g, -1.35e+154], N[(t$95$0 + N[Power[N[(N[Power[a, -1.0], $MachinePrecision] * (-g)), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[g, -3.4e-160], N[(N[Power[N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * N[(-0.25 / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[(N[Power[N[(N[Sqrt[N[(N[(h + g), $MachinePrecision] * N[(g - h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - g), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[N[(a * 2.0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;g \leq -3.4 \cdot 10^{-160}:\\
\;\;\;\;\sqrt[3]{\frac{h \cdot h}{g} \cdot \frac{-0.25}{a}} + \frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{-g}{a}} + t\_0\\


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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\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)} \]

      if -1.35000000000000003e154 < g < -3.40000000000000021e-160

      1. Initial program 83.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 rewrites94.5%

        \[\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. Taylor expanded in g around -inf

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

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

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

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

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

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

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

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

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

      if -3.40000000000000021e-160 < g

      1. Initial program 48.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\color{blue}{\sqrt[3]{\frac{-1}{2}}} \cdot \sqrt[3]{\frac{1}{2}}\right) + \sqrt[3]{\frac{-g}{a}} \]
        10. lower-cbrt.f6478.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 rewrites78.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-+.f6478.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 rewrites78.9%

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

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

    Alternative 2: 75.9% accurate, 0.6× speedup?

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

      1. Initial program 18.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 rewrites42.5%

        \[\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. Step-by-step derivation
        1. lift-cbrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.99999999999999978e273 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

      1. Initial program 50.7%

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\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.f6480.8

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

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

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

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

          \[\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)} \]
      12. Recombined 2 regimes into one program.
      13. Final simplification80.1%

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

      Alternative 3: 75.5% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} + \sqrt[3]{\frac{-g}{a}} \]
      9. Step-by-step derivation
        1. 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-+.f6478.0

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

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

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

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

        Alternative 4: 31.7% accurate, 1.2× speedup?

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

          1. Initial program 36.0%

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

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

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

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

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

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

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

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

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

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

          if -3.5000000000000003e-160 < g < 5.59999999999999975e151

          1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto e^{\frac{1}{3} \cdot \left(\log \left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right) - \left(\color{blue}{\log 2} + \log a\right)\right)} + \sqrt[3]{\frac{-g}{a}} \]
            12. lower-log.f6435.2

              \[\leadsto e^{0.3333333333333333 \cdot \left(\log \left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right) - \left(\log 2 + \color{blue}{\log a}\right)\right)} + \sqrt[3]{\frac{-g}{a}} \]
          10. Applied rewrites35.2%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt[3]{\frac{\sqrt{g \cdot g - \color{blue}{h \cdot h}} + g}{a}} \cdot \sqrt[3]{\frac{-1}{2}} \]
            12. lower-cbrt.f6475.5

              \[\leadsto \sqrt[3]{\frac{\sqrt{g \cdot g - h \cdot h} + g}{a}} \cdot \color{blue}{\sqrt[3]{-0.5}} \]
          13. Applied rewrites75.5%

            \[\leadsto \color{blue}{\sqrt[3]{\frac{\sqrt{g \cdot g - h \cdot h} + g}{a}} \cdot \sqrt[3]{-0.5}} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification35.3%

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

        Alternative 5: 75.5% 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 49.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.f6430.7

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\sqrt[3]{\frac{h}{a} \cdot \frac{h}{g}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{0.5}\right)} + \sqrt[3]{\frac{-g}{a}} \]
        9. Step-by-step derivation
          1. 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-+.f6478.0

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

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

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

        Alternative 6: 23.1% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto e^{0.3333333333333333 \cdot \left(\log \left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right) - \left(\log 2 + \color{blue}{\log a}\right)\right)} + \sqrt[3]{\frac{-g}{a}} \]
        10. Applied rewrites14.5%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt[3]{\frac{\sqrt{g \cdot g - \color{blue}{h \cdot h}} + g}{a}} \cdot \sqrt[3]{\frac{-1}{2}} \]
          12. lower-cbrt.f6426.9

            \[\leadsto \sqrt[3]{\frac{\sqrt{g \cdot g - h \cdot h} + g}{a}} \cdot \color{blue}{\sqrt[3]{-0.5}} \]
        13. Applied rewrites26.9%

          \[\leadsto \color{blue}{\sqrt[3]{\frac{\sqrt{g \cdot g - h \cdot h} + g}{a}} \cdot \sqrt[3]{-0.5}} \]
        14. Final simplification26.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 0 \]
          2. Add Preprocessing

          Reproduce

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