- Split input into 3 regimes
if b < -6.7010243280218965e+137
Initial program 54.4
\[\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 10.8
\[\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 simplify3.4
\[\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}}\]
- Using strategy
rm Applied div-inv3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\color{blue}{\left(2 \cdot c\right) \cdot \frac{1}{\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}\]
- Using strategy
rm Applied add-cube-cbrt3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\left(2 \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{\color{blue}{\left(\sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a} \cdot \sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a}\right) \cdot \sqrt[3]{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}\]
Applied sqrt-prod3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\left(2 \cdot c\right) \cdot \frac{1}{\left(-b\right) - \color{blue}{\sqrt{\sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a} \cdot \sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a}} \cdot \sqrt{\sqrt[3]{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}\]
Applied simplify3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\left(2 \cdot c\right) \cdot \frac{1}{\left(-b\right) - \color{blue}{\left|\sqrt[3]{b \cdot b - \left(4 \cdot a\right) \cdot c}\right|} \cdot \sqrt{\sqrt[3]{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 -6.7010243280218965e+137 < b < 3.886056802074871e+72
Initial program 8.8
\[\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-cube-cbrt9.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{\left(-b\right) + \sqrt{\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}}}{2 \cdot a}\\
\end{array}\]
Applied sqrt-prod9.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{\left(-b\right) + \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}}}{2 \cdot a}\\
\end{array}\]
Applied simplify9.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{\left(-b\right) + \left|\sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a}\right| \cdot \sqrt{\sqrt[3]{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\
\end{array}\]
if 3.886056802074871e+72 < b
Initial program 27.1
\[\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.0
\[\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 simplify2.4
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{c}{b} - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-4 \cdot \left(c \cdot a\right) + b \cdot b} - b}{2 \cdot a}\\
\end{array}}\]
- Recombined 3 regimes into one program.
Applied simplify6.6
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \le -6.7010243280218965 \cdot 10^{+137}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\left(c \cdot 2\right) \cdot \frac{1}{\left(-b\right) - \sqrt{\sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a}} \cdot \left|\sqrt[3]{b \cdot b - \left(4 \cdot a\right) \cdot c}\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} - \frac{b + b}{a \cdot 2}\\
\end{array}\\
\mathbf{if}\;b \le 3.886056802074871 \cdot 10^{+72}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt[3]{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \left|\sqrt[3]{b \cdot b - \left(4 \cdot c\right) \cdot a}\right|}{a \cdot 2}\\
\end{array}\\
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{c}{b} - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)} - b}{a \cdot 2}\\
\end{array}}\]