Skip to content

Adding the logarithmic derivative of the gamma function (digamma) to stdlib_specialfunctions_gamma #803

Open
@banana-bred

Description

@banana-bred

Motivation

The logarithmic derivative of the gamma function,
$$\psi(z) = \frac{d}{dz} \ln(\Gamma(z),$$
(AKA the digamma function) is a special case ($k=0$) of the polygamma function
$$\psi^{(k)}(z) = \left(\frac{d}{dz}\right)^{k+1} \ln(\Gamma(z)).$$

The function $\psi(z)$ is typically not as common as $\Gamma(z)$, but it comes up every now and then in, e.g., the calculation of other special functions, some of which are not yet included in the Fortran stdlib. Does this seem like a reasonable inclusion ? I could implement the digamma function for real/complex arguments (and maybe the polygamma function later). Integer arguments are also possible, similar to how they are currently implemented for the log_gamma interface, but it seems more straightforward to require the argument to be real/complex.

This would be included in the stdlib_specialfunctions_gamma module, unless there's a better place for it.

Thoughts ?

Prior Art

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions