\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 r320450 = 1.0;
double r320451 = x;
double r320452 = cos(r320451);
double r320453 = r320450 - r320452;
double r320454 = r320451 * r320451;
double r320455 = r320453 / r320454;
return r320455;
}
double f(double x) {
double r320456 = x;
double r320457 = 2.0;
double r320458 = r320456 / r320457;
double r320459 = tan(r320458);
double r320460 = r320459 / r320456;
double r320461 = sin(r320456);
double r320462 = r320461 / r320456;
double r320463 = r320460 * r320462;
return r320463;
}



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