\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.02309310542475334626644212221435736864805:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{x}{1 \cdot \left(1 \cdot 1\right) - \cos x \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(x + x\right)\right)}} \cdot \frac{1}{\left(1 \cdot \cos x + \cos x \cdot \cos x\right) + 1 \cdot 1}\\
\mathbf{elif}\;x \le 0.02891102314655494970319082881360372994095:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, \frac{-1}{24}, \mathsf{fma}\left(x \cdot x, \frac{1}{720} \cdot \left(x \cdot x\right), \frac{1}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{1}{\frac{x}{1 - \cos x}}\\
\end{array}double f(double x) {
double r727649 = 1.0;
double r727650 = x;
double r727651 = cos(r727650);
double r727652 = r727649 - r727651;
double r727653 = r727650 * r727650;
double r727654 = r727652 / r727653;
return r727654;
}
double f(double x) {
double r727655 = x;
double r727656 = -0.023093105424753346;
bool r727657 = r727655 <= r727656;
double r727658 = 1.0;
double r727659 = r727658 / r727655;
double r727660 = 1.0;
double r727661 = r727660 * r727660;
double r727662 = r727660 * r727661;
double r727663 = cos(r727655);
double r727664 = 0.5;
double r727665 = r727655 + r727655;
double r727666 = cos(r727665);
double r727667 = r727664 * r727666;
double r727668 = r727664 + r727667;
double r727669 = r727663 * r727668;
double r727670 = r727662 - r727669;
double r727671 = r727655 / r727670;
double r727672 = r727659 / r727671;
double r727673 = r727660 * r727663;
double r727674 = r727663 * r727663;
double r727675 = r727673 + r727674;
double r727676 = r727675 + r727661;
double r727677 = r727658 / r727676;
double r727678 = r727672 * r727677;
double r727679 = 0.02891102314655495;
bool r727680 = r727655 <= r727679;
double r727681 = r727655 * r727655;
double r727682 = -0.041666666666666664;
double r727683 = 0.001388888888888889;
double r727684 = r727683 * r727681;
double r727685 = fma(r727681, r727684, r727664);
double r727686 = fma(r727681, r727682, r727685);
double r727687 = r727660 - r727663;
double r727688 = r727655 / r727687;
double r727689 = r727658 / r727688;
double r727690 = r727659 * r727689;
double r727691 = r727680 ? r727686 : r727690;
double r727692 = r727657 ? r727678 : r727691;
return r727692;
}



Bits error versus x
if x < -0.023093105424753346Initial program 1.0
rmApplied *-un-lft-identity1.0
Applied times-frac0.5
rmApplied clear-num0.5
rmApplied flip3--0.6
Applied associate-/r/0.5
Applied *-un-lft-identity0.5
Applied times-frac0.6
Applied associate-*r*0.6
Simplified0.6
rmApplied sqr-cos0.5
Simplified0.5
if -0.023093105424753346 < x < 0.02891102314655495Initial program 62.2
rmApplied *-un-lft-identity62.2
Applied times-frac61.2
Taylor expanded around 0 0.0
Simplified0.0
if 0.02891102314655495 < x Initial program 0.9
rmApplied *-un-lft-identity0.9
Applied times-frac0.5
rmApplied clear-num0.5
Final simplification0.3
herbie shell --seed 2019179 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
(/ (- 1.0 (cos x)) (* x x)))