- Split input into 2 regimes
if (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj)))) < 1.719945733550579e-10
Initial program 18.8
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
Taylor expanded around 0 1.0
\[\leadsto \color{blue}{\left({wj}^{2} + x\right) - 2 \cdot \left(x \cdot wj\right)}\]
Simplified1.0
\[\leadsto \color{blue}{(wj \cdot \left((x \cdot -2 + wj)_*\right) + x)_*}\]
if 1.719945733550579e-10 < (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))
Initial program 2.2
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
- Using strategy
rm Applied div-sub2.2
\[\leadsto wj - \color{blue}{\left(\frac{wj \cdot e^{wj}}{e^{wj} + wj \cdot e^{wj}} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)}\]
Simplified0.3
\[\leadsto wj - \left(\color{blue}{\frac{wj}{1 + wj}} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]
- Using strategy
rm Applied div-inv0.3
\[\leadsto wj - \left(\frac{wj}{1 + wj} - \color{blue}{x \cdot \frac{1}{e^{wj} + wj \cdot e^{wj}}}\right)\]
Applied flip3-+0.3
\[\leadsto wj - \left(\frac{wj}{\color{blue}{\frac{{1}^{3} + {wj}^{3}}{1 \cdot 1 + \left(wj \cdot wj - 1 \cdot wj\right)}}} - x \cdot \frac{1}{e^{wj} + wj \cdot e^{wj}}\right)\]
Applied associate-/r/0.3
\[\leadsto wj - \left(\color{blue}{\frac{wj}{{1}^{3} + {wj}^{3}} \cdot \left(1 \cdot 1 + \left(wj \cdot wj - 1 \cdot wj\right)\right)} - x \cdot \frac{1}{e^{wj} + wj \cdot e^{wj}}\right)\]
Applied prod-diff0.3
\[\leadsto wj - \color{blue}{\left((\left(\frac{wj}{{1}^{3} + {wj}^{3}}\right) \cdot \left(1 \cdot 1 + \left(wj \cdot wj - 1 \cdot wj\right)\right) + \left(-\frac{1}{e^{wj} + wj \cdot e^{wj}} \cdot x\right))_* + (\left(-\frac{1}{e^{wj} + wj \cdot e^{wj}}\right) \cdot x + \left(\frac{1}{e^{wj} + wj \cdot e^{wj}} \cdot x\right))_*\right)}\]
Applied associate--r+0.3
\[\leadsto \color{blue}{\left(wj - (\left(\frac{wj}{{1}^{3} + {wj}^{3}}\right) \cdot \left(1 \cdot 1 + \left(wj \cdot wj - 1 \cdot wj\right)\right) + \left(-\frac{1}{e^{wj} + wj \cdot e^{wj}} \cdot x\right))_*\right) - (\left(-\frac{1}{e^{wj} + wj \cdot e^{wj}}\right) \cdot x + \left(\frac{1}{e^{wj} + wj \cdot e^{wj}} \cdot x\right))_*}\]
Simplified0.3
\[\leadsto \left(wj - (\left(\frac{wj}{{1}^{3} + {wj}^{3}}\right) \cdot \left(1 \cdot 1 + \left(wj \cdot wj - 1 \cdot wj\right)\right) + \left(-\frac{1}{e^{wj} + wj \cdot e^{wj}} \cdot x\right))_*\right) - \color{blue}{0}\]
- Recombined 2 regimes into one program.
Final simplification0.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;\frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}} \le 1.719945733550579 \cdot 10^{-10}:\\
\;\;\;\;(wj \cdot \left((x \cdot -2 + wj)_*\right) + x)_*\\
\mathbf{else}:\\
\;\;\;\;wj - (\left(\frac{wj}{1 + {wj}^{3}}\right) \cdot \left(\left(wj \cdot wj - wj\right) + 1\right) + \left(x \cdot \frac{-1}{e^{wj} + wj \cdot e^{wj}}\right))_*\\
\end{array}\]