\frac{1 - \cos x}{x \cdot x}\frac{\frac{\sin x}{x} \cdot \frac{\sin x}{x}}{\log \left(e^{1 + \cos x}\right)}double f(double x) {
double r2102125 = 1.0;
double r2102126 = x;
double r2102127 = cos(r2102126);
double r2102128 = r2102125 - r2102127;
double r2102129 = r2102126 * r2102126;
double r2102130 = r2102128 / r2102129;
return r2102130;
}
double f(double x) {
double r2102131 = x;
double r2102132 = sin(r2102131);
double r2102133 = r2102132 / r2102131;
double r2102134 = r2102133 * r2102133;
double r2102135 = 1.0;
double r2102136 = cos(r2102131);
double r2102137 = r2102135 + r2102136;
double r2102138 = exp(r2102137);
double r2102139 = log(r2102138);
double r2102140 = r2102134 / r2102139;
return r2102140;
}



Bits error versus x
Results
Initial program 31.2
rmApplied flip--31.3
Applied associate-/l/31.3
Simplified15.5
Taylor expanded around inf 15.5
Simplified0.3
rmApplied add-log-exp0.4
Final simplification0.4
herbie shell --seed 2019112 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))