-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
replace wrongly placed sig_on/off pair with sig_check #36422
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kwankyu
reviewed
Oct 9, 2023
kwankyu
reviewed
Oct 9, 2023
Otherwise, lgtm. |
fixes the bug noted in mpmath/mpmath#723 sage: from mpmath import * sage: mp.dps=16 sage: zeta(-0.01 + 1000j) --------------------------------------------------------------------------- SystemError Traceback (most recent call last) Cell In [3], line 1 ----> 1 zeta(-RealNumber('0.01') + ComplexNumber(0, '1000')) File /usr/lib/python3.11/site-packages/mpmath/functions/zeta.py:580, in zeta(ctx, s, a, derivative, method, **kwargs) 578 if ctx.re(s) > 2*ctx.prec and a == 1 and not derivative: 579 return ctx.one + ctx.power(2, -s) --> 580 return +ctx._hurwitz(s, a, d, **kwargs) File /usr/lib/python3.11/site-packages/mpmath/functions/zeta.py:595, in _hurwitz(ctx, s, a, d, **kwargs) 593 print("zeta: Attempting reflection formula") 594 try: --> 595 return _hurwitz_reflection(ctx, s, a, d, atype) 596 except NotImplementedError: 597 pass File /usr/lib/python3.11/site-packages/mpmath/functions/zeta.py:654, in _hurwitz_reflection(ctx, s, a, d, atype) 652 p += shift*q 653 assert 1 <= p <= q --> 654 g = ctx.fsum(ctx.cospi(t/2-2*k*b)*ctx._hurwitz(t,(k,q)) \ 655 for k in range(1,q+1)) 656 g *= 2*ctx.gamma(t)/(2*ctx.pi*q)**t 657 v += g File /mnt/opt/Sage/sage-dev/src/sage/libs/mpmath/ext_main.pyx:767, in sage.libs.mpmath.ext_main.Context.fsum() 765 workopts.rounding = ROUND_D 766 unknown = global_context.zero --> 767 sig_on() 768 try: # Way down, there is a ``finally`` with sig_off() 769 MPF_init(&sre) SystemError: calling remove_from_pari_stack() inside sig_on()
b1340a3
to
73bd82b
Compare
73bd82b
to
86cc741
Compare
kwankyu
approved these changes
Oct 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Documentation preview for this PR (built with commit 86cc741; changes) is ready! 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes the bug noted in mpmath/mpmath#723
The problem comes from the
sig_on/off
pair guarding non-Cython statements; we replace it bysig_check()