\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 r46267 = 2.0;
double r46268 = x;
double r46269 = r46267 * r46268;
double r46270 = cos(r46269);
double r46271 = cos;
double r46272 = pow(r46271, r46267);
double r46273 = sin;
double r46274 = pow(r46273, r46267);
double r46275 = r46268 * r46274;
double r46276 = r46275 * r46268;
double r46277 = r46272 * r46276;
double r46278 = r46270 / r46277;
return r46278;
}
double f(double x, double cos, double sin) {
double r46279 = sin;
double r46280 = -6.355040469771924e-235;
bool r46281 = r46279 <= r46280;
double r46282 = 2.0;
double r46283 = x;
double r46284 = r46282 * r46283;
double r46285 = cos(r46284);
double r46286 = cos;
double r46287 = r46283 * r46286;
double r46288 = r46279 * r46287;
double r46289 = fabs(r46288);
double r46290 = 2.0;
double r46291 = pow(r46289, r46290);
double r46292 = r46285 / r46291;
double r46293 = 1.0;
double r46294 = pow(r46286, r46293);
double r46295 = pow(r46279, r46293);
double r46296 = r46294 * r46295;
double r46297 = pow(r46296, r46293);
double r46298 = r46297 * r46283;
double r46299 = fabs(r46298);
double r46300 = r46285 / r46299;
double r46301 = 1.0;
double r46302 = pow(r46299, r46301);
double r46303 = r46300 / r46302;
double r46304 = r46281 ? r46292 : r46303;
return r46304;
}



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
(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))))