- Split input into 2 regimes
if (- (/ 2 (+ 1 (exp (* -2 x)))) 1) < -1.0851674992178994e-07 or 5.9324951686377854e-08 < (- (/ 2 (+ 1 (exp (* -2 x)))) 1)
Initial program 0.2
\[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
- Using strategy
rm Applied flip--0.2
\[\leadsto \color{blue}{\frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - 1 \cdot 1}{\frac{2}{1 + e^{-2 \cdot x}} + 1}}\]
if -1.0851674992178994e-07 < (- (/ 2 (+ 1 (exp (* -2 x)))) 1) < 5.9324951686377854e-08
Initial program 59.8
\[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
Taylor expanded around 0 0
\[\leadsto \color{blue}{\left(x + \frac{2}{15} \cdot {x}^{5}\right) - \frac{1}{3} \cdot {x}^{3}}\]
- Recombined 2 regimes into one program.
Final simplification0.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{2}{1 + e^{-2 \cdot x}} - 1 \le -1.0851674992178994 \cdot 10^{-07}:\\
\;\;\;\;\frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - 1}{\frac{2}{1 + e^{-2 \cdot x}} + 1}\\
\mathbf{elif}\;\frac{2}{1 + e^{-2 \cdot x}} - 1 \le 5.9324951686377854 \cdot 10^{-08}:\\
\;\;\;\;\left(x + {x}^{5} \cdot \frac{2}{15}\right) - {x}^{3} \cdot \frac{1}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{1 + e^{-2 \cdot x}} \cdot \frac{2}{1 + e^{-2 \cdot x}} - 1}{\frac{2}{1 + e^{-2 \cdot x}} + 1}\\
\end{array}\]