\frac{1 - \cos x}{x \cdot x}\frac{\frac{\tan \left(\frac{x}{2}\right)}{x} \cdot \sin x}{x}double f(double x) {
double r961750 = 1.0;
double r961751 = x;
double r961752 = cos(r961751);
double r961753 = r961750 - r961752;
double r961754 = r961751 * r961751;
double r961755 = r961753 / r961754;
return r961755;
}
double f(double x) {
double r961756 = x;
double r961757 = 2.0;
double r961758 = r961756 / r961757;
double r961759 = tan(r961758);
double r961760 = r961759 / r961756;
double r961761 = sin(r961756);
double r961762 = r961760 * r961761;
double r961763 = r961762 / r961756;
return r961763;
}



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