- Split input into 2 regimes
if g < 4.54756140803492154e-163
Initial program 37.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)}\]
Simplified37.0
\[\leadsto \color{blue}{\sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}}\]
- Using strategy
rm Applied associate-*r/37.0
\[\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]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\]
Applied cbrt-div33.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]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\]
Simplified33.3
\[\leadsto \frac{\color{blue}{\sqrt[3]{1 \cdot \left(\sqrt{g \cdot g - h \cdot h} + \left(-g\right)\right)}}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\]
Taylor expanded around -inf 32.4
\[\leadsto \frac{\sqrt[3]{1 \cdot \left(\color{blue}{-1 \cdot g} + \left(-g\right)\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\]
Simplified32.4
\[\leadsto \frac{\sqrt[3]{1 \cdot \left(\color{blue}{\left(-g\right)} + \left(-g\right)\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\]
if 4.54756140803492154e-163 < 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)}\]
Simplified34.8
\[\leadsto \color{blue}{\sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}}\]
- Using strategy
rm Applied associate-*r/34.8
\[\leadsto \sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \sqrt[3]{\color{blue}{\frac{1 \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}{2 \cdot a}}}\]
Applied cbrt-div31.2
\[\leadsto \sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \color{blue}{\frac{\sqrt[3]{1 \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}}{\sqrt[3]{2 \cdot a}}}\]
- Using strategy
rm Applied add-cube-cbrt31.2
\[\leadsto \sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \frac{\sqrt[3]{1 \cdot \left(\left(-g\right) - \sqrt{\color{blue}{\left(\sqrt[3]{g \cdot g - h \cdot h} \cdot \sqrt[3]{g \cdot g - h \cdot h}\right) \cdot \sqrt[3]{g \cdot g - h \cdot h}}}\right)}}{\sqrt[3]{2 \cdot a}}\]
Applied sqrt-prod31.2
\[\leadsto \sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \frac{\sqrt[3]{1 \cdot \left(\left(-g\right) - \color{blue}{\sqrt{\sqrt[3]{g \cdot g - h \cdot h} \cdot \sqrt[3]{g \cdot g - h \cdot h}} \cdot \sqrt{\sqrt[3]{g \cdot g - h \cdot h}}}\right)}}{\sqrt[3]{2 \cdot a}}\]
Simplified31.2
\[\leadsto \sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \frac{\sqrt[3]{1 \cdot \left(\left(-g\right) - \color{blue}{\left|\sqrt[3]{g \cdot g - h \cdot h}\right|} \cdot \sqrt{\sqrt[3]{g \cdot g - h \cdot h}}\right)}}{\sqrt[3]{2 \cdot a}}\]
- Recombined 2 regimes into one program.
Final simplification31.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;g \le 4.54756140803492154 \cdot 10^{-163}:\\
\;\;\;\;\frac{\sqrt[3]{1 \cdot \left(-\left(g + g\right)\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{1 \cdot \frac{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{1 \cdot \frac{\left(-g\right) + \sqrt{g \cdot g - h \cdot h}}{2 \cdot a}} + \frac{\sqrt[3]{1 \cdot \left(\left(-g\right) - \left|\sqrt[3]{g \cdot g - h \cdot h}\right| \cdot \sqrt{\sqrt[3]{g \cdot g - h \cdot h}}\right)}}{\sqrt[3]{2 \cdot a}}\\
\end{array}\]