- Split input into 2 regimes
if b < 7.145891006680855e-06
Initial program 15.6
\[\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}\]
Simplified15.6
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}}\]
- Using strategy
rm Applied add-cube-cbrt15.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{\color{blue}{\left(\sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}\right) \cdot \sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}\]
Applied sqrt-prod15.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \color{blue}{\sqrt{\sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}\]
if 7.145891006680855e-06 < b
Initial program 30.9
\[\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}\]
Simplified30.9
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}}\]
Taylor expanded around inf 11.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}\]
Simplified7.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\color{blue}{\left(\frac{c}{b} \cdot a - b\right) \cdot 2}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}\]
Taylor expanded around 0 7.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt7.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\color{blue}{2 \cdot \left(\left(\sqrt[3]{\frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}} \cdot \sqrt[3]{\frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}}\right) \cdot \sqrt[3]{\frac{c}{\sqrt{(\left(-4 \cdot a\right) \cdot c + \left(b \cdot b\right))_*} - b}}\right)}\\
\end{array}\]
- Recombined 2 regimes into one program.
Final simplification13.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le 7.145891006680855 \cdot 10^{-06}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{\sqrt[3]{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*}}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{\sqrt{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*} - b} \cdot 2\\
\end{array}\\
\mathbf{elif}\;b \ge 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt[3]{\frac{c}{\sqrt{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*} - b}} \cdot \sqrt[3]{\frac{c}{\sqrt{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*} - b}}\right) \cdot \sqrt[3]{\frac{c}{\sqrt{(\left(a \cdot -4\right) \cdot c + \left(b \cdot b\right))_*} - b}}\right) \cdot 2\\
\end{array}\]