\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\begin{array}{l}
\mathbf{if}\;x \leq -2.5212314714250252 \cdot 10^{-247} \lor \neg \left(x \leq 8.638771279925528 \cdot 10^{-239}\right):\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot {\left(c \cdot s\right)}^{\left(0.5 \cdot 2\right)}\right)} \cdot \frac{\cos \left(x \cdot 2\right)}{{\left(c \cdot s\right)}^{\left(0.5 \cdot 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cos \left(x \cdot 2\right)}{x}}{\left(x \cdot {\left(c \cdot s\right)}^{\left(0.5 \cdot 2\right)}\right) \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\\
\end{array}(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
(FPCore (x c s)
:precision binary64
(if (or (<= x -2.5212314714250252e-247) (not (<= x 8.638771279925528e-239)))
(*
(/ 1.0 (* x (* x (pow (* c s) (* 0.5 2.0)))))
(/ (cos (* x 2.0)) (pow (* c s) (* 0.5 2.0))))
(/
(/ (cos (* x 2.0)) x)
(* (* x (pow (* c s) (* 0.5 2.0))) (pow (* c s) (/ 2.0 2.0))))))double code(double x, double c, double s) {
return (((double) cos(((double) (2.0 * x)))) / ((double) (((double) pow(c, 2.0)) * ((double) (((double) (x * ((double) pow(s, 2.0)))) * x)))));
}
double code(double x, double c, double s) {
double tmp;
if (((x <= -2.5212314714250252e-247) || !(x <= 8.638771279925528e-239))) {
tmp = ((double) ((1.0 / ((double) (x * ((double) (x * ((double) pow(((double) (c * s)), ((double) (0.5 * 2.0))))))))) * (((double) cos(((double) (x * 2.0)))) / ((double) pow(((double) (c * s)), ((double) (0.5 * 2.0)))))));
} else {
tmp = ((((double) cos(((double) (x * 2.0)))) / x) / ((double) (((double) (x * ((double) pow(((double) (c * s)), ((double) (0.5 * 2.0)))))) * ((double) pow(((double) (c * s)), (2.0 / 2.0))))));
}
return tmp;
}



Bits error versus x



Bits error versus c



Bits error versus s
Results
if x < -2.5212314714250252e-247 or 8.6387712799255281e-239 < x Initial program Error: 27.0 bits
SimplifiedError: 27.0 bits
rmApplied pow-prod-downError: 11.9 bits
rmApplied sqr-powError: 11.9 bits
Applied associate-*r*Error: 5.5 bits
SimplifiedError: 5.5 bits
rmApplied associate-*r*Error: 5.1 bits
rmApplied *-un-lft-identityError: 5.1 bits
Applied times-fracError: 5.2 bits
SimplifiedError: 5.2 bits
if -2.5212314714250252e-247 < x < 8.6387712799255281e-239Initial program Error: 49.5 bits
SimplifiedError: 49.3 bits
rmApplied pow-prod-downError: 44.6 bits
rmApplied sqr-powError: 44.6 bits
Applied associate-*r*Error: 15.4 bits
SimplifiedError: 15.4 bits
rmApplied associate-/r*Error: 15.3 bits
SimplifiedError: 15.3 bits
Final simplificationError: 5.7 bits
herbie shell --seed 2020204
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))