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



Bits error versus x
Results
Initial program 31.2
rmApplied flip--_binary64_5431.3
Simplified15.7
rmApplied associate-/r*_binary64_2315.1
Simplified0.1
rmApplied div-inv_binary64_760.2
Applied associate-*l*_binary64_200.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020280
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))