\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.030181495565899288:\\
\;\;\;\;\frac{\sqrt[3]{\log \left(e^{1 - \cos x}\right)} \cdot \sqrt[3]{1 - \cos x}}{x} \cdot \frac{\frac{\sqrt[3]{{1}^{3} - {\left(\cos x\right)}^{3}}}{\sqrt[3]{1 \cdot 1 + \left(\cos x \cdot \cos x + 1 \cdot \cos x\right)}}}{x}\\
\mathbf{elif}\;x \le 0.031736096784144671:\\
\;\;\;\;\mathsf{fma}\left({x}^{4}, \frac{1}{720}, \frac{1}{2} - \frac{1}{24} \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1 - \cos x} \cdot \sqrt[3]{1 - \cos x}}{x} \cdot \frac{\frac{\sqrt[3]{{1}^{3} - {\left(\cos x\right)}^{3}}}{\sqrt[3]{1 \cdot 1 + \left(\cos x \cdot \cos x + 1 \cdot \cos x\right)}}}{x}\\
\end{array}double f(double x) {
double r25595 = 1.0;
double r25596 = x;
double r25597 = cos(r25596);
double r25598 = r25595 - r25597;
double r25599 = r25596 * r25596;
double r25600 = r25598 / r25599;
return r25600;
}
double f(double x) {
double r25601 = x;
double r25602 = -0.03018149556589929;
bool r25603 = r25601 <= r25602;
double r25604 = 1.0;
double r25605 = cos(r25601);
double r25606 = r25604 - r25605;
double r25607 = exp(r25606);
double r25608 = log(r25607);
double r25609 = cbrt(r25608);
double r25610 = cbrt(r25606);
double r25611 = r25609 * r25610;
double r25612 = r25611 / r25601;
double r25613 = 3.0;
double r25614 = pow(r25604, r25613);
double r25615 = pow(r25605, r25613);
double r25616 = r25614 - r25615;
double r25617 = cbrt(r25616);
double r25618 = r25604 * r25604;
double r25619 = r25605 * r25605;
double r25620 = r25604 * r25605;
double r25621 = r25619 + r25620;
double r25622 = r25618 + r25621;
double r25623 = cbrt(r25622);
double r25624 = r25617 / r25623;
double r25625 = r25624 / r25601;
double r25626 = r25612 * r25625;
double r25627 = 0.03173609678414467;
bool r25628 = r25601 <= r25627;
double r25629 = 4.0;
double r25630 = pow(r25601, r25629);
double r25631 = 0.001388888888888889;
double r25632 = 0.5;
double r25633 = 0.041666666666666664;
double r25634 = 2.0;
double r25635 = pow(r25601, r25634);
double r25636 = r25633 * r25635;
double r25637 = r25632 - r25636;
double r25638 = fma(r25630, r25631, r25637);
double r25639 = r25610 * r25610;
double r25640 = r25639 / r25601;
double r25641 = r25640 * r25625;
double r25642 = r25628 ? r25638 : r25641;
double r25643 = r25603 ? r25626 : r25642;
return r25643;
}



Bits error versus x
if x < -0.03018149556589929Initial program 0.9
rmApplied add-cube-cbrt1.3
Applied times-frac0.8
rmApplied flip3--0.8
Applied cbrt-div0.8
rmApplied add-log-exp0.8
Applied add-log-exp0.8
Applied diff-log0.8
Simplified0.8
if -0.03018149556589929 < x < 0.03173609678414467Initial program 62.4
Taylor expanded around 0 0.0
Simplified0.0
if 0.03173609678414467 < x Initial program 1.1
rmApplied add-cube-cbrt1.5
Applied times-frac0.8
rmApplied flip3--0.8
Applied cbrt-div0.8
Final simplification0.4
herbie shell --seed 2020059 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1 (cos x)) (* x x)))