Converts x to a double and returns the cosine of the value.
If x is not a finite number, the result is NaN.