Skip to contents

Element-wise psigamma function: the deriv-th derivative of the digamma function, i.e. the (deriv + 1)-th derivative of the log-gamma function. Both x and deriv must have the same shape; deriv typically holds non-negative integer values.

Usage

prim_psigamma(x, deriv)

Arguments

x, deriv

(arrayish)
Two inputs of the same shape. Can be any float data type. x and deriv must have the same data type. An R value among them assumes the data type of the others when it is in its data type category, and its default data type when none of them has one.

Value

(arrayish)
Has the inputs' shape and data type.

Implemented Rules

  • stablehlo

  • reverse

StableHLO

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

See also

Examples

# both operands are floats, as the primitive requires
x <- nv_array(c(0.5, 1, 2))
deriv <- nv_array(c(1, 1, 2))
prim_psigamma(x, deriv)
#> AnvlArray
#>   4.9348
#>   1.6449
#>  -0.4041
#> [ CPUf32{3} ]