\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 r999670 = 1.0;
double r999671 = x;
double r999672 = cos(r999671);
double r999673 = r999670 - r999672;
double r999674 = r999671 * r999671;
double r999675 = r999673 / r999674;
return r999675;
}
double f(double x) {
double r999676 = x;
double r999677 = 2.0;
double r999678 = r999676 / r999677;
double r999679 = tan(r999678);
double r999680 = r999679 / r999676;
double r999681 = sin(r999676);
double r999682 = r999681 / r999676;
double r999683 = r999680 * r999682;
return r999683;
}



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 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))