- Split input into 3 regimes
if b < -1.71075788809424871e87
Initial program 30.1
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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}\]
Taylor expanded around inf 30.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{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.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}}{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}\]
Taylor expanded around -inf 7.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(-b\right) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}}\\
\end{array}\]
Simplified3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}}\\
\end{array}\]
Taylor expanded around 0 3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\color{blue}{1 \cdot \frac{c}{b} - 1 \cdot \frac{b}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}\\
\end{array}\]
Simplified3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\color{blue}{1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}\\
\end{array}\]
- Using strategy
rm Applied add-exp-log3.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \color{blue}{e^{\log \left(\frac{c}{b} - \frac{b}{a}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}\\
\end{array}\]
if -1.71075788809424871e87 < b < 2.3540792276628007e82
Initial program 9.2
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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}\]
Simplified9.3
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{2}{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}\\
\end{array}}\]
if 2.3540792276628007e82 < b
Initial program 43.8
\[\begin{array}{l}
\mathbf{if}\;b \ge 0.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}\]
Taylor expanded around inf 10.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{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}\]
Simplified4.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\color{blue}{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}}{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}\]
Taylor expanded around -inf 4.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(-b\right) + \left(2 \cdot \frac{a \cdot c}{b} - b\right)}}\\
\end{array}\]
Simplified4.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot \left(c \cdot \frac{a}{b}\right) - \left(b + b\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}}\\
\end{array}\]
Taylor expanded around 0 4.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\color{blue}{1 \cdot \frac{c}{b} - 1 \cdot \frac{b}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}\\
\end{array}\]
Simplified4.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\color{blue}{1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)}\\
\end{array}\]
- Using strategy
rm Applied add-exp-log4.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\color{blue}{\frac{2 \cdot c}{e^{\log \left(\left(-b\right) + \left(c \cdot \left(\frac{a}{b} \cdot 2\right) - b\right)\right)}}}\\
\end{array}\]
Simplified4.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\color{blue}{2 \cdot c}}{e^{\log \left(\left(-b\right) + \left(2 \cdot \left(c \cdot \frac{a}{b}\right) - b\right)\right)}}\\
\end{array}\]
- Recombined 3 regimes into one program.
Final simplification6.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;b \le -1.71075788809424871 \cdot 10^{87}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;1 \cdot e^{\log \left(\frac{c}{b} - \frac{b}{a}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) + \left(c \cdot \left(2 \cdot \frac{a}{b}\right) - b\right)}\\
\end{array}\\
\mathbf{elif}\;b \le 2.3540792276628007 \cdot 10^{82}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{2}{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot 2}{e^{\log \left(\left(-b\right) + \left(2 \cdot \left(c \cdot \frac{a}{b}\right) - b\right)\right)}}\\
\end{array}\]