\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 r3369353 = 1.0;
double r3369354 = x;
double r3369355 = cos(r3369354);
double r3369356 = r3369353 - r3369355;
double r3369357 = r3369354 * r3369354;
double r3369358 = r3369356 / r3369357;
return r3369358;
}
double f(double x) {
double r3369359 = x;
double r3369360 = 2.0;
double r3369361 = r3369359 / r3369360;
double r3369362 = tan(r3369361);
double r3369363 = r3369362 / r3369359;
double r3369364 = sin(r3369359);
double r3369365 = r3369364 / r3369359;
double r3369366 = r3369363 * r3369365;
return r3369366;
}



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