- Split input into 3 regimes
if y < -1.3586783136445643e+154
Initial program 63.6
\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\]
Simplified63.6
\[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\]
- Using strategy
rm Applied add-log-exp63.6
\[\leadsto \color{blue}{\log \left(e^{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\right)}\]
Taylor expanded around 0 0
\[\leadsto \color{blue}{-1}\]
if -1.3586783136445643e+154 < y < -3.367339207554822e-157 or 1.9223973886152454e-162 < y
Initial program 0.0
\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\]
Simplified0.0
\[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\]
- Using strategy
rm Applied add-log-exp0.0
\[\leadsto \color{blue}{\log \left(e^{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\right)}\]
if -3.367339207554822e-157 < y < 1.9223973886152454e-162
Initial program 28.5
\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\]
Simplified28.5
\[\leadsto \color{blue}{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\]
- Using strategy
rm Applied add-log-exp28.5
\[\leadsto \color{blue}{\log \left(e^{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\right)}\]
Taylor expanded around inf 15.3
\[\leadsto \color{blue}{1}\]
- Recombined 3 regimes into one program.
Final simplification5.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;y \le -1.3586783136445643 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -3.367339207554822 \cdot 10^{-157}:\\
\;\;\;\;\log \left(e^{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\right)\\
\mathbf{elif}\;y \le 1.9223973886152454 \cdot 10^{-162}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{\left(x - y\right) \cdot \left(y + x\right)}{(x \cdot x + \left(y \cdot y\right))_*}}\right)\\
\end{array}\]