\frac{1 - \cos x}{x \cdot x}\frac{\log_* (1 + (e^{\frac{\sin x}{x}} - 1)^*) \cdot \frac{\sin x}{x}}{1 + \cos x}double f(double x) {
double r2086587 = 1.0;
double r2086588 = x;
double r2086589 = cos(r2086588);
double r2086590 = r2086587 - r2086589;
double r2086591 = r2086588 * r2086588;
double r2086592 = r2086590 / r2086591;
return r2086592;
}
double f(double x) {
double r2086593 = x;
double r2086594 = sin(r2086593);
double r2086595 = r2086594 / r2086593;
double r2086596 = expm1(r2086595);
double r2086597 = log1p(r2086596);
double r2086598 = r2086597 * r2086595;
double r2086599 = 1.0;
double r2086600 = cos(r2086593);
double r2086601 = r2086599 + r2086600;
double r2086602 = r2086598 / r2086601;
return r2086602;
}



Bits error versus x
Results
Initial program 31.0
rmApplied flip--31.1
Applied associate-/l/31.1
Simplified14.9
Taylor expanded around -inf 14.9
Simplified0.3
rmApplied log1p-expm1-u0.3
Final simplification0.3
herbie shell --seed 2019107 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))