\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 r389384 = 1.0;
double r389385 = x;
double r389386 = cos(r389385);
double r389387 = r389384 - r389386;
double r389388 = r389385 * r389385;
double r389389 = r389387 / r389388;
return r389389;
}
double f(double x) {
double r389390 = x;
double r389391 = 2.0;
double r389392 = r389390 / r389391;
double r389393 = tan(r389392);
double r389394 = r389393 / r389390;
double r389395 = sin(r389390);
double r389396 = r389394 * r389395;
double r389397 = r389396 / r389390;
return r389397;
}



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)))