- Split input into 3 regimes
if b < -1.897390286482158e+77
Initial program 27.5
\[\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}\]
Initial simplification27.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4} - b}\\
\end{array}\]
Taylor expanded around -inf 6.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{2 \cdot c}}{\left(2 \cdot \frac{a \cdot c}{b} - b\right) - b}\\
\end{array}\]
if -1.897390286482158e+77 < b < 6.842858387449497e+85
Initial program 9.8
\[\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}\]
Initial simplification9.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4} - b}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt10.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{2} \cdot c}{\sqrt{\left(\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4} \cdot \sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}\right) \cdot \sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}} - b}\\
\end{array}\]
Applied sqrt-prod10.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{2 \cdot c}}{\sqrt{\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4} \cdot \sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}} \cdot \sqrt{\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}} - b}\\
\end{array}\]
Simplified10.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{2} \cdot c}{\left|\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}\right| \cdot \sqrt{\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}} - b}\\
\end{array}\]
if 6.842858387449497e+85 < b
Initial program 42.8
\[\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}\]
Initial simplification42.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4} - b}\\
\end{array}\]
Taylor expanded around inf 11.3
\[\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}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4} - b}\\
\end{array}\]
- Recombined 3 regimes into one program.
Final simplification9.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le -1.897390286482158 \cdot 10^{+77}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(2 \cdot \frac{a \cdot c}{b} - b\right) - b}\\
\end{array}\\
\mathbf{elif}\;b \le 6.842858387449497 \cdot 10^{+85}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}} \cdot \left|\sqrt[3]{b \cdot b - \left(a \cdot c\right) \cdot 4}\right| - b}\\
\end{array}\\
\mathbf{elif}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 4} - b}\\
\end{array}\]