\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 r3486986 = 1.0;
double r3486987 = x;
double r3486988 = cos(r3486987);
double r3486989 = r3486986 - r3486988;
double r3486990 = r3486987 * r3486987;
double r3486991 = r3486989 / r3486990;
return r3486991;
}
double f(double x) {
double r3486992 = x;
double r3486993 = sin(r3486992);
double r3486994 = r3486993 / r3486992;
double r3486995 = 2.0;
double r3486996 = r3486992 / r3486995;
double r3486997 = tan(r3486996);
double r3486998 = r3486992 / r3486997;
double r3486999 = r3486994 / r3486998;
return r3486999;
}



Bits error versus x
Results
Initial program 30.9
rmApplied flip--31.0
Applied associate-/l/31.0
Simplified15.3
Taylor expanded around inf 15.3
Simplified0.3
Taylor expanded around -inf 0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019124
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))