\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{x}}{\frac{\cos \left(x \cdot \frac{1}{2}\right)}{\frac{\sin x}{x}}}double f(double x) {
double r2124880 = 1.0;
double r2124881 = x;
double r2124882 = cos(r2124881);
double r2124883 = r2124880 - r2124882;
double r2124884 = r2124881 * r2124881;
double r2124885 = r2124883 / r2124884;
return r2124885;
}
double f(double x) {
double r2124886 = x;
double r2124887 = 0.5;
double r2124888 = r2124886 * r2124887;
double r2124889 = sin(r2124888);
double r2124890 = r2124889 / r2124886;
double r2124891 = cos(r2124888);
double r2124892 = sin(r2124886);
double r2124893 = r2124892 / r2124886;
double r2124894 = r2124891 / r2124893;
double r2124895 = r2124890 / r2124894;
return r2124895;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Applied associate-/l/31.1
Simplified15.6
rmApplied times-frac15.9
Simplified15.8
Taylor expanded around inf 15.5
Simplified0.1
Final simplification0.1
herbie shell --seed 2019121 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))