2-ancestry mixing, positive discriminant

Percentage Accurate: 43.7% → 97.6%
Time: 14.0s
Alternatives: 14
Speedup: 0.7×

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 14 alternatives:

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

Initial Program: 43.7% 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: 97.6% accurate, 0.4× speedup?

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

\\
\mathsf{fma}\left(\frac{\sqrt[3]{2 \cdot g}}{\sqrt[3]{a}}, \sqrt[3]{-0.5}, \frac{\sqrt[3]{\frac{h}{g} \cdot h}}{\sqrt[3]{a}} \cdot \left(\sqrt[3]{0.5} \cdot \sqrt[3]{-0.5}\right)\right)
\end{array}
Derivation
  1. Initial program 46.3%

    \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
  5. Applied rewrites73.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{-0.5}, \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 rewrites94.2%

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

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

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

        Alternative 2: 77.3% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{g \cdot g - h \cdot h}\\ t_1 := {\left(2 \cdot a\right)}^{-1}\\ t_2 := \sqrt[3]{t\_1 \cdot \left(\left(-g\right) + t\_0\right)} + \sqrt[3]{\frac{-1}{2 \cdot a} \cdot \left(g + t\_0\right)}\\ t_3 := \frac{2}{\left(g \cdot g\right) \cdot a}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{t\_3}\right) \cdot \sqrt[3]{0.5}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+61}:\\ \;\;\;\;\sqrt[3]{t\_1 \cdot \left(\frac{h \cdot h}{g} \cdot -0.5\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{g}, \frac{h \cdot h}{a}, \frac{-g}{a}\right)}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{t\_3 \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-0.5}\right) \cdot \sqrt[3]{2}\\ \end{array} \end{array} \]
        (FPCore (g h a)
         :precision binary64
         (let* ((t_0 (sqrt (- (* g g) (* h h))))
                (t_1 (pow (* 2.0 a) -1.0))
                (t_2
                 (+
                  (cbrt (* t_1 (+ (- g) t_0)))
                  (cbrt (* (/ -1.0 (* 2.0 a)) (+ g t_0)))))
                (t_3 (/ 2.0 (* (* g g) a))))
           (if (<= t_2 (- INFINITY))
             (* (* (- g) (cbrt t_3)) (cbrt 0.5))
             (if (<= t_2 2e+61)
               (+
                (cbrt (* t_1 (* (/ (* h h) g) -0.5)))
                (cbrt (fma (/ 0.25 g) (/ (* h h) a) (/ (- g) a))))
               (if (<= t_2 INFINITY)
                 (* (- g) (cbrt (* t_3 0.5)))
                 (* (* (cbrt (/ g a)) (cbrt -0.5)) (cbrt 2.0)))))))
        double code(double g, double h, double a) {
        	double t_0 = sqrt(((g * g) - (h * h)));
        	double t_1 = pow((2.0 * a), -1.0);
        	double t_2 = cbrt((t_1 * (-g + t_0))) + cbrt(((-1.0 / (2.0 * a)) * (g + t_0)));
        	double t_3 = 2.0 / ((g * g) * a);
        	double tmp;
        	if (t_2 <= -((double) INFINITY)) {
        		tmp = (-g * cbrt(t_3)) * cbrt(0.5);
        	} else if (t_2 <= 2e+61) {
        		tmp = cbrt((t_1 * (((h * h) / g) * -0.5))) + cbrt(fma((0.25 / g), ((h * h) / a), (-g / a)));
        	} else if (t_2 <= ((double) INFINITY)) {
        		tmp = -g * cbrt((t_3 * 0.5));
        	} else {
        		tmp = (cbrt((g / a)) * cbrt(-0.5)) * cbrt(2.0);
        	}
        	return tmp;
        }
        
        function code(g, h, a)
        	t_0 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
        	t_1 = Float64(2.0 * a) ^ -1.0
        	t_2 = Float64(cbrt(Float64(t_1 * Float64(Float64(-g) + t_0))) + cbrt(Float64(Float64(-1.0 / Float64(2.0 * a)) * Float64(g + t_0))))
        	t_3 = Float64(2.0 / Float64(Float64(g * g) * a))
        	tmp = 0.0
        	if (t_2 <= Float64(-Inf))
        		tmp = Float64(Float64(Float64(-g) * cbrt(t_3)) * cbrt(0.5));
        	elseif (t_2 <= 2e+61)
        		tmp = Float64(cbrt(Float64(t_1 * Float64(Float64(Float64(h * h) / g) * -0.5))) + cbrt(fma(Float64(0.25 / g), Float64(Float64(h * h) / a), Float64(Float64(-g) / a))));
        	elseif (t_2 <= Inf)
        		tmp = Float64(Float64(-g) * cbrt(Float64(t_3 * 0.5)));
        	else
        		tmp = Float64(Float64(cbrt(Float64(g / a)) * cbrt(-0.5)) * cbrt(2.0));
        	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[(2.0 * a), $MachinePrecision], -1.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[(t$95$1 * 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]}, Block[{t$95$3 = N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[((-g) * N[Power[t$95$3, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[0.5, 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+61], N[(N[Power[N[(t$95$1 * N[(N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[(N[(0.25 / g), $MachinePrecision] * N[(N[(h * h), $MachinePrecision] / a), $MachinePrecision] + N[((-g) / a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[((-g) * N[Power[N[(t$95$3 * 0.5), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(g / a), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[-0.5, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision]), $MachinePrecision]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sqrt{g \cdot g - h \cdot h}\\
        t_1 := {\left(2 \cdot a\right)}^{-1}\\
        t_2 := \sqrt[3]{t\_1 \cdot \left(\left(-g\right) + t\_0\right)} + \sqrt[3]{\frac{-1}{2 \cdot a} \cdot \left(g + t\_0\right)}\\
        t_3 := \frac{2}{\left(g \cdot g\right) \cdot a}\\
        \mathbf{if}\;t\_2 \leq -\infty:\\
        \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{t\_3}\right) \cdot \sqrt[3]{0.5}\\
        
        \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+61}:\\
        \;\;\;\;\sqrt[3]{t\_1 \cdot \left(\frac{h \cdot h}{g} \cdot -0.5\right)} + \sqrt[3]{\mathsf{fma}\left(\frac{0.25}{g}, \frac{h \cdot h}{a}, \frac{-g}{a}\right)}\\
        
        \mathbf{elif}\;t\_2 \leq \infty:\\
        \;\;\;\;\left(-g\right) \cdot \sqrt[3]{t\_3 \cdot 0.5}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-0.5}\right) \cdot \sqrt[3]{2}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 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))))))) < -inf.0

          1. Initial program 4.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. Applied rewrites0.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -inf.0 < (+.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.9999999999999999e61

            1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.9999999999999999e61 < (+.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))))))) < +inf.0

            1. Initial program 56.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. Applied rewrites11.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if +inf.0 < (+.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 0.0%

                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
              5. Applied rewrites57.7%

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

                \[\leadsto \sqrt[3]{\frac{g}{a}} \cdot \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{2}\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites57.2%

                  \[\leadsto \left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{-0.5}\right) \cdot \color{blue}{\sqrt[3]{2}} \]
              8. Recombined 4 regimes into one program.
              9. Final simplification78.1%

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

              Alternative 3: 42.1% accurate, 0.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{g \cdot g - h \cdot h}\\ t_1 := \sqrt[3]{\frac{-g}{a}}\\ \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 \infty:\\ \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\right) \cdot \sqrt[3]{0.5}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + t\_1\\ \end{array} \end{array} \]
              (FPCore (g h a)
               :precision binary64
               (let* ((t_0 (sqrt (- (* g g) (* h h)))) (t_1 (cbrt (/ (- g) a))))
                 (if (<=
                      (+
                       (cbrt (* (pow (* 2.0 a) -1.0) (+ (- g) t_0)))
                       (cbrt (* (/ -1.0 (* 2.0 a)) (+ g t_0))))
                      INFINITY)
                   (* (* (- g) (cbrt (/ 2.0 (* (* g g) a)))) (cbrt 0.5))
                   (+ t_1 t_1))))
              double code(double g, double h, double a) {
              	double t_0 = sqrt(((g * g) - (h * h)));
              	double t_1 = cbrt((-g / a));
              	double tmp;
              	if ((cbrt((pow((2.0 * a), -1.0) * (-g + t_0))) + cbrt(((-1.0 / (2.0 * a)) * (g + t_0)))) <= ((double) INFINITY)) {
              		tmp = (-g * cbrt((2.0 / ((g * g) * a)))) * cbrt(0.5);
              	} else {
              		tmp = t_1 + t_1;
              	}
              	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.cbrt((-g / a));
              	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)))) <= Double.POSITIVE_INFINITY) {
              		tmp = (-g * Math.cbrt((2.0 / ((g * g) * a)))) * Math.cbrt(0.5);
              	} else {
              		tmp = t_1 + t_1;
              	}
              	return tmp;
              }
              
              function code(g, h, a)
              	t_0 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
              	t_1 = cbrt(Float64(Float64(-g) / a))
              	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)))) <= Inf)
              		tmp = Float64(Float64(Float64(-g) * cbrt(Float64(2.0 / Float64(Float64(g * g) * a)))) * cbrt(0.5));
              	else
              		tmp = Float64(t_1 + t_1);
              	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[((-g) / a), $MachinePrecision], 1/3], $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], Infinity], N[(N[((-g) * N[Power[N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[0.5, 1/3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$1), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \sqrt{g \cdot g - h \cdot h}\\
              t_1 := \sqrt[3]{\frac{-g}{a}}\\
              \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 \infty:\\
              \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\right) \cdot \sqrt[3]{0.5}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1 + t\_1\\
              
              
              \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))))))) < +inf.0

                1. Initial program 81.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. Applied rewrites21.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if +inf.0 < (+.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 0.0%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                  10. Step-by-step derivation
                    1. associate-*r/N/A

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

                      \[\leadsto \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                    3. mul-1-negN/A

                      \[\leadsto \sqrt[3]{\frac{\color{blue}{\mathsf{neg}\left(g\right)}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                    4. lower-neg.f6412.7

                      \[\leadsto \sqrt[3]{\frac{\color{blue}{-g}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                  11. Applied rewrites12.7%

                    \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                10. Recombined 2 regimes into one program.
                11. Final simplification45.9%

                  \[\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 \infty:\\ \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\right) \cdot \sqrt[3]{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-g}{a}}\\ \end{array} \]
                12. Add Preprocessing

                Alternative 4: 42.1% accurate, 0.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{g \cdot g - h \cdot h}\\ t_1 := \sqrt[3]{\frac{-g}{a}}\\ \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 \infty:\\ \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + t\_1\\ \end{array} \end{array} \]
                (FPCore (g h a)
                 :precision binary64
                 (let* ((t_0 (sqrt (- (* g g) (* h h)))) (t_1 (cbrt (/ (- g) a))))
                   (if (<=
                        (+
                         (cbrt (* (pow (* 2.0 a) -1.0) (+ (- g) t_0)))
                         (cbrt (* (/ -1.0 (* 2.0 a)) (+ g t_0))))
                        INFINITY)
                     (* (* (- g) (cbrt 0.5)) (cbrt (/ 2.0 (* (* g g) a))))
                     (+ t_1 t_1))))
                double code(double g, double h, double a) {
                	double t_0 = sqrt(((g * g) - (h * h)));
                	double t_1 = cbrt((-g / a));
                	double tmp;
                	if ((cbrt((pow((2.0 * a), -1.0) * (-g + t_0))) + cbrt(((-1.0 / (2.0 * a)) * (g + t_0)))) <= ((double) INFINITY)) {
                		tmp = (-g * cbrt(0.5)) * cbrt((2.0 / ((g * g) * a)));
                	} else {
                		tmp = t_1 + t_1;
                	}
                	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.cbrt((-g / a));
                	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)))) <= Double.POSITIVE_INFINITY) {
                		tmp = (-g * Math.cbrt(0.5)) * Math.cbrt((2.0 / ((g * g) * a)));
                	} else {
                		tmp = t_1 + t_1;
                	}
                	return tmp;
                }
                
                function code(g, h, a)
                	t_0 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
                	t_1 = cbrt(Float64(Float64(-g) / a))
                	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)))) <= Inf)
                		tmp = Float64(Float64(Float64(-g) * cbrt(0.5)) * cbrt(Float64(2.0 / Float64(Float64(g * g) * a))));
                	else
                		tmp = Float64(t_1 + t_1);
                	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[((-g) / a), $MachinePrecision], 1/3], $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], Infinity], N[(N[((-g) * N[Power[0.5, 1/3], $MachinePrecision]), $MachinePrecision] * N[Power[N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$1), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \sqrt{g \cdot g - h \cdot h}\\
                t_1 := \sqrt[3]{\frac{-g}{a}}\\
                \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 \infty:\\
                \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1 + t\_1\\
                
                
                \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))))))) < +inf.0

                  1. Initial program 81.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. Applied rewrites21.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if +inf.0 < (+.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 0.0%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                    10. Step-by-step derivation
                      1. associate-*r/N/A

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

                        \[\leadsto \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                      3. mul-1-negN/A

                        \[\leadsto \sqrt[3]{\frac{\color{blue}{\mathsf{neg}\left(g\right)}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                      4. lower-neg.f6412.7

                        \[\leadsto \sqrt[3]{\frac{\color{blue}{-g}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                    11. Applied rewrites12.7%

                      \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                  10. Recombined 2 regimes into one program.
                  11. Final simplification45.8%

                    \[\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 \infty:\\ \;\;\;\;\left(\left(-g\right) \cdot \sqrt[3]{0.5}\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-g}{a}}\\ \end{array} \]
                  12. Add Preprocessing

                  Alternative 5: 42.1% accurate, 0.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{g \cdot g - h \cdot h}\\ t_1 := \sqrt[3]{\frac{-g}{a}}\\ \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 \infty:\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + t\_1\\ \end{array} \end{array} \]
                  (FPCore (g h a)
                   :precision binary64
                   (let* ((t_0 (sqrt (- (* g g) (* h h)))) (t_1 (cbrt (/ (- g) a))))
                     (if (<=
                          (+
                           (cbrt (* (pow (* 2.0 a) -1.0) (+ (- g) t_0)))
                           (cbrt (* (/ -1.0 (* 2.0 a)) (+ g t_0))))
                          INFINITY)
                       (* (- g) (cbrt (* (/ 2.0 (* (* g g) a)) 0.5)))
                       (+ t_1 t_1))))
                  double code(double g, double h, double a) {
                  	double t_0 = sqrt(((g * g) - (h * h)));
                  	double t_1 = cbrt((-g / a));
                  	double tmp;
                  	if ((cbrt((pow((2.0 * a), -1.0) * (-g + t_0))) + cbrt(((-1.0 / (2.0 * a)) * (g + t_0)))) <= ((double) INFINITY)) {
                  		tmp = -g * cbrt(((2.0 / ((g * g) * a)) * 0.5));
                  	} else {
                  		tmp = t_1 + t_1;
                  	}
                  	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.cbrt((-g / a));
                  	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)))) <= Double.POSITIVE_INFINITY) {
                  		tmp = -g * Math.cbrt(((2.0 / ((g * g) * a)) * 0.5));
                  	} else {
                  		tmp = t_1 + t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(g, h, a)
                  	t_0 = sqrt(Float64(Float64(g * g) - Float64(h * h)))
                  	t_1 = cbrt(Float64(Float64(-g) / a))
                  	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)))) <= Inf)
                  		tmp = Float64(Float64(-g) * cbrt(Float64(Float64(2.0 / Float64(Float64(g * g) * a)) * 0.5)));
                  	else
                  		tmp = Float64(t_1 + t_1);
                  	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[((-g) / a), $MachinePrecision], 1/3], $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], Infinity], N[((-g) * N[Power[N[(N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$1), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sqrt{g \cdot g - h \cdot h}\\
                  t_1 := \sqrt[3]{\frac{-g}{a}}\\
                  \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 \infty:\\
                  \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1 + t\_1\\
                  
                  
                  \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))))))) < +inf.0

                    1. Initial program 81.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. Applied rewrites21.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if +inf.0 < (+.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 0.0%

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                      10. Step-by-step derivation
                        1. associate-*r/N/A

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

                          \[\leadsto \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                        3. mul-1-negN/A

                          \[\leadsto \sqrt[3]{\frac{\color{blue}{\mathsf{neg}\left(g\right)}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                        4. lower-neg.f6412.7

                          \[\leadsto \sqrt[3]{\frac{\color{blue}{-g}}{a}} + \sqrt[3]{\frac{-g}{a}} \]
                      11. Applied rewrites12.7%

                        \[\leadsto \sqrt[3]{\color{blue}{\frac{-g}{a}}} + \sqrt[3]{\frac{-g}{a}} \]
                    10. Recombined 2 regimes into one program.
                    11. Final simplification45.8%

                      \[\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 \infty:\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{-g}{a}} + \sqrt[3]{\frac{-g}{a}}\\ \end{array} \]
                    12. Add Preprocessing

                    Alternative 6: 80.9% accurate, 0.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(2 \cdot a\right)}^{-1}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+171} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+119}\right):\\ \;\;\;\;\left(-g\right) \cdot \left(\sqrt[3]{0.5} \cdot \left(\sqrt[3]{0} + \sqrt[3]{\frac{2}{\left(a \cdot g\right) \cdot g}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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} \end{array} \]
                    (FPCore (g h a)
                     :precision binary64
                     (let* ((t_0 (pow (* 2.0 a) -1.0)))
                       (if (or (<= t_0 -5e+171) (not (<= t_0 5e+119)))
                         (* (- g) (* (cbrt 0.5) (+ (cbrt 0.0) (cbrt (/ 2.0 (* (* a g) g))))))
                         (fma (cbrt (/ g a)) (cbrt -1.0) (cbrt (* -0.25 (* (/ h a) (/ h g))))))))
                    double code(double g, double h, double a) {
                    	double t_0 = pow((2.0 * a), -1.0);
                    	double tmp;
                    	if ((t_0 <= -5e+171) || !(t_0 <= 5e+119)) {
                    		tmp = -g * (cbrt(0.5) * (cbrt(0.0) + cbrt((2.0 / ((a * g) * g)))));
                    	} else {
                    		tmp = fma(cbrt((g / a)), cbrt(-1.0), cbrt((-0.25 * ((h / a) * (h / g)))));
                    	}
                    	return tmp;
                    }
                    
                    function code(g, h, a)
                    	t_0 = Float64(2.0 * a) ^ -1.0
                    	tmp = 0.0
                    	if ((t_0 <= -5e+171) || !(t_0 <= 5e+119))
                    		tmp = Float64(Float64(-g) * Float64(cbrt(0.5) * Float64(cbrt(0.0) + cbrt(Float64(2.0 / Float64(Float64(a * g) * g))))));
                    	else
                    		tmp = fma(cbrt(Float64(g / a)), cbrt(-1.0), cbrt(Float64(-0.25 * Float64(Float64(h / a) * Float64(h / g)))));
                    	end
                    	return tmp
                    end
                    
                    code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(2.0 * a), $MachinePrecision], -1.0], $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e+171], N[Not[LessEqual[t$95$0, 5e+119]], $MachinePrecision]], N[((-g) * N[(N[Power[0.5, 1/3], $MachinePrecision] * N[(N[Power[0.0, 1/3], $MachinePrecision] + N[Power[N[(2.0 / N[(N[(a * g), $MachinePrecision] * g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := {\left(2 \cdot a\right)}^{-1}\\
                    \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+171} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+119}\right):\\
                    \;\;\;\;\left(-g\right) \cdot \left(\sqrt[3]{0.5} \cdot \left(\sqrt[3]{0} + \sqrt[3]{\frac{2}{\left(a \cdot g\right) \cdot g}}\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\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}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < -5.0000000000000004e171 or 4.9999999999999999e119 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

                      1. Initial program 24.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 rewrites4.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-g\right) \cdot \left(\sqrt[3]{0.5} \cdot \left(\sqrt[3]{\frac{0}{a \cdot \left(g \cdot g\right)}} + \sqrt[3]{\frac{2}{\left(a \cdot g\right) \cdot g}}\right)\right) \]

                        if -5.0000000000000004e171 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < 4.9999999999999999e119

                        1. Initial program 54.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. *-commutativeN/A

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                        5. Applied rewrites88.7%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{-0.5}, \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 rewrites89.8%

                            \[\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) \]
                        7. Recombined 2 regimes into one program.
                        8. Final simplification86.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(2 \cdot a\right)}^{-1} \leq -5 \cdot 10^{+171} \lor \neg \left({\left(2 \cdot a\right)}^{-1} \leq 5 \cdot 10^{+119}\right):\\ \;\;\;\;\left(-g\right) \cdot \left(\sqrt[3]{0.5} \cdot \left(\sqrt[3]{0} + \sqrt[3]{\frac{2}{\left(a \cdot g\right) \cdot g}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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} \]
                        9. Add Preprocessing

                        Alternative 7: 75.0% accurate, 0.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(2 \cdot a\right)}^{-1}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+242} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+256}\right):\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\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} \end{array} \]
                        (FPCore (g h a)
                         :precision binary64
                         (let* ((t_0 (pow (* 2.0 a) -1.0)))
                           (if (or (<= t_0 -5e+242) (not (<= t_0 2e+256)))
                             (* (- g) (cbrt (* (/ 2.0 (* (* g g) a)) 0.5)))
                             (fma (cbrt (/ g a)) (cbrt -1.0) (cbrt (* -0.25 (* (/ h a) (/ h g))))))))
                        double code(double g, double h, double a) {
                        	double t_0 = pow((2.0 * a), -1.0);
                        	double tmp;
                        	if ((t_0 <= -5e+242) || !(t_0 <= 2e+256)) {
                        		tmp = -g * cbrt(((2.0 / ((g * g) * a)) * 0.5));
                        	} else {
                        		tmp = fma(cbrt((g / a)), cbrt(-1.0), cbrt((-0.25 * ((h / a) * (h / g)))));
                        	}
                        	return tmp;
                        }
                        
                        function code(g, h, a)
                        	t_0 = Float64(2.0 * a) ^ -1.0
                        	tmp = 0.0
                        	if ((t_0 <= -5e+242) || !(t_0 <= 2e+256))
                        		tmp = Float64(Float64(-g) * cbrt(Float64(Float64(2.0 / Float64(Float64(g * g) * a)) * 0.5)));
                        	else
                        		tmp = fma(cbrt(Float64(g / a)), cbrt(-1.0), cbrt(Float64(-0.25 * Float64(Float64(h / a) * Float64(h / g)))));
                        	end
                        	return tmp
                        end
                        
                        code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(2.0 * a), $MachinePrecision], -1.0], $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e+242], N[Not[LessEqual[t$95$0, 2e+256]], $MachinePrecision]], N[((-g) * N[Power[N[(N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], 1/3], $MachinePrecision]), $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]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := {\left(2 \cdot a\right)}^{-1}\\
                        \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+242} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+256}\right):\\
                        \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\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}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < -5.0000000000000004e242 or 2.0000000000000001e256 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

                          1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if -5.0000000000000004e242 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < 2.0000000000000001e256

                            1. Initial program 49.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 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. *-commutativeN/A

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                            5. Applied rewrites79.7%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{-0.5}, \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 rewrites80.6%

                                \[\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) \]
                            7. Recombined 2 regimes into one program.
                            8. Final simplification77.9%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(2 \cdot a\right)}^{-1} \leq -5 \cdot 10^{+242} \lor \neg \left({\left(2 \cdot a\right)}^{-1} \leq 2 \cdot 10^{+256}\right):\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\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} \]
                            9. Add Preprocessing

                            Alternative 8: 71.6% accurate, 0.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(2 \cdot a\right)}^{-1}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+242} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+256}\right):\\ \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h \cdot h}{g}} + \sqrt[3]{\frac{-g}{a}}\\ \end{array} \end{array} \]
                            (FPCore (g h a)
                             :precision binary64
                             (let* ((t_0 (pow (* 2.0 a) -1.0)))
                               (if (or (<= t_0 -5e+242) (not (<= t_0 2e+256)))
                                 (* (- g) (cbrt (* (/ 2.0 (* (* g g) a)) 0.5)))
                                 (+ (cbrt (* (/ -0.25 a) (/ (* h h) g))) (cbrt (/ (- g) a))))))
                            double code(double g, double h, double a) {
                            	double t_0 = pow((2.0 * a), -1.0);
                            	double tmp;
                            	if ((t_0 <= -5e+242) || !(t_0 <= 2e+256)) {
                            		tmp = -g * cbrt(((2.0 / ((g * g) * a)) * 0.5));
                            	} else {
                            		tmp = cbrt(((-0.25 / a) * ((h * h) / g))) + cbrt((-g / a));
                            	}
                            	return tmp;
                            }
                            
                            public static double code(double g, double h, double a) {
                            	double t_0 = Math.pow((2.0 * a), -1.0);
                            	double tmp;
                            	if ((t_0 <= -5e+242) || !(t_0 <= 2e+256)) {
                            		tmp = -g * Math.cbrt(((2.0 / ((g * g) * a)) * 0.5));
                            	} else {
                            		tmp = Math.cbrt(((-0.25 / a) * ((h * h) / g))) + Math.cbrt((-g / a));
                            	}
                            	return tmp;
                            }
                            
                            function code(g, h, a)
                            	t_0 = Float64(2.0 * a) ^ -1.0
                            	tmp = 0.0
                            	if ((t_0 <= -5e+242) || !(t_0 <= 2e+256))
                            		tmp = Float64(Float64(-g) * cbrt(Float64(Float64(2.0 / Float64(Float64(g * g) * a)) * 0.5)));
                            	else
                            		tmp = Float64(cbrt(Float64(Float64(-0.25 / a) * Float64(Float64(h * h) / g))) + cbrt(Float64(Float64(-g) / a)));
                            	end
                            	return tmp
                            end
                            
                            code[g_, h_, a_] := Block[{t$95$0 = N[Power[N[(2.0 * a), $MachinePrecision], -1.0], $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e+242], N[Not[LessEqual[t$95$0, 2e+256]], $MachinePrecision]], N[((-g) * N[Power[N[(N[(2.0 / N[(N[(g * g), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(-0.25 / a), $MachinePrecision] * N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := {\left(2 \cdot a\right)}^{-1}\\
                            \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+242} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+256}\right):\\
                            \;\;\;\;\left(-g\right) \cdot \sqrt[3]{\frac{2}{\left(g \cdot g\right) \cdot a} \cdot 0.5}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\sqrt[3]{\frac{-0.25}{a} \cdot \frac{h \cdot h}{g}} + \sqrt[3]{\frac{-g}{a}}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < -5.0000000000000004e242 or 2.0000000000000001e256 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

                              1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -5.0000000000000004e242 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < 2.0000000000000001e256

                                1. Initial program 49.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.f6429.4

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \sqrt[3]{\frac{\frac{-1}{4}}{a} \cdot \frac{\color{blue}{h \cdot h}}{g}} + \sqrt[3]{\frac{-g}{a}} \]
                                  7. lower-*.f6476.4

                                    \[\leadsto \sqrt[3]{\frac{-0.25}{a} \cdot \frac{\color{blue}{h \cdot h}}{g}} + \sqrt[3]{\frac{-g}{a}} \]
                                11. Applied rewrites76.4%

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

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

                              Alternative 9: 93.6% accurate, 0.7× speedup?

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

                                \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                              5. Applied rewrites73.2%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{-0.5}, \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 rewrites94.2%

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

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

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

                                    Alternative 10: 37.4% accurate, 2.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 11: 5.0% accurate, 2.3× speedup?

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

                                        \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                                      5. Applied rewrites73.2%

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

                                        \[\leadsto \sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites4.1%

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

                                            \[\leadsto \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites4.7%

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

                                            Alternative 12: 5.0% accurate, 2.3× speedup?

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

                                              \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                                            5. Applied rewrites73.2%

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

                                              \[\leadsto \sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites4.1%

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

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

                                                Alternative 13: 4.3% accurate, 2.3× speedup?

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

                                                  \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                                                5. Applied rewrites73.2%

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

                                                  \[\leadsto \sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites4.1%

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

                                                      \[\leadsto \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} \]
                                                    2. Taylor expanded in g around 0

                                                      \[\leadsto \sqrt[3]{\frac{-1}{4} \cdot \frac{{h}^{2}}{a \cdot g}} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites4.1%

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

                                                      Alternative 14: 4.1% accurate, 2.4× speedup?

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

                                                        \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in 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. *-commutativeN/A

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

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

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

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

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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. lower-cbrt.f64N/A

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

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

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

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{g}{a}} \cdot \sqrt[3]{2}, \sqrt[3]{\frac{-1}{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) \]
                                                      5. Applied rewrites73.2%

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

                                                        \[\leadsto \sqrt[3]{\frac{{h}^{2}}{a \cdot g}} \cdot \color{blue}{\left(\sqrt[3]{\frac{-1}{2}} \cdot \sqrt[3]{\frac{1}{2}}\right)} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites4.1%

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

                                                            \[\leadsto \sqrt[3]{\left(\frac{h}{a} \cdot \frac{h}{g}\right) \cdot -0.25} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites4.1%

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

                                                            Reproduce

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