\frac{1 - \cos x}{x \cdot x}\frac{\frac{\tan \left(\frac{x}{2}\right)}{\frac{x}{\sin x}}}{x}double f(double x) {
double r560783 = 1.0;
double r560784 = x;
double r560785 = cos(r560784);
double r560786 = r560783 - r560785;
double r560787 = r560784 * r560784;
double r560788 = r560786 / r560787;
return r560788;
}
double f(double x) {
double r560789 = x;
double r560790 = 2.0;
double r560791 = r560789 / r560790;
double r560792 = tan(r560791);
double r560793 = sin(r560789);
double r560794 = r560789 / r560793;
double r560795 = r560792 / r560794;
double r560796 = r560795 / r560789;
return r560796;
}



Bits error versus x
Results
Initial program 31.2
rmApplied flip--31.4
Simplified15.9
rmApplied *-un-lft-identity15.9
Applied *-un-lft-identity15.9
Applied distribute-lft-out15.9
Applied times-frac15.9
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied clear-num0.1
rmApplied associate-*r/0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019130
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))