\frac{1 - \cos x}{x \cdot x}\frac{\frac{\frac{\sin x}{x} \cdot \sin \left(\frac{x}{2}\right)}{x}}{\cos \left(\frac{x}{2}\right)}double f(double x) {
double r934303 = 1.0;
double r934304 = x;
double r934305 = cos(r934304);
double r934306 = r934303 - r934305;
double r934307 = r934304 * r934304;
double r934308 = r934306 / r934307;
return r934308;
}
double f(double x) {
double r934309 = x;
double r934310 = sin(r934309);
double r934311 = r934310 / r934309;
double r934312 = 2.0;
double r934313 = r934309 / r934312;
double r934314 = sin(r934313);
double r934315 = r934311 * r934314;
double r934316 = r934315 / r934309;
double r934317 = cos(r934313);
double r934318 = r934316 / r934317;
return r934318;
}



Bits error versus x
Results
Initial program 31.3
rmApplied flip--31.4
Simplified15.4
rmApplied associate-/r*15.3
Simplified0.1
rmApplied tan-quot0.1
Applied associate-*r/0.1
Applied associate-/l/0.1
rmApplied associate-/r*0.1
Final simplification0.1
herbie shell --seed 2019144
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))