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



Bits error versus x
Results
Initial program 31.6
rmApplied flip--_binary6431.7
Simplified16.1
rmApplied *-un-lft-identity_binary6416.1
Applied times-frac_binary6415.5
Simplified0.2
Final simplification0.2
herbie shell --seed 2020219
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))