2-ancestry mixing, positive discriminant

Percentage Accurate: 44.5% → 77.1%
Time: 11.8s
Alternatives: 5
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 5 alternatives:

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

Initial Program: 44.5% accurate, 1.0× speedup?

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

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

Alternative 1: 77.1% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{h}{a}} \cdot \sqrt[3]{\frac{h}{g} \cdot -0.25} + \sqrt[3]{\frac{-g}{a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h))))))) < -5.0000000000000002e46

    1. Initial program 68.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. pow1/3N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e46 < (+.f64 (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (+.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))) (cbrt.f64 (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) (-.f64 (neg.f64 g) (sqrt.f64 (-.f64 (*.f64 g g) (*.f64 h h)))))))

    1. Initial program 41.8%

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

      \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \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.f6424.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 rewrites24.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.f6474.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 rewrites74.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. Applied rewrites74.8%

        \[\leadsto \sqrt[3]{\frac{h}{a}} \cdot \color{blue}{\sqrt[3]{\frac{h}{g} \cdot -0.25}} + \sqrt[3]{\frac{-g}{a}} \]
    10. Recombined 2 regimes into one program.
    11. Final simplification76.5%

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

    Alternative 2: 75.5% accurate, 0.9× speedup?

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

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

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

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

      Alternative 3: 75.5% accurate, 1.2× speedup?

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

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

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

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

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

      Alternative 4: 74.1% accurate, 1.4× speedup?

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\left(-g\right) \cdot \frac{\color{blue}{\frac{1}{2}}}{a} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{2 \cdot a}} \]
        8. 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{\left(-g\right) \cdot \frac{1}{2}}{a}} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{2 \cdot a}} \]
        9. lift-/.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]{\frac{\left(-g\right) \cdot \frac{1}{2}}{a} - \sqrt{g \cdot g - h \cdot h} \cdot \color{blue}{\frac{1}{2 \cdot a}}} \]
        10. lift-*.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]{\frac{\left(-g\right) \cdot \frac{1}{2}}{a} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{\color{blue}{2 \cdot a}}} \]
        11. 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]{\frac{\left(-g\right) \cdot \frac{1}{2}}{a} - \sqrt{g \cdot g - h \cdot h} \cdot \color{blue}{\frac{\frac{1}{2}}{a}}} \]
        12. metadata-evalN/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{\left(-g\right) \cdot \frac{1}{2}}{a} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{\color{blue}{\frac{1}{2}}}{a}} \]
        13. 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]{\frac{\left(-g\right) \cdot \frac{1}{2}}{a} - \color{blue}{\frac{\sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{2}}{a}}} \]
        14. sub-divN/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{\left(-g\right) \cdot \frac{1}{2} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{2}}{a}}} \]
        15. 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{\left(-g\right) \cdot \frac{1}{2} - \sqrt{g \cdot g - h \cdot h} \cdot \frac{1}{2}}{a}}} \]
      4. Applied rewrites43.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 \cdot -0.5 - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot 0.5}{a}}} \]
      5. 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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{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 \cdot \frac{-1}{2} - \sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \frac{1}{2}}{a}} \]
        19. clear-numN/A

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{g}{a}} \cdot \color{blue}{\sqrt[3]{-1}} \]
      9. Applied rewrites71.0%

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

      Alternative 5: 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 43.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. pow1/3N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\sqrt[3]{\frac{0}{a}}\right) \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 2024311 
        (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))))))))