\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 4.31466303447184707 \cdot 10^{-141} \lor \neg \left(sin \le 9.0399391425500038 \cdot 10^{268}\right):\\
\;\;\;\;\frac{1}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|} \cdot \left(\frac{1}{\sqrt{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|}} \cdot \frac{\cos \left(2 \cdot x\right)}{\sqrt{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{{\left(\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|\right)}^{2}}\\
\end{array}double code(double x, double cos, double sin) {
return (cos((2.0 * x)) / (pow(cos, 2.0) * ((x * pow(sin, 2.0)) * x)));
}
double code(double x, double cos, double sin) {
double temp;
if (((sin <= 4.314663034471847e-141) || !(sin <= 9.039939142550004e+268))) {
temp = ((1.0 / fabs((pow(cos, (2.0 / 2.0)) * (x * pow(sin, (2.0 / 2.0)))))) * ((1.0 / sqrt(fabs((pow(cos, (2.0 / 2.0)) * (x * pow(sin, (2.0 / 2.0))))))) * (cos((2.0 * x)) / sqrt(fabs((pow(cos, (2.0 / 2.0)) * (x * pow(sin, (2.0 / 2.0)))))))));
} else {
temp = (cos((2.0 * x)) / pow(fabs((pow((pow(cos, 1.0) * pow(sin, 1.0)), 1.0) * x)), 2.0));
}
return temp;
}



Bits error versus x



Bits error versus cos



Bits error versus sin
Results
if sin < 4.314663034471847e-141 or 9.039939142550004e+268 < sin Initial program 31.0
rmApplied sqr-pow31.0
Applied associate-*r*22.5
rmApplied add-sqr-sqrt22.6
Simplified22.5
Simplified3.0
rmApplied *-un-lft-identity3.0
Applied times-frac2.8
rmApplied add-sqr-sqrt2.9
Applied *-un-lft-identity2.9
Applied times-frac2.9
if 4.314663034471847e-141 < sin < 9.039939142550004e+268Initial program 22.7
rmApplied sqr-pow22.7
Applied associate-*r*20.0
rmApplied add-sqr-sqrt20.0
Simplified20.0
Simplified1.9
Taylor expanded around 0 2.6
Simplified2.6
Final simplification2.8
herbie shell --seed 2020057
(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))))