\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \frac{\sin x}{x}}{\log \left(e^{\cos x} \cdot e\right)}double f(double x) {
double r2039337 = 1.0;
double r2039338 = x;
double r2039339 = cos(r2039338);
double r2039340 = r2039337 - r2039339;
double r2039341 = r2039338 * r2039338;
double r2039342 = r2039340 / r2039341;
return r2039342;
}
double f(double x) {
double r2039343 = x;
double r2039344 = sin(r2039343);
double r2039345 = r2039344 / r2039343;
double r2039346 = r2039345 * r2039345;
double r2039347 = cos(r2039343);
double r2039348 = exp(r2039347);
double r2039349 = exp(1.0);
double r2039350 = r2039348 * r2039349;
double r2039351 = log(r2039350);
double r2039352 = r2039346 / r2039351;
return r2039352;
}



Bits error versus x
Results
Initial program 30.9
rmApplied flip--31.1
Applied associate-/l/31.1
Simplified15.4
Taylor expanded around inf 15.4
Simplified0.3
rmApplied add-log-exp0.3
Applied add-log-exp0.3
Applied sum-log0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019119
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))