2-ancestry mixing, positive discriminant

Percentage Accurate: 44.3% → 97.8%
Time: 12.0s
Alternatives: 13
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 44.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\sqrt[3]{{a}^{-1} \cdot 2} \cdot \sqrt[3]{g}, \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 (* (pow a -1.0) 2.0)) (cbrt g))
  (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((pow(a, -1.0) * 2.0)) * cbrt(g)), 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((a ^ -1.0) * 2.0)) * cbrt(g)), 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[(N[Power[a, -1.0], $MachinePrecision] * 2.0), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[g, 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(\sqrt[3]{{a}^{-1} \cdot 2} \cdot \sqrt[3]{g}, \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 40.9%

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

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

      \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

        \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
        1. Applied rewrites97.0%

          \[\leadsto \mathsf{fma}\left(\sqrt[3]{{a}^{-1} \cdot 2} \cdot \sqrt[3]{g}, \sqrt[3]{\color{blue}{-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: 79.0% accurate, 0.2× speedup?

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{0.5}, \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g - h\right) \cdot \left(h + g\right)}}{a}}, \sqrt[3]{\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot \frac{0.5}{a}}\right)} \]
          5. 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)} \]
          6. 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. 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) \]
            3. lower-*.f64N/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) \]
          7. Applied rewrites99.1%

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

          if -3.99999999999999998e89 < (+.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))))))) < 2e98

          1. Initial program 79.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 rewrites89.1%

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

              \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites95.7%

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

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

              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 rewrites60.0%

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

                  \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.9%

                    \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
                    1. Applied rewrites60.8%

                      \[\leadsto \mathsf{fma}\left(\sqrt[3]{\frac{\frac{h}{g} \cdot h}{a}}, \color{blue}{\sqrt[3]{-0.25}}, \sqrt[3]{\frac{-g}{a}}\right) \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification78.3%

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

                  Alternative 3: 77.8% accurate, 0.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\left(g - h\right) \cdot \left(h + g\right)}\\ t_1 := {\left(2 \cdot a\right)}^{-1}\\ t_2 := \sqrt[3]{\frac{0.5}{a}} \cdot \left(\sqrt[3]{t\_0 - g} + \sqrt[3]{\left(-g\right) - t\_0}\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+100}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{\left(a \cdot a\right) \cdot \frac{h \cdot h}{g}}, \sqrt[3]{-0.25}, \sqrt[3]{\left(a \cdot a\right) \cdot g} \cdot \sqrt[3]{-1}\right)}{a}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+218}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\left(\frac{h}{g} \cdot h\right) \cdot -0.25}, {\left(\sqrt[3]{a}\right)}^{-1}, \sqrt[3]{\frac{-g}{a}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                  (FPCore (g h a)
                   :precision binary64
                   (let* ((t_0 (sqrt (* (- g h) (+ h g))))
                          (t_1 (pow (* 2.0 a) -1.0))
                          (t_2 (* (cbrt (/ 0.5 a)) (+ (cbrt (- t_0 g)) (cbrt (- (- g) t_0))))))
                     (if (<= t_1 -2e+130)
                       t_2
                       (if (<= t_1 -2e+100)
                         (/
                          (fma
                           (cbrt (* (* a a) (/ (* h h) g)))
                           (cbrt -0.25)
                           (* (cbrt (* (* a a) g)) (cbrt -1.0)))
                          a)
                         (if (<= t_1 5e+218)
                           (fma
                            (cbrt (* (* (/ h g) h) -0.25))
                            (pow (cbrt a) -1.0)
                            (cbrt (/ (- g) a)))
                           t_2)))))
                  double code(double g, double h, double a) {
                  	double t_0 = sqrt(((g - h) * (h + g)));
                  	double t_1 = pow((2.0 * a), -1.0);
                  	double t_2 = cbrt((0.5 / a)) * (cbrt((t_0 - g)) + cbrt((-g - t_0)));
                  	double tmp;
                  	if (t_1 <= -2e+130) {
                  		tmp = t_2;
                  	} else if (t_1 <= -2e+100) {
                  		tmp = fma(cbrt(((a * a) * ((h * h) / g))), cbrt(-0.25), (cbrt(((a * a) * g)) * cbrt(-1.0))) / a;
                  	} else if (t_1 <= 5e+218) {
                  		tmp = fma(cbrt((((h / g) * h) * -0.25)), pow(cbrt(a), -1.0), cbrt((-g / a)));
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  function code(g, h, a)
                  	t_0 = sqrt(Float64(Float64(g - h) * Float64(h + g)))
                  	t_1 = Float64(2.0 * a) ^ -1.0
                  	t_2 = Float64(cbrt(Float64(0.5 / a)) * Float64(cbrt(Float64(t_0 - g)) + cbrt(Float64(Float64(-g) - t_0))))
                  	tmp = 0.0
                  	if (t_1 <= -2e+130)
                  		tmp = t_2;
                  	elseif (t_1 <= -2e+100)
                  		tmp = Float64(fma(cbrt(Float64(Float64(a * a) * Float64(Float64(h * h) / g))), cbrt(-0.25), Float64(cbrt(Float64(Float64(a * a) * g)) * cbrt(-1.0))) / a);
                  	elseif (t_1 <= 5e+218)
                  		tmp = fma(cbrt(Float64(Float64(Float64(h / g) * h) * -0.25)), (cbrt(a) ^ -1.0), cbrt(Float64(Float64(-g) / a)));
                  	else
                  		tmp = t_2;
                  	end
                  	return tmp
                  end
                  
                  code[g_, h_, a_] := Block[{t$95$0 = N[Sqrt[N[(N[(g - h), $MachinePrecision] * N[(h + g), $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[(0.5 / a), $MachinePrecision], 1/3], $MachinePrecision] * N[(N[Power[N[(t$95$0 - g), $MachinePrecision], 1/3], $MachinePrecision] + N[Power[N[((-g) - t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+130], t$95$2, If[LessEqual[t$95$1, -2e+100], N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] * N[(N[(h * h), $MachinePrecision] / g), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[-0.25, 1/3], $MachinePrecision] + N[(N[Power[N[(N[(a * a), $MachinePrecision] * g), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[-1.0, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 5e+218], N[(N[Power[N[(N[(N[(h / g), $MachinePrecision] * h), $MachinePrecision] * -0.25), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Power[a, 1/3], $MachinePrecision], -1.0], $MachinePrecision] + N[Power[N[((-g) / a), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sqrt{\left(g - h\right) \cdot \left(h + g\right)}\\
                  t_1 := {\left(2 \cdot a\right)}^{-1}\\
                  t_2 := \sqrt[3]{\frac{0.5}{a}} \cdot \left(\sqrt[3]{t\_0 - g} + \sqrt[3]{\left(-g\right) - t\_0}\right)\\
                  \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\
                  \;\;\;\;t\_2\\
                  
                  \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+100}:\\
                  \;\;\;\;\frac{\mathsf{fma}\left(\sqrt[3]{\left(a \cdot a\right) \cdot \frac{h \cdot h}{g}}, \sqrt[3]{-0.25}, \sqrt[3]{\left(a \cdot a\right) \cdot g} \cdot \sqrt[3]{-1}\right)}{a}\\
                  
                  \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+218}:\\
                  \;\;\;\;\mathsf{fma}\left(\sqrt[3]{\left(\frac{h}{g} \cdot h\right) \cdot -0.25}, {\left(\sqrt[3]{a}\right)}^{-1}, \sqrt[3]{\frac{-g}{a}}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_2\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < -2.0000000000000001e130 or 4.99999999999999983e218 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

                    1. Initial program 28.6%

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

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

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

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

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

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

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

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

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

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

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

                    if -2.0000000000000001e130 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < -2.00000000000000003e100

                    1. Initial program 26.9%

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

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

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

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

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

                        if -2.00000000000000003e100 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a)) < 4.99999999999999983e218

                        1. Initial program 45.9%

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

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

                            \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.6%

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

                              \[\leadsto \mathsf{fma}\left(\sqrt[3]{\left(\frac{h}{g} \cdot h\right) \cdot -0.25}, \color{blue}{{\left(\sqrt[3]{a}\right)}^{-1}}, \sqrt[3]{\frac{-g}{a}}\right) \]
                          3. Recombined 3 regimes into one program.
                          4. Final simplification78.8%

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

                          Alternative 4: 76.4% accurate, 0.5× speedup?

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

                            1. Initial program 43.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 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 rewrites76.6%

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

                                \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.2%

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

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

                                if 4.99999999999999983e218 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 5: 95.9% accurate, 0.5× speedup?

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

                                    \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
                                    1. Applied rewrites95.3%

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

                                    Alternative 6: 95.9% accurate, 0.5× speedup?

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

                                          \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
                                          1. Applied rewrites95.2%

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

                                          Alternative 7: 95.9% accurate, 0.6× speedup?

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

                                                \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
                                                1. Applied rewrites95.1%

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

                                                Alternative 8: 94.0% accurate, 0.6× speedup?

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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.0%

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

                                                    Alternative 9: 76.3% accurate, 0.6× speedup?

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

                                                      1. Initial program 43.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 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 rewrites76.6%

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

                                                          \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.2%

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

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

                                                          if 4.99999999999999983e218 < (/.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) a))

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

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

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

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

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

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

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

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

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

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

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

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

                                                        Alternative 10: 75.1% accurate, 0.9× speedup?

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

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

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

                                                            \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

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

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

                                                            Alternative 11: 75.1% accurate, 1.2× speedup?

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

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

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

                                                                \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \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 rewrites96.4%

                                                                  \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{g} \cdot \sqrt[3]{{a}^{-1}}\right) \cdot \sqrt[3]{2}, \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. Step-by-step derivation
                                                                  1. Applied rewrites72.3%

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

                                                                  Alternative 12: 73.5% accurate, 1.4× speedup?

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

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

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

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

                                                                      \[\leadsto \sqrt[3]{\frac{g}{a}} \cdot \color{blue}{\sqrt[3]{-1}} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites70.7%

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

                                                                      Alternative 13: 3.0% accurate, 302.0× speedup?

                                                                      \[\begin{array}{l} \\ 0 \end{array} \]
                                                                      (FPCore (g h a) :precision binary64 0.0)
                                                                      double code(double g, double h, double a) {
                                                                      	return 0.0;
                                                                      }
                                                                      
                                                                      real(8) function code(g, h, a)
                                                                          real(8), intent (in) :: g
                                                                          real(8), intent (in) :: h
                                                                          real(8), intent (in) :: a
                                                                          code = 0.0d0
                                                                      end function
                                                                      
                                                                      public static double code(double g, double h, double a) {
                                                                      	return 0.0;
                                                                      }
                                                                      
                                                                      def code(g, h, a):
                                                                      	return 0.0
                                                                      
                                                                      function code(g, h, a)
                                                                      	return 0.0
                                                                      end
                                                                      
                                                                      function tmp = code(g, h, a)
                                                                      	tmp = 0.0;
                                                                      end
                                                                      
                                                                      code[g_, h_, a_] := 0.0
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      0
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Initial program 40.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto -\sqrt[3]{\frac{\color{blue}{0} \cdot g}{a}} \cdot \sqrt[3]{\frac{1}{2}} \]
                                                                        11. mul0-lftN/A

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

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

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

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

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

                                                                      Reproduce

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