\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 r559789 = 1.0;
double r559790 = x;
double r559791 = cos(r559790);
double r559792 = r559789 - r559791;
double r559793 = r559790 * r559790;
double r559794 = r559792 / r559793;
return r559794;
}
double f(double x) {
double r559795 = x;
double r559796 = 2.0;
double r559797 = r559795 / r559796;
double r559798 = tan(r559797);
double r559799 = r559798 / r559795;
double r559800 = sin(r559795);
double r559801 = r559800 / r559795;
double r559802 = r559799 * r559801;
return r559802;
}



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