\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 r351878 = 1.0;
double r351879 = x;
double r351880 = cos(r351879);
double r351881 = r351878 - r351880;
double r351882 = r351879 * r351879;
double r351883 = r351881 / r351882;
return r351883;
}
double f(double x) {
double r351884 = x;
double r351885 = 2.0;
double r351886 = r351884 / r351885;
double r351887 = tan(r351886);
double r351888 = r351887 / r351884;
double r351889 = sin(r351884);
double r351890 = r351889 / r351884;
double r351891 = r351888 * r351890;
return r351891;
}



Bits error versus x
Results
Initial program 31.4
rmApplied flip--31.5
Simplified15.8
rmApplied *-un-lft-identity15.8
Applied times-frac15.8
Applied times-frac0.3
Simplified0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019154 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))