Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compute mpmath.legenp(Even number, Odd number, 0) #780

Open
hsiatein opened this issue Apr 7, 2024 · 1 comment
Open

Unable to compute mpmath.legenp(Even number, Odd number, 0) #780

hsiatein opened this issue Apr 7, 2024 · 1 comment
Labels
question mark support request
Milestone

Comments

@hsiatein
Copy link

hsiatein commented Apr 7, 2024

My code:
image

And output:
C:\Users\30236\mpmathtest\Scripts\python.exe D:\python\mpmathtest\main.py
Traceback (most recent call last):
File "D:\python\mpmathtest\main.py", line 3, in
print(mpmath.legenp(10,1,0))
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\30236\mpmathtest\Lib\site-packages\mpmath\functions\orthogonal.py", line 379, in legenp
return ctx.hypercomb(h, [n,m], **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\30236\mpmathtest\Lib\site-packages\mpmath\functions\hypergeometric.py", line 125, in hypercomb
v = ctx.fprod([ctx.hyper(a_s, b_s, z, **kwargs)] +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\30236\mpmathtest\Lib\site-packages\mpmath\functions\hypergeometric.py", line 226, in hyper
if q == 1: return ctx._hyp2f1(a_s, b_s, z, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\30236\mpmathtest\Lib\site-packages\mpmath\functions\hypergeometric.py", line 443, in _hyp2f1
return ctx.hypsum(2, 1, (atype, btype, ctype), [a, b, c], z, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\30236\mpmathtest\Lib\site-packages\mpmath\ctx_mp.py", line 708, in hypsum
raise ValueError(ctx._hypsum_msg % (prec, prec+extraprec))
ValueError: hypsum() failed to converge to the requested 1964 bits of accuracy
using a working precision of 5479 bits. Try with a higher maxprec,
maxterms, or set zeroprec.

Then I tried several other parameter combinations and found that the program was unable to compute mpmath.legenp(Even number, Odd number, 0).

for example mpmath.legenp(2, 1, 0), mpmath.legenp(4, 1, 0), mpmath.legenp(4, 3, 0)...

@skirpichev skirpichev added the question mark support request label Apr 8, 2024
@skirpichev
Copy link
Collaborator

Have you tried a suggestion: "Try with a higher maxprec, maxterms, or set zeroprec"?

@skirpichev skirpichev added this to the 1.4 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question mark support request
Projects
None yet
Development

No branches or pull requests

2 participants