\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 (1.0 - cos(x)) / (x * x);
}
double code(double x) {
return ((sin(x) / x) * tan(x / 2.0)) / x;
}



Bits error versus x
Results
Initial program 31.9
rmApplied flip--_binary6432.0
Simplified15.8
rmApplied associate-/r*_binary6415.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020224
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))