Skip to contents

Element-wise cosine.

Usage

prim_cosine(operand)

Arguments

operand

(arrayish)
Arrayish value of data type floating-point.

Value

arrayish
Has the same shape and data type as the input. It is ambiguous if the input is ambiguous.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to stablehlo::hlo_cosine().

See also

Examples

x <- nv_array(c(0, pi / 2, pi))
prim_cosine(x)
#> AnvlArray
#>   1.0000e+00
#>  -4.3711e-08
#>  -1.0000e+00
#> [ CPUf32{3} ]