- Split input into 3 regimes
if b < -3.9946331046807693e+152
Initial program 60.3
\[\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}\]
Taylor expanded around -inf 12.1
\[\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{\left(-b\right) + \left(2 \cdot \frac{c \cdot a}{b} - b\right)}{2 \cdot a}\\
\end{array}\]
Applied simplify2.8
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b + b}{a \cdot 2}\\
\end{array}}\]
if -3.9946331046807693e+152 < b < 8.799077088999076e+142
Initial program 7.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}\]
- Using strategy
rm Applied add-sqr-sqrt7.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \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}\]
Applied sqrt-prod8.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\sqrt{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \sqrt{\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}\]
if 8.799077088999076e+142 < b
Initial program 34.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}\]
Taylor expanded around inf 6.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Applied simplify1.7
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{c \cdot \frac{a}{b} - b}\\
\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.
Applied simplify6.2
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \le -3.9946331046807693 \cdot 10^{+152}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b + b}{a \cdot 2}\\
\end{array}\\
\mathbf{if}\;b \le 8.799077088999076 \cdot 10^{+142}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) - \sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}} \cdot \sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a \cdot 2}\\
\end{array}\\
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{\frac{a}{b} \cdot c - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\end{array}}\]