2-ancestry mixing, positive discriminant

Percentage Accurate: 44.6% → 95.2%
Time: 12.7s
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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 95.2% accurate, 0.7× speedup?

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

\\
\frac{\sqrt[3]{g} \cdot \left(\sqrt[3]{-1} \cdot \sqrt[3]{2}\right)}{\sqrt[3]{a \cdot 2}}
\end{array}
Derivation
  1. Initial program 45.0%

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

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

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

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

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

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

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

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

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

Alternative 2: 78.5% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{g \cdot g - h \cdot h}\\
t_1 := \sqrt[3]{{\left(2 \cdot a\right)}^{-1} \cdot \left(\left(-g\right) + t\_0\right)}\\
t_2 := t\_1 + \sqrt[3]{\frac{-1}{2 \cdot a} \cdot \left(g + t\_0\right)}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-95} \lor \neg \left(t\_2 \leq 10^{-104}\right):\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}}, \sqrt[3]{-1}, \sqrt[3]{-0.25 \cdot \left(\frac{h}{a} \cdot \frac{h}{g}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{-\left(g + g\right)}\\


\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))))))) < -4.9999999999999998e-95 or 9.99999999999999927e-105 < (+.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 47.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 h around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{-1}{2}}, \sqrt[3]{2}, \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)\right) \]
      11. *-commutativeN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-0.5}, \sqrt[3]{2}, \sqrt[3]{\frac{h}{g} \cdot \frac{h}{a}} \cdot \left(\sqrt[3]{0.5} \cdot \sqrt[3]{-0.5}\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites79.1%

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

      if -4.9999999999999998e-95 < (+.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))))))) < 9.99999999999999927e-105

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

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

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

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

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

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

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

          \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\sqrt[3]{\frac{1}{2 \cdot a}}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        8. 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 \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        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{1}{\color{blue}{2 \cdot a}}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        10. 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{\frac{1}{2}}{a}}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        11. 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{\color{blue}{\frac{1}{2}}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        12. 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{\frac{1}{2}}{a}}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \]
        13. lower-cbrt.f6437.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{0.5}{a}} \cdot \color{blue}{\sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}} \]
        14. 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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{g \cdot g - h \cdot h}}} \]
        15. 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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{g \cdot g} - h \cdot h}} \]
        16. 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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - \color{blue}{h \cdot h}}} \]
        17. difference-of-squaresN/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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{\left(g + h\right) \cdot \left(g - h\right)}}} \]
        18. *-commutativeN/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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{\left(g - h\right) \cdot \left(g + h\right)}}} \]
        19. 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]{\frac{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{\left(g - h\right) \cdot \left(g + h\right)}}} \]
        20. 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]{\frac{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\color{blue}{\left(g - h\right)} \cdot \left(g + h\right)}} \]
      4. Applied rewrites37.2%

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{\left(g - h\right) \cdot \left(h + g\right)}}} \]
      5. 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]{\frac{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \color{blue}{-1 \cdot \left(g \cdot {\left(\sqrt{-1}\right)}^{2}\right)}} \]
      6. Step-by-step derivation
        1. 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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \color{blue}{\left(\mathsf{neg}\left(g \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}} \]
        2. *-commutativeN/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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \left(\mathsf{neg}\left(\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot g}\right)\right)} \]
        3. unpow2N/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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \left(\mathsf{neg}\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot g\right)\right)} \]
        4. rem-square-sqrtN/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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \left(\mathsf{neg}\left(\color{blue}{-1} \cdot g\right)\right)} \]
        5. lower-neg.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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \color{blue}{\left(--1 \cdot g\right)}} \]
        6. 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{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \left(-\color{blue}{\left(\mathsf{neg}\left(g\right)\right)}\right)} \]
        7. lower-neg.f6494.5

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

        \[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{\left(-g\right) - \color{blue}{\left(-\left(-g\right)\right)}} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification80.0%

      \[\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^{-95} \lor \neg \left(\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 10^{-104}\right):\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}}, \sqrt[3]{-1}, \sqrt[3]{-0.25 \cdot \left(\frac{h}{a} \cdot \frac{h}{g}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(2 \cdot a\right)}^{-1} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{0.5}{a}} \cdot \sqrt[3]{-\left(g + g\right)}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 76.0% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{\frac{-1}{2}}, \sqrt[3]{2}, \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)\right) \]
      11. *-commutativeN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-0.5}, \sqrt[3]{2}, \sqrt[3]{\frac{h}{g} \cdot \frac{h}{a}} \cdot \left(\sqrt[3]{0.5} \cdot \sqrt[3]{-0.5}\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites75.0%

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

      Alternative 4: 74.4% 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 45.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.f6430.1

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

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

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

          \[\leadsto \color{blue}{{\left(\frac{-g}{a}\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. sqr-powN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-1}} \]
      9. 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.f6473.4

          \[\leadsto \sqrt[3]{\frac{g}{a}} \cdot \color{blue}{\sqrt[3]{-1}} \]
      10. Applied rewrites73.4%

        \[\leadsto \color{blue}{\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-1}} \]
      11. 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;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(g, h, a)
      use fmin_fmax_functions
          real(8), intent (in) :: g
          real(8), intent (in) :: h
          real(8), intent (in) :: a
          code = 0.0d0
      end function
      
      public static double code(double g, double h, double a) {
      	return 0.0;
      }
      
      def code(g, h, a):
      	return 0.0
      
      function code(g, h, a)
      	return 0.0
      end
      
      function tmp = code(g, h, a)
      	tmp = 0.0;
      end
      
      code[g_, h_, a_] := 0.0
      
      \begin{array}{l}
      
      \\
      0
      \end{array}
      
      Derivation
      1. Initial program 45.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. Step-by-step derivation
        1. lift-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -\sqrt[3]{\frac{\color{blue}{0} \cdot g}{a}} \cdot \sqrt[3]{\frac{1}{2}} \]
        12. *-lft-identityN/A

          \[\leadsto -\sqrt[3]{\frac{0 \cdot g}{\color{blue}{1 \cdot a}}} \cdot \sqrt[3]{\frac{1}{2}} \]
        13. times-fracN/A

          \[\leadsto -\sqrt[3]{\color{blue}{\frac{0}{1} \cdot \frac{g}{a}}} \cdot \sqrt[3]{\frac{1}{2}} \]
        14. metadata-evalN/A

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

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

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

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

        \[\leadsto \color{blue}{-\sqrt[3]{0 \cdot \frac{g}{a}} \cdot \sqrt[3]{0.5}} \]
      8. Step-by-step derivation
        1. Applied rewrites3.0%

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

        Reproduce

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