Skip to content

digamma handling of zero inconsistent with how gamma handles it #10802

Open
@tedgin

Description

@tedgin

Both Γ(x) and Ψ(x) diverge as x→0 but in opposite directions. For Γ, limx→0-Γ(x) = -∞, and limx→0+Γ(x) = +∞. For Ψ, limx→0-Ψ(x) = +∞, and limx→0+Ψ(x) = -∞.

The Implementation of Γ, std.mathspecial.gamma, treats -0. and +0. in the IEEE 754 way as infinitesimally less than and greater than zero, respectively. I.e., gamma(±0.) == ±real.infinity. The implementation of Ψ, std.mathspecial.digamma, doesn't do this. It treats ±0. as identically zero. I e., digamma(±0.) is real.nan. Would it be possible to make digamma's treatment of ±0. consistent with gamma's, i.e, digamma(±0.) == ∓real.infinity?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions