\frac{1 - \cos x}{x \cdot x}\frac{\frac{\tan \left(\frac{x}{2}\right)}{x} \cdot \sin x}{x}double f(double x) {
double r878564 = 1.0;
double r878565 = x;
double r878566 = cos(r878565);
double r878567 = r878564 - r878566;
double r878568 = r878565 * r878565;
double r878569 = r878567 / r878568;
return r878569;
}
double f(double x) {
double r878570 = x;
double r878571 = 2.0;
double r878572 = r878570 / r878571;
double r878573 = tan(r878572);
double r878574 = r878573 / r878570;
double r878575 = sin(r878570);
double r878576 = r878574 * r878575;
double r878577 = r878576 / r878570;
return r878577;
}



Bits error versus x
Results
Initial program 31.7
rmApplied flip--31.8
Simplified15.5
rmApplied *-un-lft-identity15.5
Applied times-frac15.5
Applied times-frac0.3
Simplified0.3
Simplified0.1
rmApplied div-inv0.2
rmApplied associate-*l/0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019142 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))