- Split input into 4 regimes
if b < -2.17468008007162615e54
Initial program 39.4
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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 9.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.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}\]
Simplified5.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(c \cdot \frac{2}{b}\right) + b \cdot -2}{2 \cdot a}\\
\end{array}\]
if -2.17468008007162615e54 < b < -8.39637267994406e-301
Initial program 9.2
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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 flip--9.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \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}\]
Simplified9.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\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}\]
Simplified9.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{4 \cdot \left(a \cdot c\right)}{\color{blue}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
if -8.39637267994406e-301 < b < 7.9501412904844394e132
Initial program 8.0
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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 flip-+8.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\
\end{array}\]
Simplified8.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\
\end{array}\]
Simplified8.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a}\\
\end{array}\]
if 7.9501412904844394e132 < b
Initial program 33.6
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{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}\]
Simplified1.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{a \cdot \left(c \cdot \frac{2}{b}\right) + b \cdot -2}}\\
\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-cbrt1.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right)} \cdot \left(c \cdot \frac{2}{b}\right) + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Applied associate-*l*1.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(\sqrt[3]{a} \cdot \left(c \cdot \frac{2}{b}\right)\right)} + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
Simplified1.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \color{blue}{\left(c \cdot \left(\frac{2}{b} \cdot \sqrt[3]{a}\right)\right)} + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
- Recombined 4 regimes into one program.
Final simplification6.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le -2.17468008007162615 \cdot 10^{54}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(c \cdot \frac{2}{b}\right) + b \cdot -2}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le -8.39637267994406 \cdot 10^{-301}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{4 \cdot \left(c \cdot a\right)}{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le 7.9501412904844394 \cdot 10^{132}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(c \cdot a\right)}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{b \cdot -2 + \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(c \cdot \left(\frac{2}{b} \cdot \sqrt[3]{a}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\
\end{array}\]