- Split input into 2 regimes
if x < -93901838.54092976 or 1037.5541891955904 < x
Initial program 19.1
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
- Using strategy
rm Applied frac-sub52.2
\[\leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 2}{\left(x + 1\right) \cdot x}} + \frac{1}{x - 1}\]
Applied frac-add50.7
\[\leadsto \color{blue}{\frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}}\]
- Using strategy
rm Applied flip-+50.7
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}} \cdot x\right) \cdot \left(x - 1\right)}\]
Applied associate-*l/50.7
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\color{blue}{\frac{\left(x \cdot x - 1 \cdot 1\right) \cdot x}{x - 1}} \cdot \left(x - 1\right)}\]
Applied associate-*l/50.7
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\color{blue}{\frac{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)}{x - 1}}}\]
Applied associate-/r/50.7
\[\leadsto \color{blue}{\frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)} \cdot \left(x - 1\right)}\]
Taylor expanded around inf 0.6
\[\leadsto \color{blue}{2 \cdot \frac{1}{{x}^{7}} + \left(2 \cdot \frac{1}{{x}^{3}} + 2 \cdot \frac{1}{{x}^{5}}\right)}\]
Simplified0.1
\[\leadsto \color{blue}{\left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right) + \frac{\frac{2}{x}}{x \cdot x}}\]
if -93901838.54092976 < x < 1037.5541891955904
Initial program 0.4
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
- Using strategy
rm Applied frac-sub0.4
\[\leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 2}{\left(x + 1\right) \cdot x}} + \frac{1}{x - 1}\]
Applied frac-add0.0
\[\leadsto \color{blue}{\frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}}\]
- Using strategy
rm Applied flip-+0.0
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}} \cdot x\right) \cdot \left(x - 1\right)}\]
Applied associate-*l/0.0
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\color{blue}{\frac{\left(x \cdot x - 1 \cdot 1\right) \cdot x}{x - 1}} \cdot \left(x - 1\right)}\]
Applied associate-*l/0.0
\[\leadsto \frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\color{blue}{\frac{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)}{x - 1}}}\]
Applied associate-/r/0.0
\[\leadsto \color{blue}{\frac{\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)} \cdot \left(x - 1\right)}\]
- Using strategy
rm Applied associate-*l/0.0
\[\leadsto \color{blue}{\frac{\left(\left(1 \cdot x - \left(x + 1\right) \cdot 2\right) \cdot \left(x - 1\right) + \left(\left(x + 1\right) \cdot x\right) \cdot 1\right) \cdot \left(x - 1\right)}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)}}\]
Simplified0.0
\[\leadsto \frac{\color{blue}{\left(x \cdot \left(\left(x + 1\right) + \left(-1 + x\right)\right) - \left(-1 + x\right) \cdot \left(2 + x \cdot 2\right)\right) \cdot \left(-1 + x\right)}}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right) \cdot \left(x - 1\right)}\]
- Recombined 2 regimes into one program.
Final simplification0.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -93901838.54092976 \lor \neg \left(x \le 1037.5541891955904\right):\\
\;\;\;\;\frac{\frac{2}{x}}{x \cdot x} + \left(\frac{2}{{x}^{7}} + \frac{2}{{x}^{5}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(1 + x\right) + \left(x + -1\right)\right) \cdot x - \left(2 + 2 \cdot x\right) \cdot \left(x + -1\right)\right) \cdot \left(x + -1\right)}{\left(\left(x \cdot x - 1\right) \cdot x\right) \cdot \left(x - 1\right)}\\
\end{array}\]