\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x}}{\frac{x}{\tan \left(\frac{x}{2}\right)}}double f(double x) {
double r1062896 = 1.0;
double r1062897 = x;
double r1062898 = cos(r1062897);
double r1062899 = r1062896 - r1062898;
double r1062900 = r1062897 * r1062897;
double r1062901 = r1062899 / r1062900;
return r1062901;
}
double f(double x) {
double r1062902 = x;
double r1062903 = sin(r1062902);
double r1062904 = r1062903 / r1062902;
double r1062905 = 2.0;
double r1062906 = r1062902 / r1062905;
double r1062907 = tan(r1062906);
double r1062908 = r1062902 / r1062907;
double r1062909 = r1062904 / r1062908;
return r1062909;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Simplified15.5
rmApplied associate-/r*15.4
Simplified0.1
rmApplied associate-/l*0.1
Final simplification0.1
herbie shell --seed 2019151
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))