Skip to contents

Element-wise digamma function (logarithmic derivative of the gamma function).

Usage

prim_digamma(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_digamma(), an op of the CHLO dialect, a higher-level companion to StableHLO that is lowered to it during compilation. See chlo.digamma.

Examples

# the input's data type carries through
x <- nv_array(c(0.5, 1, 2, 5))
prim_digamma(x)
#> AnvlArray
#>  -1.9635
#>  -0.5772
#>   0.4228
#>   1.5061
#> [ CPUf32{4} ] 

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