cos#
- rbc.stdlib.elementwise_functions.cos(x)#
- Calculates an implementation-dependent approximation to the cosine, having domain
(-infinity, +infinity) and codomain [-1, +1], for each element x_i of the input array x.
>>> from rbc.stdlib import array_api >>> @heavydb('double[](double[])') ... def array_api_cos(x): ... return array_api.cos(x) >>> array_api_cos(np.array([0, np.pi/2, np.pi])).execute() array([ 1.000000e+00, 6.123234e-17, -1.000000e+00], dtype=float32)