\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 r908196 = 1.0;
double r908197 = x;
double r908198 = cos(r908197);
double r908199 = r908196 - r908198;
double r908200 = r908197 * r908197;
double r908201 = r908199 / r908200;
return r908201;
}
double f(double x) {
double r908202 = x;
double r908203 = sin(r908202);
double r908204 = r908203 / r908202;
double r908205 = 2.0;
double r908206 = r908202 / r908205;
double r908207 = tan(r908206);
double r908208 = r908204 * r908207;
double r908209 = r908208 / r908202;
return r908209;
}



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)))