- Split input into 2 regimes
if x < -2.4836564107365167 or 2.4173513547348295 < x
Initial program 0.0
\[\frac{x - \sin x}{x - \tan x}\]
Taylor expanded around inf 0.4
\[\leadsto \color{blue}{\left(1 + \left(\frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2} \cdot {x}^{2}} + \frac{\sin x}{\cos x \cdot x}\right)\right) - \left(\frac{\sin x}{x} + \frac{{\left(\sin x\right)}^{2}}{\cos x \cdot {x}^{2}}\right)}\]
Simplified0.4
\[\leadsto \color{blue}{\left(\left(\frac{\frac{\sin x}{\cos x}}{x} - \frac{\sin x}{x}\right) - \left(\frac{\sin x}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x} + -1\right)\right) + \frac{\frac{\sin x}{\cos x}}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x}}\]
if -2.4836564107365167 < x < 2.4173513547348295
Initial program 62.5
\[\frac{x - \sin x}{x - \tan x}\]
Taylor expanded around 0 0.2
\[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
Simplified0.2
\[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800} + \frac{1}{2}\right)}\]
- Using strategy
rm Applied associate--r+0.2
\[\leadsto \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{9}{40} - \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}}\]
- Recombined 2 regimes into one program.
Final simplification0.3
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -2.4836564107365167:\\
\;\;\;\;\left(\left(\frac{\frac{\sin x}{\cos x}}{x} - \frac{\sin x}{x}\right) - \left(-1 + \frac{\sin x}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x}\right)\right) + \frac{\frac{\sin x}{\cos x}}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x}\\
\mathbf{elif}\;x \le 2.4173513547348295:\\
\;\;\;\;\left(\frac{9}{40} \cdot \left(x \cdot x\right) - \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\frac{\sin x}{\cos x}}{x} - \frac{\sin x}{x}\right) - \left(-1 + \frac{\sin x}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x}\right)\right) + \frac{\frac{\sin x}{\cos x}}{x} \cdot \frac{\frac{\sin x}{\cos x}}{x}\\
\end{array}\]