Skip to contents

Element-wise sine.

Usage

prim_sin(x)

Arguments

x

(arrayish)
One input. Can be any float data type. An R value materializes at its default data type.

Value

(arrayish)
Has the input's shape and data type.

Implemented Rules

  • stablehlo

  • quickr

  • reverse

StableHLO

Lowers to hlo_sine(), specified under sine.

See also

Examples

# the input's data type carries through
x <- nv_array(c(0, pi / 2, pi))
prim_sin(x)
#> AnvlArray
#>   0.0000e+00
#>   1.0000e+00
#>  -8.7423e-08
#> [ CPUf32{3} ] 

# an R value materializes at its default data type
prim_sin(0)
#> AnvlArray
#>  0
#> [ CPUf32{} ]