\frac{1 - \cos x}{x \cdot x}\frac{\sin x}{x} \cdot \frac{\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 30.9
rmApplied flip--_binary6431.0
Simplified15.4
rmApplied *-un-lft-identity_binary6415.4
Applied times-frac_binary6415.4
Applied times-frac_binary640.3
Simplified0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2020253
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))