- Split input into 3 regimes
if x < -0.028431976646957072
Initial program 1.1
\[\frac{1 - \cos x}{x \cdot x}\]
- Using strategy
rm Applied add-sqr-sqrt1.2
\[\leadsto \frac{\color{blue}{\sqrt{1 - \cos x} \cdot \sqrt{1 - \cos x}}}{x \cdot x}\]
Applied times-frac0.6
\[\leadsto \color{blue}{\frac{\sqrt{1 - \cos x}}{x} \cdot \frac{\sqrt{1 - \cos x}}{x}}\]
if -0.028431976646957072 < x < 0.032105177177255154
Initial program 61.4
\[\frac{1 - \cos x}{x \cdot x}\]
Taylor expanded around 0 0.0
\[\leadsto \color{blue}{\left(\frac{1}{720} \cdot {x}^{4} + \frac{1}{2}\right) - \frac{1}{24} \cdot {x}^{2}}\]
Simplified0.0
\[\leadsto \color{blue}{(\frac{1}{720} \cdot \left({x}^{4}\right) + \frac{1}{2})_* - \left(x \cdot x\right) \cdot \frac{1}{24}}\]
if 0.032105177177255154 < x
Initial program 1.0
\[\frac{1 - \cos x}{x \cdot x}\]
- Recombined 3 regimes into one program.
Final simplification0.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -0.028431976646957072:\\
\;\;\;\;\frac{\sqrt{1 - \cos x}}{x} \cdot \frac{\sqrt{1 - \cos x}}{x}\\
\mathbf{elif}\;x \le 0.032105177177255154:\\
\;\;\;\;(\frac{1}{720} \cdot \left({x}^{4}\right) + \frac{1}{2})_* - \left(x \cdot x\right) \cdot \frac{1}{24}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos x}{x \cdot x}\\
\end{array}\]