\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\begin{array}{l}
\mathbf{if}\;sin \le -6.35504046977192426 \cdot 10^{-235}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{{\left(\left|sin \cdot \left(x \cdot cos\right)\right|\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cos \left(2 \cdot x\right)}{\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|}}{{\left(\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|\right)}^{1}}\\
\end{array}double f(double x, double cos, double sin) {
double r61668 = 2.0;
double r61669 = x;
double r61670 = r61668 * r61669;
double r61671 = cos(r61670);
double r61672 = cos;
double r61673 = pow(r61672, r61668);
double r61674 = sin;
double r61675 = pow(r61674, r61668);
double r61676 = r61669 * r61675;
double r61677 = r61676 * r61669;
double r61678 = r61673 * r61677;
double r61679 = r61671 / r61678;
return r61679;
}
double f(double x, double cos, double sin) {
double r61680 = sin;
double r61681 = -6.355040469771924e-235;
bool r61682 = r61680 <= r61681;
double r61683 = 2.0;
double r61684 = x;
double r61685 = r61683 * r61684;
double r61686 = cos(r61685);
double r61687 = cos;
double r61688 = r61684 * r61687;
double r61689 = r61680 * r61688;
double r61690 = fabs(r61689);
double r61691 = 2.0;
double r61692 = pow(r61690, r61691);
double r61693 = r61686 / r61692;
double r61694 = 1.0;
double r61695 = pow(r61687, r61694);
double r61696 = pow(r61680, r61694);
double r61697 = r61695 * r61696;
double r61698 = pow(r61697, r61694);
double r61699 = r61698 * r61684;
double r61700 = fabs(r61699);
double r61701 = r61686 / r61700;
double r61702 = 1.0;
double r61703 = pow(r61700, r61702);
double r61704 = r61701 / r61703;
double r61705 = r61682 ? r61693 : r61704;
return r61705;
}



Bits error versus x



Bits error versus cos



Bits error versus sin
Results
if sin < -6.355040469771924e-235Initial program 26.4
rmApplied sqr-pow26.4
Applied associate-*r*20.8
rmApplied add-sqr-sqrt20.8
Simplified20.8
Simplified2.7
Taylor expanded around inf 2.6
Taylor expanded around 0 2.1
if -6.355040469771924e-235 < sin Initial program 29.7
rmApplied sqr-pow29.7
Applied associate-*r*23.4
rmApplied add-sqr-sqrt23.4
Simplified23.4
Simplified3.2
Taylor expanded around inf 2.9
rmApplied sqr-pow2.9
Applied associate-/r*2.6
Simplified2.6
Final simplification2.4
herbie shell --seed 2020027 +o rules:numerics
(FPCore (x cos sin)
:name "cos(2*x)/(cos^2(x)*sin^2(x))"
:precision binary64
(/ (cos (* 2 x)) (* (pow cos 2) (* (* x (pow sin 2)) x))))