- Split input into 2 regimes
if x < -127880528.28648625 or 485.7282925563347 < x
Initial program 19.4
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
Taylor expanded around inf 0.5
\[\leadsto \color{blue}{2 \cdot \frac{1}{{x}^{7}} + \left(2 \cdot \frac{1}{{x}^{5}} + 2 \cdot \frac{1}{{x}^{3}}\right)}\]
Simplified0.5
\[\leadsto \color{blue}{2 \cdot \left(\frac{1}{{x}^{7}} + \left(\frac{1}{{x}^{5}} + \frac{1}{{x}^{3}}\right)\right)}\]
- Using strategy
rm Applied pow-flip0.0
\[\leadsto 2 \cdot \left(\frac{1}{{x}^{7}} + \left(\frac{1}{{x}^{5}} + \color{blue}{{x}^{\left(-3\right)}}\right)\right)\]
if -127880528.28648625 < x < 485.7282925563347
Initial program 0.3
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
- Using strategy
rm Applied frac-sub0.3
\[\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 pow10.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(\left(x + 1\right) \cdot x\right) \cdot \color{blue}{{\left(x - 1\right)}^{1}}}\]
Applied pow10.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(\left(x + 1\right) \cdot \color{blue}{{x}^{1}}\right) \cdot {\left(x - 1\right)}^{1}}\]
Applied pow10.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}{{\left(x + 1\right)}^{1}} \cdot {x}^{1}\right) \cdot {\left(x - 1\right)}^{1}}\]
Applied pow-prod-down0.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}{{\left(\left(x + 1\right) \cdot x\right)}^{1}} \cdot {\left(x - 1\right)}^{1}}\]
Applied pow-prod-down0.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}{{\left(\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)\right)}^{1}}}\]
Simplified0.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}{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot x\right)}}^{1}}\]
- Recombined 2 regimes into one program.
Final simplification0.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -127880528.286486253 \lor \neg \left(x \le 485.728292556334679\right):\\
\;\;\;\;2 \cdot \left(\frac{1}{{x}^{7}} + \left(\frac{1}{{x}^{5}} + {x}^{\left(-3\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\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)}^{1}}\\
\end{array}\]