- Split input into 2 regimes
if g < 2.95838081055670043e-159
Initial program 36.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)}\]
- Using strategy
rm Applied associate-*l/36.6
\[\leadsto \sqrt[3]{\color{blue}{\frac{1 \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)}{2 \cdot a}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
Applied cbrt-div32.8
\[\leadsto \color{blue}{\frac{\sqrt[3]{1 \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)}}{\sqrt[3]{2 \cdot a}}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
Taylor expanded around -inf 31.7
\[\leadsto \frac{\sqrt[3]{1 \cdot \left(\left(-g\right) + \color{blue}{-1 \cdot g}\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
if 2.95838081055670043e-159 < g
Initial program 34.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)}\]
- Using strategy
rm Applied cbrt-prod31.3
\[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \color{blue}{\sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}}\]
- Using strategy
rm Applied flip-+31.2
\[\leadsto \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\frac{\left(-g\right) \cdot \left(-g\right) - \sqrt{g \cdot g - h \cdot h} \cdot \sqrt{g \cdot g - h \cdot h}}{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
Applied associate-*r/31.2
\[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) \cdot \left(-g\right) - \sqrt{g \cdot g - h \cdot h} \cdot \sqrt{g \cdot g - h \cdot h}\right)}{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
Applied cbrt-div31.2
\[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) \cdot \left(-g\right) - \sqrt{g \cdot g - h \cdot h} \cdot \sqrt{g \cdot g - h \cdot h}\right)}}{\sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
- Recombined 2 regimes into one program.
Final simplification31.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;g \le 2.95838081055670043 \cdot 10^{-159}:\\
\;\;\;\;\frac{\sqrt[3]{1 \cdot \left(\left(-g\right) + -1 \cdot g\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) \cdot \left(-g\right) - \sqrt{g \cdot g - h \cdot h} \cdot \sqrt{g \cdot g - h \cdot h}\right)}}{\sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\\
\end{array}\]