\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.03391785124353622477011427349680161569268:\\
\;\;\;\;\left(1 - \cos x\right) \cdot \frac{\frac{1}{x}}{x}\\
\mathbf{elif}\;x \le 0.03384107969428518797316840505118307191879:\\
\;\;\;\;\mathsf{fma}\left({x}^{4}, \frac{1}{720}, \frac{1}{2} - \frac{1}{24} \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot \frac{\cos x - 1}{x}}{x}\\
\end{array}double f(double x) {
double r19919 = 1.0;
double r19920 = x;
double r19921 = cos(r19920);
double r19922 = r19919 - r19921;
double r19923 = r19920 * r19920;
double r19924 = r19922 / r19923;
return r19924;
}
double f(double x) {
double r19925 = x;
double r19926 = -0.033917851243536225;
bool r19927 = r19925 <= r19926;
double r19928 = 1.0;
double r19929 = cos(r19925);
double r19930 = r19928 - r19929;
double r19931 = 1.0;
double r19932 = r19931 / r19925;
double r19933 = r19932 / r19925;
double r19934 = r19930 * r19933;
double r19935 = 0.03384107969428519;
bool r19936 = r19925 <= r19935;
double r19937 = 4.0;
double r19938 = pow(r19925, r19937);
double r19939 = 0.001388888888888889;
double r19940 = 0.5;
double r19941 = 0.041666666666666664;
double r19942 = 2.0;
double r19943 = pow(r19925, r19942);
double r19944 = r19941 * r19943;
double r19945 = r19940 - r19944;
double r19946 = fma(r19938, r19939, r19945);
double r19947 = -1.0;
double r19948 = r19929 - r19928;
double r19949 = r19948 / r19925;
double r19950 = r19947 * r19949;
double r19951 = r19950 / r19925;
double r19952 = r19936 ? r19946 : r19951;
double r19953 = r19927 ? r19934 : r19952;
return r19953;
}



Bits error versus x
if x < -0.033917851243536225Initial program 1.3
rmApplied associate-/r*0.5
rmApplied *-un-lft-identity0.5
Applied div-inv0.5
Applied times-frac0.6
Simplified0.6
if -0.033917851243536225 < x < 0.03384107969428519Initial program 62.3
Taylor expanded around 0 0.0
Simplified0.0
if 0.03384107969428519 < x Initial program 1.0
rmApplied associate-/r*0.4
Taylor expanded around -inf 0.4
Final simplification0.3
herbie shell --seed 2019356 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1 (cos x)) (* x x)))