\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 r932725 = 1.0;
double r932726 = x;
double r932727 = cos(r932726);
double r932728 = r932725 - r932727;
double r932729 = r932726 * r932726;
double r932730 = r932728 / r932729;
return r932730;
}
double f(double x) {
double r932731 = x;
double r932732 = sin(r932731);
double r932733 = r932732 / r932731;
double r932734 = 2.0;
double r932735 = r932731 / r932734;
double r932736 = tan(r932735);
double r932737 = r932733 * r932736;
double r932738 = r932737 / r932731;
return r932738;
}



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