\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 r2413377 = 1.0;
double r2413378 = x;
double r2413379 = cos(r2413378);
double r2413380 = r2413377 - r2413379;
double r2413381 = r2413378 * r2413378;
double r2413382 = r2413380 / r2413381;
return r2413382;
}
double f(double x) {
double r2413383 = x;
double r2413384 = 2.0;
double r2413385 = r2413383 / r2413384;
double r2413386 = tan(r2413385);
double r2413387 = r2413386 / r2413383;
double r2413388 = sin(r2413383);
double r2413389 = r2413388 / r2413383;
double r2413390 = r2413387 * r2413389;
return r2413390;
}



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