\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \tan \left(\frac{x}{2}\right)}{x}(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
(FPCore (x) :precision binary64 (/ (* (/ (sin x) x) (tan (/ x 2.0))) x))
double code(double x) {
return (((double) (1.0 - ((double) cos(x)))) / ((double) (x * x)));
}
double code(double x) {
return (((double) ((((double) sin(x)) / x) * ((double) tan((x / 2.0))))) / x);
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--_binary6431.1
Simplified15.1
rmApplied associate-/r*_binary6414.6
Simplified0.1
Final simplification0.1
herbie shell --seed 2020210
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))