\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 r598880 = 1.0;
double r598881 = x;
double r598882 = cos(r598881);
double r598883 = r598880 - r598882;
double r598884 = r598881 * r598881;
double r598885 = r598883 / r598884;
return r598885;
}
double f(double x) {
double r598886 = x;
double r598887 = 2.0;
double r598888 = r598886 / r598887;
double r598889 = tan(r598888);
double r598890 = r598889 / r598886;
double r598891 = sin(r598886);
double r598892 = r598891 / r598886;
double r598893 = r598890 * r598892;
return r598893;
}



Bits error versus x
Results
Initial program 30.7
rmApplied flip--30.8
Simplified15.9
rmApplied *-un-lft-identity15.9
Applied times-frac15.9
Applied times-frac0.3
Simplified0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019135
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))