\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}\;cos \le -2.614521882835997 \cdot 10^{-226}:\\
\;\;\;\;\frac{\frac{\cos \left(2 \cdot x\right)}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|}}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\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 ((cos <= -2.614521882835997e-226)) {
temp = ((cos((2.0 * x)) / fabs((pow(cos, (2.0 / 2.0)) * (x * pow(sin, (2.0 / 2.0)))))) / 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 cos < -2.614521882835997e-226Initial program 25.0
rmApplied sqr-pow25.0
Applied associate-*l*21.1
rmApplied sqr-pow21.1
Applied associate-*r*13.9
rmApplied add-sqr-sqrt14.0
Simplified13.9
Simplified2.0
rmApplied associate-/r*1.7
if -2.614521882835997e-226 < cos Initial program 30.5
rmApplied sqr-pow30.5
Applied associate-*l*25.1
rmApplied sqr-pow25.1
Applied associate-*r*18.1
rmApplied add-sqr-sqrt18.2
Simplified18.1
Simplified3.5
Taylor expanded around inf 3.2
Final simplification2.5
herbie shell --seed 2020056
(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))))