- Split input into 2 regimes
if wj < 5.982744081820541e-09
Initial program 13.6
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
Initial simplification13.6
\[\leadsto \frac{(\left(-wj\right) \cdot \left(e^{wj}\right) + x)_*}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*} + wj\]
Taylor expanded around 0 0.9
\[\leadsto \color{blue}{\left({wj}^{2} + x\right) - 2 \cdot \left(x \cdot wj\right)}\]
Simplified0.9
\[\leadsto \color{blue}{(\left(x \cdot 2\right) \cdot \left(-wj\right) + \left((wj \cdot wj + x)_*\right))_*}\]
if 5.982744081820541e-09 < wj
Initial program 23.3
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
Initial simplification23.3
\[\leadsto \frac{(\left(-wj\right) \cdot \left(e^{wj}\right) + x)_*}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*} + wj\]
- Using strategy
rm Applied div-inv23.4
\[\leadsto \color{blue}{(\left(-wj\right) \cdot \left(e^{wj}\right) + x)_* \cdot \frac{1}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*}} + wj\]
Applied fma-def23.4
\[\leadsto \color{blue}{(\left((\left(-wj\right) \cdot \left(e^{wj}\right) + x)_*\right) \cdot \left(\frac{1}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*}\right) + wj)_*}\]
- Using strategy
rm Applied log1p-expm1-u23.4
\[\leadsto (\left((\left(-wj\right) \cdot \left(e^{wj}\right) + x)_*\right) \cdot \color{blue}{\left(\log_* (1 + (e^{\frac{1}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*}} - 1)^*)\right)} + wj)_*\]
- Recombined 2 regimes into one program.
Final simplification1.5
\[\leadsto \begin{array}{l}
\mathbf{if}\;wj \le 5.982744081820541 \cdot 10^{-09}:\\
\;\;\;\;(\left(x \cdot 2\right) \cdot \left(-wj\right) + \left((wj \cdot wj + x)_*\right))_*\\
\mathbf{else}:\\
\;\;\;\;(\left((\left(-wj\right) \cdot \left(e^{wj}\right) + x)_*\right) \cdot \left(\log_* (1 + (e^{\frac{1}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*}} - 1)^*)\right) + wj)_*\\
\end{array}\]