\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \sin x}{\cos x \cdot x + x}double f(double x) {
double r3707554 = 1.0;
double r3707555 = x;
double r3707556 = cos(r3707555);
double r3707557 = r3707554 - r3707556;
double r3707558 = r3707555 * r3707555;
double r3707559 = r3707557 / r3707558;
return r3707559;
}
double f(double x) {
double r3707560 = x;
double r3707561 = sin(r3707560);
double r3707562 = r3707561 / r3707560;
double r3707563 = r3707562 * r3707561;
double r3707564 = cos(r3707560);
double r3707565 = r3707564 * r3707560;
double r3707566 = r3707565 + r3707560;
double r3707567 = r3707563 / r3707566;
return r3707567;
}



Bits error versus x
Results
Initial program 30.9
rmApplied flip--31.0
Applied associate-/l/31.0
Simplified14.7
Taylor expanded around inf 14.7
Simplified0.3
rmApplied associate-*r/0.3
Applied associate-/l/0.3
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019104
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))