- Split input into 2 regimes
if b < 7.145891006680855e-06
Initial program 17.7
\[\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}\]
Simplified17.7
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}}\]
- Using strategy
rm Applied add-cube-cbrt17.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(\sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}\right) \cdot \sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}\]
Applied sqrt-prod17.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\sqrt{\sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}\]
if 7.145891006680855e-06 < b
Initial program 22.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}\]
Simplified22.4
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}}\]
Taylor expanded around 0 5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}}{2 \cdot a}\\
\end{array}\]
Applied add-cube-cbrt5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} \cdot \sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}}{2 \cdot a}\\
\end{array}\]
Applied prod-diff5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{(\left(\sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} \cdot \sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt[3]{\sqrt{(-4 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-\sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right))_* + (\left(-\sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) + \left(\sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + (\left(-\sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) + \left(\sqrt[3]{b} \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + \left(\left(-b\right) + b\right)}{2 \cdot a}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt5.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + \left(\left(-b\right) + b\right)}{2 \cdot a}} \cdot \sqrt[3]{\frac{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + \left(\left(-b\right) + b\right)}{2 \cdot a}}\right) \cdot \sqrt[3]{\frac{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + \left(\left(-b\right) + b\right)}{2 \cdot a}}\\
\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{2 \cdot c}{\left(-b\right) - \sqrt{\sqrt[3]{(-4 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(-4 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(-4 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(-4 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*} - b}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\frac{\left(b + \left(-b\right)\right) + \left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right)}{2 \cdot a}} \cdot \left(\sqrt[3]{\frac{\left(b + \left(-b\right)\right) + \left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right)}{2 \cdot a}} \cdot \sqrt[3]{\frac{\left(b + \left(-b\right)\right) + \left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right)}{2 \cdot a}}\right)\\
\end{array}\]