\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \tan \left(\frac{x}{2}\right)}{x}double f(double x) {
double r372853 = 1.0;
double r372854 = x;
double r372855 = cos(r372854);
double r372856 = r372853 - r372855;
double r372857 = r372854 * r372854;
double r372858 = r372856 / r372857;
return r372858;
}
double f(double x) {
double r372859 = x;
double r372860 = sin(r372859);
double r372861 = r372860 / r372859;
double r372862 = 2.0;
double r372863 = r372859 / r372862;
double r372864 = tan(r372863);
double r372865 = r372861 * r372864;
double r372866 = r372865 / r372859;
return r372866;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Simplified15.6
rmApplied *-un-lft-identity15.6
Applied times-frac15.6
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied associate-*r/0.1
Final simplification0.1
herbie shell --seed 2019156
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))