- Split input into 2 regimes
if b < 1.1218716869064953e+100
Initial program 15.8
\[\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}\]
Simplified15.8
\[\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-sqr-sqrt40.5
\[\leadsto \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))_*} - \sqrt{b} \cdot \sqrt{b}}{2 \cdot a}\\
\end{array}\]
Applied add-cube-cbrt40.5
\[\leadsto \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{\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))_*}} - \sqrt{b} \cdot \sqrt{b}}{2 \cdot a}\\
\end{array}\]
Applied prod-diff40.5
\[\leadsto \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{(\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{b} \cdot \sqrt{b}\right))_* + (\left(-\sqrt{b}\right) \cdot \left(\sqrt{b}\right) + \left(\sqrt{b} \cdot \sqrt{b}\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified40.5
\[\leadsto \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{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + (\left(-\sqrt{b}\right) \cdot \left(\sqrt{b}\right) + \left(\sqrt{b} \cdot \sqrt{b}\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified15.8
\[\leadsto \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{\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-cbrt16.0
\[\leadsto \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{\left(\sqrt{\left(\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}\right) \cdot \sqrt[3]{(\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}\]
Applied sqrt-prod16.0
\[\leadsto \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{\left(\sqrt{\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(\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}\]
Applied fma-neg16.0
\[\leadsto \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{(\left(\sqrt{\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_* + \left(\left(-b\right) + b\right)}{2 \cdot a}\\
\end{array}\]
if 1.1218716869064953e+100 < b
Initial program 29.8
\[\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}\]
Simplified29.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-sqr-sqrt29.7
\[\leadsto \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))_*} - \sqrt{b} \cdot \sqrt{b}}{2 \cdot a}\\
\end{array}\]
Applied add-cube-cbrt29.7
\[\leadsto \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{\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))_*}} - \sqrt{b} \cdot \sqrt{b}}{2 \cdot a}\\
\end{array}\]
Applied prod-diff29.7
\[\leadsto \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{(\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{b} \cdot \sqrt{b}\right))_* + (\left(-\sqrt{b}\right) \cdot \left(\sqrt{b}\right) + \left(\sqrt{b} \cdot \sqrt{b}\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified29.7
\[\leadsto \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{\left(\sqrt{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} - b\right) + (\left(-\sqrt{b}\right) \cdot \left(\sqrt{b}\right) + \left(\sqrt{b} \cdot \sqrt{b}\right))_*}{2 \cdot a}\\
\end{array}\]
Simplified29.7
\[\leadsto \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{\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}\]
Taylor expanded around inf 6.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot 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}\]
Simplified2.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\frac{c}{b} \cdot a - b\right) \cdot 2}}\\
\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}\]
- Recombined 2 regimes into one program.
Final simplification12.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le 1.1218716869064953 \cdot 10^{+100}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(-4 \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + \left(-b\right)\right) + (\left(\sqrt{\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt[3]{(\left(-4 \cdot c\right) \cdot a + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(a \cdot \frac{c}{b} - b\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\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}\\
\end{array}\]