- Split input into 4 regimes
if b < -4.91364093678162e+19
Initial program 23.2
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
Taylor expanded around -inf 7.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\color{blue}{\frac{2 \cdot c}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}\\
\end{array}\]
Applied simplify4.8
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{c \cdot \frac{a}{b} - b}\\
\end{array}}\]
- Using strategy
rm Applied add-cube-cbrt4.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{c \cdot \left(\left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right) \cdot \sqrt[3]{\frac{a}{b}}\right) - b}\\
\end{array}\]
Applied associate-*r*4.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{c}}{\left(c \cdot \left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right)\right) \cdot \sqrt[3]{\frac{a}{b}} - b}\\
\end{array}\]
if -4.91364093678162e+19 < b < 2.5816483238316505e-308
Initial program 9.8
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
Taylor expanded around inf 9.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \color{blue}{\left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
if 2.5816483238316505e-308 < b < 1.4697873794893179e+110
Initial program 9.3
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
Taylor expanded around -inf 9.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\color{blue}{\frac{2 \cdot c}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}\\
\end{array}\]
Applied simplify9.3
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{c \cdot \frac{a}{b} - b}\\
\end{array}}\]
- Using strategy
rm Applied add-cube-cbrt9.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{c \cdot \left(\left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right) \cdot \sqrt[3]{\frac{a}{b}}\right) - b}\\
\end{array}\]
Applied associate-*r*9.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{c}}{\left(c \cdot \left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right)\right) \cdot \sqrt[3]{\frac{a}{b}} - b}\\
\end{array}\]
if 1.4697873794893179e+110 < b
Initial program 46.4
\[\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
Taylor expanded around inf 9.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\]
Applied simplify3.5
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} \cdot 1 - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\
\end{array}}\]
- Using strategy
rm Applied add-sqr-sqrt3.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} \cdot 1 - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\color{blue}{\frac{2 \cdot c}{\sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b} \cdot \sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}}}\\
\end{array}\]
Applied times-frac3.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} \cdot 1 - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}} \cdot \frac{c}{\sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}}\\
\end{array}\]
- Recombined 4 regimes into one program.
Applied simplify7.2
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \le -4.91364093678162 \cdot 10^{+19}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{\sqrt[3]{\frac{a}{b}} \cdot \left(\left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right) \cdot c\right) - b}\\
\end{array}\\
\mathbf{if}\;b \le 2.5816483238316505 \cdot 10^{-308}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \left(b - \frac{a \cdot c}{b} \cdot 2\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}\\
\end{array}\\
\mathbf{if}\;b \le 1.4697873794893179 \cdot 10^{+110}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{\sqrt[3]{\frac{a}{b}} \cdot \left(\left(\sqrt[3]{\frac{a}{b}} \cdot \sqrt[3]{\frac{a}{b}}\right) \cdot c\right) - b}\\
\end{array}\\
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}} \cdot \frac{c}{\sqrt{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}}\\
\end{array}}\]