- Split input into 2 regimes
if x < -0.06333461761244252 or 0.06506667365090828 < x
Initial program 0.0
\[\frac{x - \sin x}{x - \tan x}\]
- Using strategy
rm Applied add-log-exp0.0
\[\leadsto \color{blue}{\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)}\]
- Using strategy
rm Applied div-sub0.1
\[\leadsto \log \left(e^{\color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}}\right)\]
Applied exp-diff0.1
\[\leadsto \log \color{blue}{\left(\frac{e^{\frac{x}{x - \tan x}}}{e^{\frac{\sin x}{x - \tan x}}}\right)}\]
Applied log-div0.1
\[\leadsto \color{blue}{\log \left(e^{\frac{x}{x - \tan x}}\right) - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)}\]
Simplified0.1
\[\leadsto \color{blue}{\frac{x}{x - \tan x}} - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)\]
if -0.06333461761244252 < x < 0.06506667365090828
Initial program 62.6
\[\frac{x - \sin x}{x - \tan x}\]
Taylor expanded around 0 0.0
\[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
Simplified0.0
\[\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.0
\[\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.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \le -0.06333461761244252:\\
\;\;\;\;\frac{x}{x - \tan x} - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)\\
\mathbf{elif}\;x \le 0.06506667365090828:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{x}{x - \tan x} - \log \left(e^{\frac{\sin x}{x - \tan x}}\right)\\
\end{array}\]