\frac{1 - \cos x}{x \cdot x}\begin{array}{l}
\mathbf{if}\;x \le -0.03585382449127275800160319363385497126728 \lor \neg \left(x \le 0.0450725634015326365178211176498734857887\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{x}, \frac{\sqrt[3]{1}}{x}, -\frac{\sqrt[3]{\cos x}}{x} \cdot \frac{\sqrt[3]{\cos x} \cdot \sqrt[3]{\cos x}}{x}\right) + \frac{\sqrt[3]{\cos x} \cdot \sqrt[3]{\cos x}}{x} \cdot \left(\left(-\frac{\sqrt[3]{\cos x}}{x}\right) + \frac{\sqrt[3]{\cos x}}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({x}^{4}, \frac{1}{720}, \frac{1}{2} - \frac{1}{24} \cdot {x}^{2}\right) + \frac{\sqrt[3]{\cos x} \cdot \sqrt[3]{\cos x}}{x} \cdot \left(\left(-\frac{\sqrt[3]{\cos x}}{x}\right) + \frac{\sqrt[3]{\cos x}}{x}\right)\\
\end{array}double f(double x) {
double r30285 = 1.0;
double r30286 = x;
double r30287 = cos(r30286);
double r30288 = r30285 - r30287;
double r30289 = r30286 * r30286;
double r30290 = r30288 / r30289;
return r30290;
}
double f(double x) {
double r30291 = x;
double r30292 = -0.03585382449127276;
bool r30293 = r30291 <= r30292;
double r30294 = 0.045072563401532637;
bool r30295 = r30291 <= r30294;
double r30296 = !r30295;
bool r30297 = r30293 || r30296;
double r30298 = 1.0;
double r30299 = cbrt(r30298);
double r30300 = r30299 * r30299;
double r30301 = r30300 / r30291;
double r30302 = r30299 / r30291;
double r30303 = cos(r30291);
double r30304 = cbrt(r30303);
double r30305 = r30304 / r30291;
double r30306 = r30304 * r30304;
double r30307 = r30306 / r30291;
double r30308 = r30305 * r30307;
double r30309 = -r30308;
double r30310 = fma(r30301, r30302, r30309);
double r30311 = -r30305;
double r30312 = r30311 + r30305;
double r30313 = r30307 * r30312;
double r30314 = r30310 + r30313;
double r30315 = 4.0;
double r30316 = pow(r30291, r30315);
double r30317 = 0.001388888888888889;
double r30318 = 0.5;
double r30319 = 0.041666666666666664;
double r30320 = 2.0;
double r30321 = pow(r30291, r30320);
double r30322 = r30319 * r30321;
double r30323 = r30318 - r30322;
double r30324 = fma(r30316, r30317, r30323);
double r30325 = r30324 + r30313;
double r30326 = r30297 ? r30314 : r30325;
return r30326;
}



Bits error versus x
if x < -0.03585382449127276 or 0.045072563401532637 < x Initial program 1.0
rmApplied div-sub1.1
rmApplied add-cube-cbrt1.4
Applied times-frac1.5
Applied add-cube-cbrt1.5
Applied times-frac0.9
Applied prod-diff0.9
Simplified0.9
if -0.03585382449127276 < x < 0.045072563401532637Initial program 62.3
rmApplied div-sub62.1
rmApplied add-cube-cbrt62.4
Applied times-frac62.3
Applied add-cube-cbrt62.3
Applied times-frac62.3
Applied prod-diff62.4
Simplified62.3
Taylor expanded around 0 0.0
Simplified0.0
Final simplification0.4
herbie shell --seed 2019346 +o rules:numerics
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1 (cos x)) (* x x)))