- Split input into 3 regimes
if sin < -7.477021423829115e-308
Initial program 27.2
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
Simplified3.0
\[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}}\]
- Using strategy
rm Applied cos-23.0
\[\leadsto \frac{\color{blue}{\cos x \cdot \cos x - \sin x \cdot \sin x}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
- Using strategy
rm Applied difference-of-squares3.0
\[\leadsto \frac{\color{blue}{\left(\cos x + \sin x\right) \cdot \left(\cos x - \sin x\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
if -7.477021423829115e-308 < sin < 9.850296288943132e-242 or 1.5137559334682638e+181 < sin
Initial program 30.9
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
Simplified6.6
\[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}}\]
Taylor expanded around inf 34.2
\[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{{x}^{2} \cdot \left({cos}^{2} \cdot {sin}^{2}\right)}}\]
Simplified3.3
\[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(cos \cdot \left(sin \cdot x\right)\right) \cdot \left(cos \cdot \left(sin \cdot x\right)\right)}}\]
if 9.850296288943132e-242 < sin < 1.5137559334682638e+181
Initial program 27.4
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
Simplified1.5
\[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}}\]
- Using strategy
rm Applied cos-21.6
\[\leadsto \frac{\color{blue}{\cos x \cdot \cos x - \sin x \cdot \sin x}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
- Using strategy
rm Applied flip3--1.6
\[\leadsto \frac{\color{blue}{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - {\left(\sin x \cdot \sin x\right)}^{3}}{\left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right) + \left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\sin x \cdot \sin x\right)\right)}}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
- Using strategy
rm Applied add-cbrt-cube1.7
\[\leadsto \frac{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - {\left(\sin x \cdot \color{blue}{\sqrt[3]{\left(\sin x \cdot \sin x\right) \cdot \sin x}}\right)}^{3}}{\left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right) + \left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\sin x \cdot \sin x\right)\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
Applied add-cbrt-cube1.8
\[\leadsto \frac{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - {\left(\color{blue}{\sqrt[3]{\left(\sin x \cdot \sin x\right) \cdot \sin x}} \cdot \sqrt[3]{\left(\sin x \cdot \sin x\right) \cdot \sin x}\right)}^{3}}{\left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right) + \left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\sin x \cdot \sin x\right)\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
Applied cbrt-unprod1.7
\[\leadsto \frac{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - {\color{blue}{\left(\sqrt[3]{\left(\left(\sin x \cdot \sin x\right) \cdot \sin x\right) \cdot \left(\left(\sin x \cdot \sin x\right) \cdot \sin x\right)}\right)}}^{3}}{\left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right) + \left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\sin x \cdot \sin x\right)\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
Applied rem-cube-cbrt1.6
\[\leadsto \frac{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - \color{blue}{\left(\left(\sin x \cdot \sin x\right) \cdot \sin x\right) \cdot \left(\left(\sin x \cdot \sin x\right) \cdot \sin x\right)}}{\left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right) + \left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\sin x \cdot \sin x\right)\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
- Recombined 3 regimes into one program.
Final simplification2.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;sin \le -7.477021423829115 \cdot 10^{-308}:\\
\;\;\;\;\frac{\left(\cos x - \sin x\right) \cdot \left(\sin x + \cos x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\\
\mathbf{elif}\;sin \le 9.850296288943132 \cdot 10^{-242}:\\
\;\;\;\;\frac{\cos \left(x \cdot 2\right)}{\left(\left(x \cdot sin\right) \cdot cos\right) \cdot \left(\left(x \cdot sin\right) \cdot cos\right)}\\
\mathbf{elif}\;sin \le 1.5137559334682638 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{{\left(\cos x \cdot \cos x\right)}^{3} - \left(\sin x \cdot \left(\sin x \cdot \sin x\right)\right) \cdot \left(\sin x \cdot \left(\sin x \cdot \sin x\right)\right)}{\left(\left(\sin x \cdot \sin x\right) \cdot \left(\sin x \cdot \sin x\right) + \left(\sin x \cdot \sin x\right) \cdot \left(\cos x \cdot \cos x\right)\right) + \left(\cos x \cdot \cos x\right) \cdot \left(\cos x \cdot \cos x\right)}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x \cdot 2\right)}{\left(\left(x \cdot sin\right) \cdot cos\right) \cdot \left(\left(x \cdot sin\right) \cdot cos\right)}\\
\end{array}\]