polylog: fix for integer-valued parameter with complex type

This commit is contained in:
fredrik
2022-02-14 11:34:07 +01:00
parent 2bc6bd63dc
commit fcc7e53362
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -481,9 +481,9 @@ def polylog(ctx, s, z):
if abs(z) <= 0.75 or (not ctx.isint(s) and abs(z) < 0.9):
return polylog_series(ctx, s, z)
if abs(z) >= 1.4 and ctx.isint(s):
return (-1)**(s+1)*polylog_series(ctx, s, 1/z) + polylog_continuation(ctx, s, z)
return (-1)**(s+1)*polylog_series(ctx, s, 1/z) + polylog_continuation(ctx, int(ctx.re(s)), z)
if ctx.isint(s):
return polylog_unitcircle(ctx, int(s), z)
return polylog_unitcircle(ctx, int(ctx.re(s)), z)
return polylog_general(ctx, s, z)
@defun_wrapped
+2
View File
@@ -591,6 +591,8 @@ def test_polylog():
# issue 390
assert polylog(1.5, -48.910886523731889).ae(-6.272992229311817)
assert polylog(1.5, 200).ae(-8.349608319033686529 - 8.159694826434266042j)
assert polylog(-2+0j, -2).ae(mpf(1)/13.5)
assert polylog(-2+0j, 1.25).ae(-180)
def test_bell_polyexp():
mp.dps = 15