- Split input into 2 regimes
if x < -1.00639665183005644 or 13089.4086349961854 < x
Initial program 59.1
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
Taylor expanded around inf 0.6
\[\leadsto \color{blue}{-\left(1 \cdot \frac{1}{{x}^{2}} + \left(3 \cdot \frac{1}{x} + 3 \cdot \frac{1}{{x}^{3}}\right)\right)}\]
Simplified0.3
\[\leadsto \color{blue}{\left(\frac{-1}{{x}^{2}} - \frac{3}{x}\right) - \frac{3}{{x}^{3}}}\]
if -1.00639665183005644 < x < 13089.4086349961854
Initial program 0.1
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied add-sqr-sqrt0.1
\[\leadsto \frac{x}{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}} - \frac{x + 1}{x - 1}\]
Applied associate-/r*0.1
\[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{x + 1}}}{\sqrt{x + 1}}} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied frac-sub0.1
\[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{x + 1}} \cdot \left(x - 1\right) - \sqrt{x + 1} \cdot \left(x + 1\right)}{\sqrt{x + 1} \cdot \left(x - 1\right)}}\]
- Using strategy
rm Applied flip-+0.1
\[\leadsto \frac{\frac{x}{\sqrt{x + 1}} \cdot \left(x - 1\right) - \sqrt{x + 1} \cdot \color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied flip3-+0.1
\[\leadsto \frac{\frac{x}{\sqrt{x + 1}} \cdot \left(x - 1\right) - \sqrt{\color{blue}{\frac{{x}^{3} + {1}^{3}}{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}} \cdot \frac{x \cdot x - 1 \cdot 1}{x - 1}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied sqrt-div0.1
\[\leadsto \frac{\frac{x}{\sqrt{x + 1}} \cdot \left(x - 1\right) - \color{blue}{\frac{\sqrt{{x}^{3} + {1}^{3}}}{\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}} \cdot \frac{x \cdot x - 1 \cdot 1}{x - 1}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied frac-times0.1
\[\leadsto \frac{\frac{x}{\sqrt{x + 1}} \cdot \left(x - 1\right) - \color{blue}{\frac{\sqrt{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x - 1 \cdot 1\right)}{\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)}}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied flip--0.1
\[\leadsto \frac{\frac{x}{\sqrt{x + 1}} \cdot \color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}} - \frac{\sqrt{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x - 1 \cdot 1\right)}{\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied frac-times0.1
\[\leadsto \frac{\color{blue}{\frac{x \cdot \left(x \cdot x - 1 \cdot 1\right)}{\sqrt{x + 1} \cdot \left(x + 1\right)}} - \frac{\sqrt{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x - 1 \cdot 1\right)}{\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
Applied frac-sub0.1
\[\leadsto \frac{\color{blue}{\frac{\left(x \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)\right) - \left(\sqrt{x + 1} \cdot \left(x + 1\right)\right) \cdot \left(\sqrt{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x - 1 \cdot 1\right)\right)}{\left(\sqrt{x + 1} \cdot \left(x + 1\right)\right) \cdot \left(\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)\right)}}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\]
- Recombined 2 regimes into one program.
Final simplification0.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -1.00639665183005644 \lor \neg \left(x \le 13089.4086349961854\right):\\
\;\;\;\;\left(\frac{-1}{{x}^{2}} - \frac{3}{x}\right) - \frac{3}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot \left(x \cdot x - 1 \cdot 1\right)\right) \cdot \left(\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)\right) - \left(\sqrt{x + 1} \cdot \left(x + 1\right)\right) \cdot \left(\sqrt{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x - 1 \cdot 1\right)\right)}{\left(\sqrt{x + 1} \cdot \left(x + 1\right)\right) \cdot \left(\sqrt{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)} \cdot \left(x - 1\right)\right)}}{\sqrt{x + 1} \cdot \left(x - 1\right)}\\
\end{array}\]