Skip to content

Polylog inaccurate for s very close to an integer and z outside of the unit circle #634

Description

@Gattocrucco

Some examples:

import mpmath as mp
def check(s, z):
    pl1 = mp.polylog(s, z)
    print(pl1.real)
    with mp.workdps(32):
        pl2 = mp.polylog(s, z)
        print(pl2.real)
check(1+1e-15, -2) # bad
check(1, -2 + 1e-8j) # ok (s exactly an integer)
check(1+1e-15, -0.5 + 1e-8j) # ok (|z| < 1)
-1.0986328125
-1.0986122886681101262610921881491
-1.09861228866811
-1.0986122886681096969508007924781
-0.405465108108164
-0.40546510810816446598993214576279

Older polylog issues: #473, #505

mpmath version: 1.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions