\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \tan \left(\frac{x}{2}\right)}{x}double f(double x) {
double r322210 = 1.0;
double r322211 = x;
double r322212 = cos(r322211);
double r322213 = r322210 - r322212;
double r322214 = r322211 * r322211;
double r322215 = r322213 / r322214;
return r322215;
}
double f(double x) {
double r322216 = x;
double r322217 = sin(r322216);
double r322218 = r322217 / r322216;
double r322219 = 2.0;
double r322220 = r322216 / r322219;
double r322221 = tan(r322220);
double r322222 = r322218 * r322221;
double r322223 = r322222 / r322216;
return r322223;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Simplified15.6
rmApplied *-un-lft-identity15.6
Applied times-frac15.6
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied associate-*r/0.1
Final simplification0.1
herbie shell --seed 2019156 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))