\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.4
rmApplied flip--_binary64_5331.5
Simplified16.0
Taylor expanded around inf 15.8
Simplified0.1
rmApplied associate-*l/_binary64_210.1
Final simplification0.1
herbie shell --seed 2021077
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))