- Split input into 2 regimes
if (if (>= b 0) (/ (* 2 c) (/ (* (* 4 c) a) (- (sqrt (fma (- c) (* 4 a) (* b b))) b))) (/ (- (sqrt (fma (* 4 a) (- c) (* b b))) b) (* a 2))) < -2.1205622766064206e+225 or 8.835097148549356e+217 < (if (>= b 0) (/ (* 2 c) (/ (* (* 4 c) a) (- (sqrt (fma (- c) (* 4 a) (* b b))) b))) (/ (- (sqrt (fma (* 4 a) (- c) (* b b))) b) (* a 2)))
Initial program 40.5
\[\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}\]
Applied simplify40.5
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array}}\]
Taylor expanded around 0 26.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array}\]
if -2.1205622766064206e+225 < (if (>= b 0) (/ (* 2 c) (/ (* (* 4 c) a) (- (sqrt (fma (- c) (* 4 a) (* b b))) b))) (/ (- (sqrt (fma (* 4 a) (- c) (* b b))) b) (* a 2))) < 8.835097148549356e+217
Initial program 1.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}\]
Applied simplify1.7
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array}}\]
- Using strategy
rm Applied add-sqr-sqrt1.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} - b}{a \cdot 2}\\
\end{array}\]
Applied sqrt-prod1.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} - b}{a \cdot 2}\\
\end{array}\]
- Using strategy
rm Applied add-cube-cbrt1.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt{\left(\sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}\right) \cdot \sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}} - b}{a \cdot 2}\\
\end{array}\]
Applied sqrt-prod1.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt{\sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}} - b}{a \cdot 2}\\
\end{array}\]
Applied simplify1.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\left|\sqrt[3]{(\left(-c\right) \cdot \left(a \cdot 4\right) + \left(b \cdot b\right))_*}\right| \cdot \sqrt{\sqrt[3]{(\left(4 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}} - b}{a \cdot 2}\\
\end{array}\]
- Recombined 2 regimes into one program.
Applied simplify13.1
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{a \cdot \left(c \cdot 4\right)}{\sqrt{(\left(-c\right) \cdot \left(a \cdot 4\right) + \left(b \cdot b\right))_*} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array} \le -2.1205622766064206 \cdot 10^{+225} \lor \neg \left(\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\frac{a \cdot \left(c \cdot 4\right)}{\sqrt{(\left(-c\right) \cdot \left(a \cdot 4\right) + \left(b \cdot b\right))_*} - b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array} \le 8.835097148549356 \cdot 10^{+217}\right):\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{a \cdot 2}\\
\end{array}\\
\mathbf{if}\;b \ge 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\sqrt{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\left|\sqrt[3]{(\left(-c\right) \cdot \left(a \cdot 4\right) + \left(b \cdot b\right))_*}\right| \cdot \sqrt{\sqrt[3]{(\left(a \cdot 4\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}} - b}{a \cdot 2}\\
\end{array}}\]