psigamma: Polygamma function for dual numbers

psigammaR Documentation

Polygamma function for dual numbers

Description

Computes \psi^{(n)}(x) where n is the derivative order. The derivative of \psi^{(n)}(x) is \psi^{(n+1)}(x).

Usage

psigamma(x, deriv = 0L)

## S4 method for signature 'numeric'
psigamma(x, deriv = 0L)

## S4 method for signature 'dualr'
psigamma(x, deriv = 0L)

Arguments

x

A numeric or dual value.

deriv

Integer derivative order (0 = digamma, 1 = trigamma, etc.).

Value

The polygamma function value.

Examples

psigamma(1, deriv = 0)
x <- dual_variable(2)
value(psigamma(x, deriv = 1))

nabla documentation built on Feb. 11, 2026, 1:06 a.m.