- 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 fma-neg3.0
\[\leadsto \frac{\color{blue}{(\left(\cos x\right) \cdot \left(\cos x\right) + \left(-\sin x \cdot \sin 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 3.0
\[\leadsto \frac{\color{blue}{{\left(\cos x\right)}^{2} - {\left(\sin x\right)}^{2}}}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}\]
Simplified3.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.5441177336945428e+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.5441177336945428e+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 fma-neg1.6
\[\leadsto \frac{\color{blue}{(\left(\cos x\right) \cdot \left(\cos x\right) + \left(-\sin x \cdot \sin 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 add-log-exp1.6
\[\leadsto \frac{(\left(\cos x\right) \cdot \left(\cos x\right) + \left(-\color{blue}{\log \left(e^{\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(\sin x + \cos 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)}\\
\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.5441177336945428 \cdot 10^{+181}:\\
\;\;\;\;\frac{(\left(\cos x\right) \cdot \left(\cos x\right) + \left(-\log \left(e^{\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)}\\
\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}\]