\frac{1 - \cos x}{x \cdot x}\frac{\frac{\tan \left(\frac{x}{2}\right)}{x} \cdot \sin x}{x}double f(double x) {
double r383336 = 1.0;
double r383337 = x;
double r383338 = cos(r383337);
double r383339 = r383336 - r383338;
double r383340 = r383337 * r383337;
double r383341 = r383339 / r383340;
return r383341;
}
double f(double x) {
double r383342 = x;
double r383343 = 2.0;
double r383344 = r383342 / r383343;
double r383345 = tan(r383344);
double r383346 = r383345 / r383342;
double r383347 = sin(r383342);
double r383348 = r383346 * r383347;
double r383349 = r383348 / r383342;
return r383349;
}



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