- Split input into 2 regimes
if b < -4.0166768154845291e106 or 1.451640594726255e74 < b
Initial program 34.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}\]
Taylor expanded around inf 21.2
\[\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}\]
Simplified18.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(c \cdot \frac{a}{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}\]
Taylor expanded around -inf 5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(c \cdot \frac{a}{b}\right) + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}{2 \cdot a}\\
\end{array}\]
Simplified3.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(c \cdot \frac{a}{b}\right) + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \left(c \cdot \left(2 \cdot \frac{a}{b}\right) - b\right)}{2 \cdot a}\\
\end{array}\]
if -4.0166768154845291e106 < b < 1.451640594726255e74
Initial program 9.7
\[\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 add-cube-cbrt10.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right) \cdot \sqrt[3]{\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}\]
Simplified10.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}\right)} \cdot \sqrt[3]{\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}\]
Simplified10.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}\right) \cdot \color{blue}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\]
- Recombined 2 regimes into one program.
Final simplification7.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le -4.0166768154845291 \cdot 10^{106} \lor \neg \left(b \le 1.451640594726255 \cdot 10^{74}\right):\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(c \cdot \frac{a}{b}\right) + b \cdot -2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(c \cdot \left(2 \cdot \frac{a}{b}\right) - b\right) - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}} \cdot \left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{2 \cdot a}\\
\end{array}\]