- Split input into 3 regimes
if b < -1.2708854266085412e+154
Initial program 60.9
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Initial simplification60.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
Taylor expanded around -inf 10.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{2 \cdot a}\\
\end{array}\]
if -1.2708854266085412e+154 < b < 3.574043840337914e+108
Initial program 8.7
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Initial simplification8.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt8.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(\sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c} \cdot \sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c}\right) \cdot \sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
Applied sqrt-prod8.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\sqrt{\sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c} \cdot \sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
Simplified8.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\left|\sqrt[3]{b \cdot b + a \cdot \left(-4 \cdot c\right)}\right|} \cdot \sqrt{\sqrt[3]{b \cdot b + \left(-4 \cdot a\right) \cdot c}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
if 3.574043840337914e+108 < b
Initial program 30.0
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Initial simplification30.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
Taylor expanded around inf 5.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\left(b - 2 \cdot \frac{a \cdot c}{b}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + \left(-4 \cdot a\right) \cdot c} - b}{2 \cdot a}\\
\end{array}\]
- Recombined 3 regimes into one program.
Final simplification8.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le -1.2708854266085412 \cdot 10^{+154}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\left(-4 \cdot a\right) \cdot c + b \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le 3.574043840337914 \cdot 10^{+108}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\sqrt[3]{\left(-4 \cdot a\right) \cdot c + b \cdot b}} \cdot \left|\sqrt[3]{b \cdot b + \left(-4 \cdot c\right) \cdot a}\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(-4 \cdot a\right) \cdot c + b \cdot b} - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \left(b - 2 \cdot \frac{a \cdot c}{b}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(-4 \cdot a\right) \cdot c + b \cdot b} - b}{2 \cdot a}\\
\end{array}\]