\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{\sqrt{1 + \cos x}}}{x} \cdot \frac{\frac{\sin x}{\sqrt{1 + \cos x}}}{x}(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
(FPCore (x) :precision binary64 (* (/ (/ (sin x) (sqrt (+ 1.0 (cos x)))) x) (/ (/ (sin x) (sqrt (+ 1.0 (cos x)))) x)))
double code(double x) {
return (1.0 - cos(x)) / (x * x);
}
double code(double x) {
return ((sin(x) / sqrt(1.0 + cos(x))) / x) * ((sin(x) / sqrt(1.0 + cos(x))) / x);
}



Bits error versus x
Results
Initial program 31.1
rmApplied flip--_binary64_5231.2
Simplified15.3
rmApplied add-sqr-sqrt_binary64_9815.7
Applied times-frac_binary64_8315.6
Applied times-frac_binary64_831.1
Final simplification1.1
herbie shell --seed 2020281
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))