\frac{1 - \cos x}{x \cdot x}\frac{\tan \left(\frac{x}{2}\right)}{x} \cdot \frac{\sin x}{x}double f(double x) {
double r701889 = 1.0;
double r701890 = x;
double r701891 = cos(r701890);
double r701892 = r701889 - r701891;
double r701893 = r701890 * r701890;
double r701894 = r701892 / r701893;
return r701894;
}
double f(double x) {
double r701895 = x;
double r701896 = 2.0;
double r701897 = r701895 / r701896;
double r701898 = tan(r701897);
double r701899 = r701898 / r701895;
double r701900 = sin(r701895);
double r701901 = r701900 / r701895;
double r701902 = r701899 * r701901;
return r701902;
}



Bits error versus x
Results
Initial program 31.3
rmApplied flip--31.4
Simplified15.7
rmApplied *-un-lft-identity15.7
Applied *-un-lft-identity15.7
Applied distribute-lft-out15.7
Applied times-frac15.7
Applied times-frac0.3
Simplified0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019128
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))