\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.03100648570835606854245725116925314068794 \lor \neg \left(x \le 0.03254730486326439659050535624373878818005\right):\\
\;\;\;\;\frac{\left(1 - \cos x\right) \cdot \frac{1}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{2}, x, \mathsf{fma}\left(\frac{1}{720}, {x}^{5}, {x}^{3} \cdot \frac{-1}{24}\right)\right)}{x}\\
\end{array}double f(double x) {
double r20837 = 1.0;
double r20838 = x;
double r20839 = cos(r20838);
double r20840 = r20837 - r20839;
double r20841 = r20838 * r20838;
double r20842 = r20840 / r20841;
return r20842;
}
double f(double x) {
double r20843 = x;
double r20844 = -0.03100648570835607;
bool r20845 = r20843 <= r20844;
double r20846 = 0.0325473048632644;
bool r20847 = r20843 <= r20846;
double r20848 = !r20847;
bool r20849 = r20845 || r20848;
double r20850 = 1.0;
double r20851 = cos(r20843);
double r20852 = r20850 - r20851;
double r20853 = 1.0;
double r20854 = r20853 / r20843;
double r20855 = r20852 * r20854;
double r20856 = r20855 / r20843;
double r20857 = 0.5;
double r20858 = 0.001388888888888889;
double r20859 = 5.0;
double r20860 = pow(r20843, r20859);
double r20861 = 3.0;
double r20862 = pow(r20843, r20861);
double r20863 = -0.041666666666666664;
double r20864 = r20862 * r20863;
double r20865 = fma(r20858, r20860, r20864);
double r20866 = fma(r20857, r20843, r20865);
double r20867 = r20866 / r20843;
double r20868 = r20849 ? r20856 : r20867;
return r20868;
}



Bits error versus x
if x < -0.03100648570835607 or 0.0325473048632644 < x Initial program 1.1
rmApplied associate-/r*0.4
rmApplied div-inv0.5
if -0.03100648570835607 < x < 0.0325473048632644Initial program 62.2
rmApplied associate-/r*61.3
Taylor expanded around 0 0.0
Simplified0.0
Final simplification0.3
herbie shell --seed 2019209 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1 (cos x)) (* x x)))