\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 r1010344 = 1.0;
double r1010345 = x;
double r1010346 = cos(r1010345);
double r1010347 = r1010344 - r1010346;
double r1010348 = r1010345 * r1010345;
double r1010349 = r1010347 / r1010348;
return r1010349;
}
double f(double x) {
double r1010350 = x;
double r1010351 = 2.0;
double r1010352 = r1010350 / r1010351;
double r1010353 = tan(r1010352);
double r1010354 = r1010353 / r1010350;
double r1010355 = sin(r1010350);
double r1010356 = r1010355 / r1010350;
double r1010357 = r1010354 * r1010356;
return r1010357;
}



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