- Split input into 2 regimes
if x < -7.555708210933115e+64 or 262341.15373010334 < x
Initial program 59.9
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied add-log-exp59.9
\[\leadsto \color{blue}{\log \left(e^{\frac{x}{x + 1}}\right)} - \frac{x + 1}{x - 1}\]
Taylor expanded around inf 0.3
\[\leadsto \color{blue}{-\left(3 \cdot \frac{1}{{x}^{3}} + \left(\frac{1}{{x}^{2}} + 3 \cdot \frac{1}{x}\right)\right)}\]
Simplified0.0
\[\leadsto \color{blue}{(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_*}\]
if -7.555708210933115e+64 < x < 262341.15373010334
Initial program 5.0
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied frac-sub5.0
\[\leadsto \color{blue}{\frac{x \cdot \left(x - 1\right) - \left(x + 1\right) \cdot \left(x + 1\right)}{\left(x + 1\right) \cdot \left(x - 1\right)}}\]
Taylor expanded around inf 0.1
\[\leadsto \frac{\color{blue}{-\left(3 \cdot x + 1\right)}}{\left(x + 1\right) \cdot \left(x - 1\right)}\]
Simplified0.1
\[\leadsto \frac{\color{blue}{-(x \cdot 3 + 1)_*}}{\left(x + 1\right) \cdot \left(x - 1\right)}\]
- Recombined 2 regimes into one program.
Final simplification0.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -7.555708210933115 \cdot 10^{+64} \lor \neg \left(x \le 262341.15373010334\right):\\
\;\;\;\;(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_*\\
\mathbf{else}:\\
\;\;\;\;\frac{-(x \cdot 3 + 1)_*}{\left(x - 1\right) \cdot \left(1 + x\right)}\\
\end{array}\]