- Split input into 3 regimes
if (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))) < -5.201256207142199
Initial program 0.0
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
- Using strategy
rm Applied add-cube-cbrt1.4
\[\leadsto \left(\frac{1}{x + 1} - \frac{2}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}\right) + \frac{1}{x - 1}\]
Applied add-cube-cbrt2.2
\[\leadsto \left(\frac{1}{x + 1} - \frac{\color{blue}{\left(\sqrt[3]{2} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{2}}}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}\right) + \frac{1}{x - 1}\]
Applied times-frac2.4
\[\leadsto \left(\frac{1}{x + 1} - \color{blue}{\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt[3]{2}}{\sqrt[3]{x}}}\right) + \frac{1}{x - 1}\]
Applied flip-+2.4
\[\leadsto \left(\frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt[3]{2}}{\sqrt[3]{x}}\right) + \frac{1}{x - 1}\]
Applied associate-/r/2.4
\[\leadsto \left(\color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt[3]{2}}{\sqrt[3]{x}}\right) + \frac{1}{x - 1}\]
Applied prod-diff2.4
\[\leadsto \color{blue}{\left((\left(\frac{1}{x \cdot x - 1 \cdot 1}\right) \cdot \left(x - 1\right) + \left(-\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_* + (\left(-\frac{\sqrt[3]{2}}{\sqrt[3]{x}}\right) \cdot \left(\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \left(\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_*\right)} + \frac{1}{x - 1}\]
Applied associate-+l+2.4
\[\leadsto \color{blue}{(\left(\frac{1}{x \cdot x - 1 \cdot 1}\right) \cdot \left(x - 1\right) + \left(-\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_* + \left((\left(-\frac{\sqrt[3]{2}}{\sqrt[3]{x}}\right) \cdot \left(\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \left(\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_* + \frac{1}{x - 1}\right)}\]
Simplified0.0
\[\leadsto \color{blue}{\left(\frac{1}{x + 1} - \frac{2}{x}\right)} + \left((\left(-\frac{\sqrt[3]{2}}{\sqrt[3]{x}}\right) \cdot \left(\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \left(\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_* + \frac{1}{x - 1}\right)\]
if -5.201256207142199 < (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))) < 0.0
Initial program 19.0
\[\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}^{3}} + 2 \cdot \frac{1}{{x}^{5}}\right)}\]
Simplified0.2
\[\leadsto \color{blue}{\frac{2}{{x}^{7}} + \left(\frac{\frac{2}{x}}{x \cdot x} + \frac{2}{{x}^{5}}\right)}\]
if 0.0 < (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1)))
Initial program 1.3
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
- Using strategy
rm Applied frac-sub1.4
\[\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.9
\[\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)}}\]
Simplified1.4
\[\leadsto \frac{\color{blue}{(\left(x - (x \cdot 2 + 2)_*\right) \cdot \left(x - 1\right) + \left((x \cdot x + x)_*\right))_*}}{\left(\left(x + 1\right) \cdot x\right) \cdot \left(x - 1\right)}\]
Simplified1.4
\[\leadsto \frac{(\left(x - (x \cdot 2 + 2)_*\right) \cdot \left(x - 1\right) + \left((x \cdot x + x)_*\right))_*}{\color{blue}{(x \cdot x + -1)_* \cdot x}}\]
- Recombined 3 regimes into one program.
Final simplification0.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{1}{x - 1} + \left(\frac{1}{x + 1} - \frac{2}{x}\right) \le -5.201256207142199:\\
\;\;\;\;\left((\left(\frac{-\sqrt[3]{2}}{\sqrt[3]{x}}\right) \cdot \left(\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right) + \left(\frac{\sqrt[3]{2}}{\sqrt[3]{x}} \cdot \frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}\right))_* + \frac{1}{x - 1}\right) + \left(\frac{1}{x + 1} - \frac{2}{x}\right)\\
\mathbf{elif}\;\frac{1}{x - 1} + \left(\frac{1}{x + 1} - \frac{2}{x}\right) \le 0.0:\\
\;\;\;\;\left(\frac{2}{{x}^{5}} + \frac{\frac{2}{x}}{x \cdot x}\right) + \frac{2}{{x}^{7}}\\
\mathbf{else}:\\
\;\;\;\;\frac{(\left(x - (x \cdot 2 + 2)_*\right) \cdot \left(x - 1\right) + \left((x \cdot x + x)_*\right))_*}{(x \cdot x + -1)_* \cdot x}\\
\end{array}\]