- Split input into 2 regimes
if x < 3.04088380892254773e-6
Initial program 58.9
\[\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\]
Taylor expanded around 0 1.0
\[\leadsto \color{blue}{\left(x + \frac{2}{15} \cdot {x}^{5}\right) - \frac{1}{3} \cdot {x}^{3}}\]
Simplified1.0
\[\leadsto \color{blue}{x + \left({x}^{5} \cdot \frac{2}{15} - \frac{1}{3} \cdot {x}^{3}\right)}\]
if 3.04088380892254773e-6 < x
Initial program 31.6
\[\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\]
- Using strategy
rm Applied tanh-undef0.1
\[\leadsto \color{blue}{\tanh x}\]
- Using strategy
rm Applied add-cbrt-cube0.3
\[\leadsto \color{blue}{\sqrt[3]{\left(\tanh x \cdot \tanh x\right) \cdot \tanh x}}\]
Simplified0.3
\[\leadsto \sqrt[3]{\color{blue}{{\left(\tanh x\right)}^{3}}}\]
- Recombined 2 regimes into one program.
Final simplification0.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le 3.04088380892254773 \cdot 10^{-6}:\\
\;\;\;\;x + \left({x}^{5} \cdot \frac{2}{15} - \frac{1}{3} \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\tanh x\right)}^{3}}\\
\end{array}\]