- Split input into 2 regimes
if x < -0.00014496203119734307
Initial program 0.1
\[\frac{e^{x} - 1}{x}\]
Taylor expanded around inf 0.1
\[\leadsto \color{blue}{\frac{e^{x} - 1}{x}}\]
if -0.00014496203119734307 < x
Initial program 60.1
\[\frac{e^{x} - 1}{x}\]
Taylor expanded around 0 0.5
\[\leadsto \frac{\color{blue}{x + \left(\frac{1}{6} \cdot {x}^{3} + \frac{1}{2} \cdot {x}^{2}\right)}}{x}\]
Simplified0.5
\[\leadsto \frac{\color{blue}{x + \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) \cdot \left(x \cdot x\right)}}{x}\]
- Using strategy
rm Applied add-sqr-sqrt0.5
\[\leadsto \color{blue}{\sqrt{\frac{x + \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) \cdot \left(x \cdot x\right)}{x}} \cdot \sqrt{\frac{x + \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) \cdot \left(x \cdot x\right)}{x}}}\]
- Recombined 2 regimes into one program.
Final simplification0.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -0.00014496203119734307:\\
\;\;\;\;\frac{e^{x} - 1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + x}{x}} \cdot \sqrt{\frac{\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + x}{x}}\\
\end{array}\]