\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 r347567 = 1.0;
double r347568 = x;
double r347569 = cos(r347568);
double r347570 = r347567 - r347569;
double r347571 = r347568 * r347568;
double r347572 = r347570 / r347571;
return r347572;
}
double f(double x) {
double r347573 = x;
double r347574 = sin(r347573);
double r347575 = r347574 / r347573;
double r347576 = 2.0;
double r347577 = r347573 / r347576;
double r347578 = tan(r347577);
double r347579 = r347575 * r347578;
double r347580 = r347579 / r347573;
return r347580;
}



Bits error versus x
Results
Initial program 30.7
rmApplied flip--30.8
Simplified14.9
rmApplied *-un-lft-identity14.9
Applied times-frac14.9
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied associate-*r/0.1
Final simplification0.1
herbie shell --seed 2019152 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))