\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 31.3
rmApplied flip--_binary64_60031.4
Simplified15.7
rmApplied *-un-lft-identity_binary64_57415.7
Applied *-un-lft-identity_binary64_57415.7
Applied distribute-lft-out_binary64_61815.7
Applied times-frac_binary64_56915.7
Applied times-frac_binary64_5690.3
Simplified0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2020231
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))