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



Bits error versus x
Results
Initial program 31.3
rmApplied flip--_binary6431.4
Simplified15.4
Taylor expanded around inf 15.3
Simplified0.1
Taylor expanded around inf 0.1
Simplified0.1
rmApplied associate-/r*_binary640.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2021174
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))