\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 r1311371 = 1.0;
double r1311372 = x;
double r1311373 = cos(r1311372);
double r1311374 = r1311371 - r1311373;
double r1311375 = r1311372 * r1311372;
double r1311376 = r1311374 / r1311375;
return r1311376;
}
double f(double x) {
double r1311377 = x;
double r1311378 = 2.0;
double r1311379 = r1311377 / r1311378;
double r1311380 = tan(r1311379);
double r1311381 = r1311380 / r1311377;
double r1311382 = sin(r1311377);
double r1311383 = r1311382 / r1311377;
double r1311384 = r1311381 * r1311383;
return r1311384;
}



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