- Split input into 2 regimes
if (+ (/ (cbrt (- (sqrt (* (- g h) (+ h g))) g)) (cbrt (* 2 a))) (cbrt (* (/ 1 (* 2 a)) (/ (* h h) (- (sqrt (* (- g h) (+ h g))) g))))) < -1.9873215131330507e+182 or 4.110261436178516e+296 < (+ (/ (cbrt (- (sqrt (* (- g h) (+ h g))) g)) (cbrt (* 2 a))) (cbrt (* (/ 1 (* 2 a)) (/ (* h h) (- (sqrt (* (- g h) (+ h g))) g)))))
Initial program 43.1
\[\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/43.1
\[\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-div43.0
\[\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)}\]
Applied simplify43.0
\[\leadsto \frac{\color{blue}{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + 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)}\]
- Using strategy
rm Applied cbrt-prod40.7
\[\leadsto \frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + g\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}}}\]
- Using strategy
rm Applied flip--40.8
\[\leadsto \frac{\sqrt[3]{\color{blue}{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} \cdot \sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g \cdot g}{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g}}}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
Applied simplify40.5
\[\leadsto \frac{\sqrt[3]{\frac{\color{blue}{h \cdot \left(0 - h\right) + 0}}{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} + g}}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{1}{2 \cdot a}} \cdot \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}}\]
if -1.9873215131330507e+182 < (+ (/ (cbrt (- (sqrt (* (- g h) (+ h g))) g)) (cbrt (* 2 a))) (cbrt (* (/ 1 (* 2 a)) (/ (* h h) (- (sqrt (* (- g h) (+ h g))) g))))) < 4.110261436178516e+296
Initial program 17.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/17.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-div11.6
\[\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)}\]
Applied simplify11.6
\[\leadsto \frac{\color{blue}{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(h + 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)}\]
Taylor expanded around -inf 10.0
\[\leadsto \frac{\sqrt[3]{\color{blue}{\left(h - 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)}\]
Applied simplify10.0
\[\leadsto \color{blue}{\frac{\sqrt[3]{h - \left(g + g\right)}}{\sqrt[3]{2 \cdot a}} + \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(h + g\right) \cdot \left(g - h\right)}}{2 \cdot a}}}\]
- Recombined 2 regimes into one program.
Applied simplify31.0
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{1}{a \cdot 2} \cdot \frac{h \cdot h}{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} - g}} \le -1.9873215131330507 \cdot 10^{+182}:\\
\;\;\;\;\sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \cdot \sqrt[3]{\frac{1}{a \cdot 2}} + \frac{\sqrt[3]{\frac{h \cdot \left(-h\right)}{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} + g}}}{\sqrt[3]{a \cdot 2}}\\
\mathbf{if}\;\frac{\sqrt[3]{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{1}{a \cdot 2} \cdot \frac{h \cdot h}{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} - g}} \le 4.110261436178516 \cdot 10^{+296}:\\
\;\;\;\;\frac{\sqrt[3]{h - \left(g + g\right)}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g - h\right) \cdot \left(g + h\right)}}{a \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \cdot \sqrt[3]{\frac{1}{a \cdot 2}} + \frac{\sqrt[3]{\frac{h \cdot \left(-h\right)}{\sqrt{\left(g - h\right) \cdot \left(g + h\right)} + g}}}{\sqrt[3]{a \cdot 2}}\\
\end{array}}\]