- Split input into 2 regimes
if x < -0.6978818580996201
Initial program 0.0
\[\frac{e^{x}}{e^{x} - 1}\]
- Using strategy
rm Applied expm1-def0.0
\[\leadsto \frac{e^{x}}{\color{blue}{(e^{x} - 1)^*}}\]
- Using strategy
rm Applied expm1-log1p-u0.0
\[\leadsto \color{blue}{(e^{\log_* (1 + \frac{e^{x}}{(e^{x} - 1)^*})} - 1)^*}\]
if -0.6978818580996201 < x
Initial program 59.8
\[\frac{e^{x}}{e^{x} - 1}\]
- Using strategy
rm Applied expm1-def0.5
\[\leadsto \frac{e^{x}}{\color{blue}{(e^{x} - 1)^*}}\]
- Using strategy
rm Applied expm1-log1p-u34.7
\[\leadsto \color{blue}{(e^{\log_* (1 + \frac{e^{x}}{(e^{x} - 1)^*})} - 1)^*}\]
Taylor expanded around 0 35.0
\[\leadsto \color{blue}{\left(\frac{3}{2} \cdot \left(x \cdot e^{-\log x}\right) + \left(\frac{1}{12} \cdot \left({x}^{2} \cdot e^{-\log x}\right) + e^{-\log x}\right)\right) - 1}\]
Simplified1.0
\[\leadsto \color{blue}{\frac{1}{x} + (x \cdot \frac{1}{12} + \frac{1}{2})_*}\]
- Recombined 2 regimes into one program.
Final simplification0.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -0.6978818580996201:\\
\;\;\;\;(e^{\log_* (1 + \frac{e^{x}}{(e^{x} - 1)^*})} - 1)^*\\
\mathbf{else}:\\
\;\;\;\;(x \cdot \frac{1}{12} + \frac{1}{2})_* + \frac{1}{x}\\
\end{array}\]