\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.011260686584555396:\\
\;\;\;\;\frac{\sin x}{\frac{x \cdot x}{\tan \left(\frac{x}{2}\right)}}\\
\mathbf{elif}\;x \le 1.8753012792971286 \cdot 10^{-156}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, \left(x \cdot x\right) \cdot \frac{1}{720} - \frac{1}{24}, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x \cdot \tan \left(\frac{x}{2}\right)}{x \cdot x}\\
\end{array}double f(double x) {
double r814103 = 1.0;
double r814104 = x;
double r814105 = cos(r814104);
double r814106 = r814103 - r814105;
double r814107 = r814104 * r814104;
double r814108 = r814106 / r814107;
return r814108;
}
double f(double x) {
double r814109 = x;
double r814110 = -0.011260686584555396;
bool r814111 = r814109 <= r814110;
double r814112 = sin(r814109);
double r814113 = r814109 * r814109;
double r814114 = 2.0;
double r814115 = r814109 / r814114;
double r814116 = tan(r814115);
double r814117 = r814113 / r814116;
double r814118 = r814112 / r814117;
double r814119 = 1.8753012792971286e-156;
bool r814120 = r814109 <= r814119;
double r814121 = 0.001388888888888889;
double r814122 = r814113 * r814121;
double r814123 = 0.041666666666666664;
double r814124 = r814122 - r814123;
double r814125 = 0.5;
double r814126 = fma(r814113, r814124, r814125);
double r814127 = r814112 * r814116;
double r814128 = r814127 / r814113;
double r814129 = r814120 ? r814126 : r814128;
double r814130 = r814111 ? r814118 : r814129;
return r814130;
}



Bits error versus x
if x < -0.011260686584555396Initial program 1.2
rmApplied flip--1.4
Simplified1.3
rmApplied *-un-lft-identity1.3
Applied times-frac1.3
Simplified1.3
Simplified1.0
rmApplied associate-/l*1.0
if -0.011260686584555396 < x < 1.8753012792971286e-156Initial program 61.6
Taylor expanded around 0 0.0
Simplified0.0
if 1.8753012792971286e-156 < x Initial program 20.6
rmApplied flip--20.8
Simplified0.8
rmApplied *-un-lft-identity0.8
Applied times-frac0.8
Simplified0.8
Simplified0.6
Final simplification0.5
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1 (cos x)) (* x x)))