- Split input into 2 regimes
if g < 2.4451390686173556e-192
Initial program 35.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/35.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.4
\[\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)}\]
Simplified32.4
\[\leadsto \frac{\color{blue}{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}}{\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.6
\[\leadsto \frac{\sqrt[3]{\color{blue}{-1 \cdot g} - g}}{\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)}\]
Simplified31.6
\[\leadsto \frac{\sqrt[3]{\color{blue}{\left(-g\right)} - g}}{\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.4451390686173556e-192 < g
Initial program 34.4
\[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
- Using strategy
rm Applied associate-*l/34.4
\[\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-div34.3
\[\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)}\]
Simplified34.3
\[\leadsto \frac{\color{blue}{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}}{\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)}\]
- Using strategy
rm Applied cbrt-prod31.0
\[\leadsto \frac{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{2 \cdot a}} + \color{blue}{\sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}}\]
Simplified31.0
\[\leadsto \frac{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{2 \cdot a}} + \color{blue}{\sqrt[3]{\frac{\frac{1}{2}}{a}}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
- Using strategy
rm Applied add-cbrt-cube31.0
\[\leadsto \frac{\sqrt[3]{\color{blue}{\sqrt[3]{\left(\left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right) \cdot \left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right)\right) \cdot \left(\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g\right)}}}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{\frac{1}{2}}{a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
- Recombined 2 regimes into one program.
Final simplification31.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;g \le 2.4451390686173556 \cdot 10^{-192}:\\
\;\;\;\;\sqrt[3]{\left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right) \cdot \frac{1}{a \cdot 2}} + \frac{\sqrt[3]{\left(-g\right) - g}}{\sqrt[3]{a \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\sqrt[3]{\left(\left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right) \cdot \left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right)\right) \cdot \left(\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g\right)}}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \cdot \sqrt[3]{\frac{\frac{1}{2}}{a}}\\
\end{array}\]