- Split input into 3 regimes
if (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x))) < -5.6229983398801587e-08
Initial program 0.3
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied flip3-+0.3
\[\leadsto \frac{x}{\color{blue}{\frac{{x}^{3} + {1}^{3}}{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}} - \frac{x + 1}{x - 1}\]
Applied associate-/r/0.3
\[\leadsto \color{blue}{\frac{x}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right)} - \frac{x + 1}{x - 1}\]
Applied simplify0.3
\[\leadsto \color{blue}{\frac{x}{1 + {x}^{3}}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right) - \frac{x + 1}{x - 1}\]
if -5.6229983398801587e-08 < (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x))) < 9.253383191458749e-20
Initial program 60.2
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
Taylor expanded around inf 0.3
\[\leadsto \color{blue}{-\left(3 \cdot \frac{1}{{x}^{3}} + \left(3 \cdot \frac{1}{x} + \frac{1}{{x}^{2}}\right)\right)}\]
Applied simplify0.0
\[\leadsto \color{blue}{\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x}}\]
if 9.253383191458749e-20 < (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x)))
Initial program 1.7
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied div-inv1.7
\[\leadsto \frac{x}{x + 1} - \color{blue}{\left(x + 1\right) \cdot \frac{1}{x - 1}}\]
- Using strategy
rm Applied flip-+1.7
\[\leadsto \frac{x}{x + 1} - \color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}} \cdot \frac{1}{x - 1}\]
Applied frac-times1.7
\[\leadsto \frac{x}{x + 1} - \color{blue}{\frac{\left(x \cdot x - 1 \cdot 1\right) \cdot 1}{\left(x - 1\right) \cdot \left(x - 1\right)}}\]
Applied frac-sub1.7
\[\leadsto \color{blue}{\frac{x \cdot \left(\left(x - 1\right) \cdot \left(x - 1\right)\right) - \left(x + 1\right) \cdot \left(\left(x \cdot x - 1 \cdot 1\right) \cdot 1\right)}{\left(x + 1\right) \cdot \left(\left(x - 1\right) \cdot \left(x - 1\right)\right)}}\]
Applied simplify1.7
\[\leadsto \frac{\color{blue}{\left(\left(x - 1\right) \cdot \left(x - 1\right)\right) \cdot x - \left(x - 1\right) \cdot \left(\left(1 + x\right) \cdot \left(1 + x\right)\right)}}{\left(x + 1\right) \cdot \left(\left(x - 1\right) \cdot \left(x - 1\right)\right)}\]
- Recombined 3 regimes into one program.
Applied simplify0.5
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x} \le -5.6229983398801587 \cdot 10^{-08}:\\
\;\;\;\;\frac{x}{1 + {x}^{3}} \cdot \left(x \cdot x + \left(1 - x\right)\right) - \frac{1 + x}{x - 1}\\
\mathbf{if}\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x} \le 9.253383191458749 \cdot 10^{-20}:\\
\;\;\;\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(x - 1\right) \cdot \left(x - 1\right)\right) \cdot x - \left(x - 1\right) \cdot \left(\left(1 + x\right) \cdot \left(1 + x\right)\right)}{\left(1 + x\right) \cdot \left(\left(x - 1\right) \cdot \left(x - 1\right)\right)}\\
\end{array}}\]