Skip to contents

Element-wise natural logarithm of the absolute value of the gamma function.

Usage

prim_lgamma(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

  • reverse

StableHLO

Lowers to hlo_lgamma(), an op of the CHLO dialect, a higher-level companion to StableHLO that is lowered to it during compilation. See chlo.lgamma.

See also

Examples

# the input's data type carries through
x <- nv_array(c(0.5, 1, 2, 5))
prim_lgamma(x)
#> AnvlArray
#>  5.7236e-01
#>  4.7684e-07
#>  0.0000e+00
#>  3.1781e+00
#> [ CPUf32{4} ] 

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