\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.03408999554764362976966296514547138940543:\\
\;\;\;\;\frac{\frac{\frac{\mathsf{fma}\left(\cos x, 1 + \cos x, 1 \cdot 1\right) \cdot \left(1 - \cos x\right)}{\mathsf{fma}\left(\cos x, 1 + \cos x, 1 \cdot 1\right)}}{x}}{x}\\
\mathbf{elif}\;x \le 0.03229563109066735382413071420160122215748:\\
\;\;\;\;\mathsf{fma}\left({x}^{4}, \frac{1}{720}, \frac{1}{2} - \frac{1}{24} \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{x} - \frac{\frac{\cos x}{x}}{x}\\
\end{array}double f(double x) {
double r31045 = 1.0;
double r31046 = x;
double r31047 = cos(r31046);
double r31048 = r31045 - r31047;
double r31049 = r31046 * r31046;
double r31050 = r31048 / r31049;
return r31050;
}
double f(double x) {
double r31051 = x;
double r31052 = -0.03408999554764363;
bool r31053 = r31051 <= r31052;
double r31054 = cos(r31051);
double r31055 = 1.0;
double r31056 = r31055 + r31054;
double r31057 = r31055 * r31055;
double r31058 = fma(r31054, r31056, r31057);
double r31059 = r31055 - r31054;
double r31060 = r31058 * r31059;
double r31061 = r31060 / r31058;
double r31062 = r31061 / r31051;
double r31063 = r31062 / r31051;
double r31064 = 0.032295631090667354;
bool r31065 = r31051 <= r31064;
double r31066 = 4.0;
double r31067 = pow(r31051, r31066);
double r31068 = 0.001388888888888889;
double r31069 = 0.5;
double r31070 = 0.041666666666666664;
double r31071 = 2.0;
double r31072 = pow(r31051, r31071);
double r31073 = r31070 * r31072;
double r31074 = r31069 - r31073;
double r31075 = fma(r31067, r31068, r31074);
double r31076 = r31055 / r31051;
double r31077 = r31076 / r31051;
double r31078 = r31054 / r31051;
double r31079 = r31078 / r31051;
double r31080 = r31077 - r31079;
double r31081 = r31065 ? r31075 : r31080;
double r31082 = r31053 ? r31063 : r31081;
return r31082;
}



Bits error versus x
if x < -0.03408999554764363Initial program 1.1
rmApplied associate-/r*0.4
rmApplied flip3--0.5
Simplified0.5
rmApplied difference-cubes0.5
Simplified0.5
if -0.03408999554764363 < x < 0.032295631090667354Initial program 62.4
Taylor expanded around 0 0.0
Simplified0.0
if 0.032295631090667354 < x Initial program 1.0
rmApplied associate-/r*0.4
rmApplied div-sub0.5
Applied div-sub0.6
Final simplification0.3
herbie shell --seed 2020001 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1 (cos x)) (* x x)))