Skip to contents

Element-wise polygamma function: the (n+1)-th derivative of the log-gamma function. Both n and x must have the same shape; n typically holds non-negative integer values.

Usage

prim_polygamma(n, x)

Arguments

n, x

(arrayish)
Arrayish values of data type floating-point. Must have the same shape.

Value

arrayish
Has the same shape and data type as the inputs. It is ambiguous if both inputs are ambiguous.

Implemented Rules

  • stablehlo

  • reverse

StableHLO

Lowers to stablehlo::hlo_polygamma().

See also

Examples

n <- nv_array(c(1, 1, 2))
x <- nv_array(c(0.5, 1, 2))
prim_polygamma(n, x)
#> AnvlArray
#>   4.9348
#>   1.6449
#>  -0.4041
#> [ CPUf32{3} ]