- Split input into 3 regimes
if (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x))) < -1.3739957811489437e-16
Initial program 1.2
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
Taylor expanded around 0 3.7
\[\leadsto \frac{x}{x + 1} - \color{blue}{\left(-\left(2 \cdot {x}^{2} + \left(1 + 2 \cdot x\right)\right)\right)}\]
Applied simplify3.7
\[\leadsto \color{blue}{\left(\left(x \cdot 2\right) \cdot \left(1 + x\right) + \frac{x}{1 + x}\right) + 1}\]
if -1.3739957811489437e-16 < (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x))) < 6.1000639342661295e-09
Initial program 60.3
\[\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 6.1000639342661295e-09 < (- (/ (- 3) x) (/ (+ 1 (/ 3 x)) (* x x)))
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}\]
- Recombined 3 regimes into one program.
Applied simplify1.1
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x} \le -1.3739957811489437 \cdot 10^{-16}:\\
\;\;\;\;1 + \left(\frac{x}{1 + x} + \left(x \cdot 2\right) \cdot \left(1 + x\right)\right)\\
\mathbf{if}\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x} \le 6.1000639342661295 \cdot 10^{-09}:\\
\;\;\;\;\frac{-3}{x} - \frac{1 + \frac{3}{x}}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + {x}^{3}} \cdot \left(\left(1 - x\right) + x \cdot x\right) - \frac{1 + x}{x - 1}\\
\end{array}}\]