Skip to content

BUG: zeta(1/2, 1) returns nan #15036

@ghost

Description

Describe your issue.

The Hurwitz zeta function at 1/2, 1 is equivalent to Riemann zeta function at 1/2 and so zeta(1/2, 1) = zeta(1/2) = -1.46... (See WolframAlpha) but scipy.special.zeta returns nan. This may be expected behavior but if so it would be nice to have documentation for this behavior.

Related issue: pytorch/pytorch#68110

Reproducing Code Example

from scipy.special import zeta

# correct
output = zeta(1 / 2)
print(output)

# wrong
output = zeta(1 / 2, 1)
print(output)

Error message

-1.4603545088095866            
nan

SciPy/NumPy/Python version information

1.7.1 1.21.2 sys.version_info(major=3, minor=9, micro=8, releaselevel='final', serial=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.special

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions