- Split input into 3 regimes
if (+ (fma (pow eps 3) (* x x) (* x (* eps eps))) eps) < -2.084504492194263e-45
Initial program 35.2
\[\tan \left(x + \varepsilon\right) - \tan x\]
- Using strategy
rm Applied tan-quot35.1
\[\leadsto \tan \left(x + \varepsilon\right) - \color{blue}{\frac{\sin x}{\cos x}}\]
Applied tan-sum9.6
\[\leadsto \color{blue}{\frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \tan \varepsilon}} - \frac{\sin x}{\cos x}\]
Applied frac-sub9.7
\[\leadsto \color{blue}{\frac{\left(\tan x + \tan \varepsilon\right) \cdot \cos x - \left(1 - \tan x \cdot \tan \varepsilon\right) \cdot \sin x}{\left(1 - \tan x \cdot \tan \varepsilon\right) \cdot \cos x}}\]
if -2.084504492194263e-45 < (+ (fma (pow eps 3) (* x x) (* x (* eps eps))) eps) < 2.1892169813184298e-07
Initial program 39.8
\[\tan \left(x + \varepsilon\right) - \tan x\]
Taylor expanded around 0 16.2
\[\leadsto \color{blue}{\varepsilon + \left({\varepsilon}^{3} \cdot {x}^{2} + {\varepsilon}^{2} \cdot x\right)}\]
Simplified16.2
\[\leadsto \color{blue}{(\left({\varepsilon}^{3}\right) \cdot \left(x \cdot x\right) + \left(x \cdot \left(\varepsilon \cdot \varepsilon\right)\right))_* + \varepsilon}\]
if 2.1892169813184298e-07 < (+ (fma (pow eps 3) (* x x) (* x (* eps eps))) eps)
Initial program 36.5
\[\tan \left(x + \varepsilon\right) - \tan x\]
- Using strategy
rm Applied tan-sum14.8
\[\leadsto \color{blue}{\frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \tan \varepsilon}} - \tan x\]
- Using strategy
rm Applied add-cbrt-cube14.9
\[\leadsto \frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \color{blue}{\sqrt[3]{\left(\tan \varepsilon \cdot \tan \varepsilon\right) \cdot \tan \varepsilon}}} - \tan x\]
Applied add-cbrt-cube14.9
\[\leadsto \frac{\tan x + \tan \varepsilon}{1 - \color{blue}{\sqrt[3]{\left(\tan x \cdot \tan x\right) \cdot \tan x}} \cdot \sqrt[3]{\left(\tan \varepsilon \cdot \tan \varepsilon\right) \cdot \tan \varepsilon}} - \tan x\]
Applied cbrt-unprod14.9
\[\leadsto \frac{\tan x + \tan \varepsilon}{1 - \color{blue}{\sqrt[3]{\left(\left(\tan x \cdot \tan x\right) \cdot \tan x\right) \cdot \left(\left(\tan \varepsilon \cdot \tan \varepsilon\right) \cdot \tan \varepsilon\right)}}} - \tan x\]
Simplified14.9
\[\leadsto \frac{\tan x + \tan \varepsilon}{1 - \sqrt[3]{\color{blue}{{\left(\tan \varepsilon \cdot \tan x\right)}^{3}}}} - \tan x\]
- Recombined 3 regimes into one program.
Final simplification14.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;\varepsilon + (\left({\varepsilon}^{3}\right) \cdot \left(x \cdot x\right) + \left(x \cdot \left(\varepsilon \cdot \varepsilon\right)\right))_* \le -2.084504492194263 \cdot 10^{-45}:\\
\;\;\;\;\frac{\left(\tan x + \tan \varepsilon\right) \cdot \cos x - \sin x \cdot \left(1 - \tan x \cdot \tan \varepsilon\right)}{\cos x \cdot \left(1 - \tan x \cdot \tan \varepsilon\right)}\\
\mathbf{elif}\;\varepsilon + (\left({\varepsilon}^{3}\right) \cdot \left(x \cdot x\right) + \left(x \cdot \left(\varepsilon \cdot \varepsilon\right)\right))_* \le 2.1892169813184298 \cdot 10^{-07}:\\
\;\;\;\;\varepsilon + (\left({\varepsilon}^{3}\right) \cdot \left(x \cdot x\right) + \left(x \cdot \left(\varepsilon \cdot \varepsilon\right)\right))_*\\
\mathbf{else}:\\
\;\;\;\;\frac{\tan x + \tan \varepsilon}{1 - \sqrt[3]{{\left(\tan x \cdot \tan \varepsilon\right)}^{3}}} - \tan x\\
\end{array}\]