- Split input into 2 regimes
if (- (/ 2 (+ 1 (exp (* -2 x)))) 1) < -1.0851674992178994e-07 or 5.414673710413268e-07 < (- (/ 2 (+ 1 (exp (* -2 x)))) 1)
Initial program 0.2
\[\frac{2}{1 + e^{-2 \cdot x}} - 1\]
- Using strategy
rm Applied add-sqr-sqrt0.2
\[\leadsto \frac{2}{\color{blue}{\sqrt{1 + e^{-2 \cdot x}} \cdot \sqrt{1 + e^{-2 \cdot x}}}} - 1\]
Applied associate-/r*0.2
\[\leadsto \color{blue}{\frac{\frac{2}{\sqrt{1 + e^{-2 \cdot x}}}}{\sqrt{1 + e^{-2 \cdot x}}}} - 1\]
if -1.0851674992178994e-07 < (- (/ 2 (+ 1 (exp (* -2 x)))) 1) < 5.414673710413268e-07
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}{\sqrt{1 + e^{-2 \cdot x}}}}{\sqrt{1 + e^{-2 \cdot x}}} - 1\\
\mathbf{elif}\;\frac{2}{1 + e^{-2 \cdot x}} - 1 \le 5.414673710413268 \cdot 10^{-07}:\\
\;\;\;\;\left(\frac{2}{15} \cdot {x}^{5} + x\right) - {x}^{3} \cdot \frac{1}{3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\sqrt{1 + e^{-2 \cdot x}}}}{\sqrt{1 + e^{-2 \cdot x}}} - 1\\
\end{array}\]