\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 r1050778 = 1.0;
double r1050779 = x;
double r1050780 = cos(r1050779);
double r1050781 = r1050778 - r1050780;
double r1050782 = r1050779 * r1050779;
double r1050783 = r1050781 / r1050782;
return r1050783;
}
double f(double x) {
double r1050784 = x;
double r1050785 = 2.0;
double r1050786 = r1050784 / r1050785;
double r1050787 = tan(r1050786);
double r1050788 = r1050787 / r1050784;
double r1050789 = sin(r1050784);
double r1050790 = r1050789 / r1050784;
double r1050791 = r1050788 * r1050790;
return r1050791;
}



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