\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \tan \left(\frac{x}{2}\right)}{x}double f(double x) {
double r328571 = 1.0;
double r328572 = x;
double r328573 = cos(r328572);
double r328574 = r328571 - r328573;
double r328575 = r328572 * r328572;
double r328576 = r328574 / r328575;
return r328576;
}
double f(double x) {
double r328577 = x;
double r328578 = sin(r328577);
double r328579 = r328578 / r328577;
double r328580 = 2.0;
double r328581 = r328577 / r328580;
double r328582 = tan(r328581);
double r328583 = r328579 * r328582;
double r328584 = r328583 / r328577;
return r328584;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Simplified15.5
rmApplied *-un-lft-identity15.5
Applied times-frac15.5
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied associate-*r/0.1
Final simplification0.1
herbie shell --seed 2019151 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))