\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{\frac{x}{\tan \left(\frac{x}{2}\right)}}}{x}double f(double x) {
double r312433 = 1.0;
double r312434 = x;
double r312435 = cos(r312434);
double r312436 = r312433 - r312435;
double r312437 = r312434 * r312434;
double r312438 = r312436 / r312437;
return r312438;
}
double f(double x) {
double r312439 = x;
double r312440 = sin(r312439);
double r312441 = 2.0;
double r312442 = r312439 / r312441;
double r312443 = tan(r312442);
double r312444 = r312439 / r312443;
double r312445 = r312440 / r312444;
double r312446 = r312445 / r312439;
return r312446;
}



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
rmApplied associate-*l/0.1
rmApplied *-un-lft-identity0.1
Applied associate-/r*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019128 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))