- Split input into 3 regimes
if (fma (+ 1 (/ 3 x)) (/ (- 1) (* x x)) (/ (- 3) x)) < -2.783723314922549e-10
Initial program 0.4
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied *-un-lft-identity0.4
\[\leadsto \frac{x}{x + 1} - \frac{x + 1}{\color{blue}{1 \cdot \left(x - 1\right)}}\]
Applied add-sqr-sqrt0.5
\[\leadsto \frac{x}{x + 1} - \frac{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}{1 \cdot \left(x - 1\right)}\]
Applied times-frac0.5
\[\leadsto \frac{x}{x + 1} - \color{blue}{\frac{\sqrt{x + 1}}{1} \cdot \frac{\sqrt{x + 1}}{x - 1}}\]
if -2.783723314922549e-10 < (fma (+ 1 (/ 3 x)) (/ (- 1) (* x x)) (/ (- 3) x)) < 1.0585824989560083e-11
Initial program 60.1
\[\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}{(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_*}\]
if 1.0585824989560083e-11 < (fma (+ 1 (/ 3 x)) (/ (- 1) (* x x)) (/ (- 3) x))
Initial program 0.5
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
- Using strategy
rm Applied flip-+0.5
\[\leadsto \frac{x}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{x + 1}{x - 1}\]
Applied associate-/r/0.5
\[\leadsto \color{blue}{\frac{x}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{x + 1}{x - 1}\]
Applied fma-neg0.5
\[\leadsto \color{blue}{(\left(\frac{x}{x \cdot x - 1 \cdot 1}\right) \cdot \left(x - 1\right) + \left(-\frac{x + 1}{x - 1}\right))_*}\]
- Recombined 3 regimes into one program.
Applied simplify0.2
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_* \le -2.783723314922549 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{1 + x} - \frac{\sqrt{1 + x}}{1} \cdot \frac{\sqrt{1 + x}}{x - 1}\\
\mathbf{if}\;(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_* \le 1.0585824989560083 \cdot 10^{-11}:\\
\;\;\;\;(\left(1 + \frac{3}{x}\right) \cdot \left(\frac{-1}{x \cdot x}\right) + \left(\frac{-3}{x}\right))_*\\
\mathbf{else}:\\
\;\;\;\;(\left(\frac{x}{x \cdot x - 1}\right) \cdot \left(x - 1\right) + \left(\frac{-\left(1 + x\right)}{x - 1}\right))_*\\
\end{array}}\]