-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Reintroduce tight enclosure of interval inversion #37963
Comments
I did use the following test function. def check(re, im):
precs = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 31, 32, 33, 100, 127, 128, 129]
for prec in precs:
c = ~ComplexIntervalField(prec)(re, im)
norm2 = re**2 + im**2
# check real part
inv = re / norm2
left, right = c.real().endpoints()
left = QQ(left.as_integer_ratio())
right = QQ(right.as_integer_ratio())
if left > inv or right < inv:
print('wrong real at prec={}: left={}~{} right={}~{} value={}~{}'.format(prec, left, left.n(prec=2*prec), right, right.n(prec=2*prec), inv, inv.n(prec=2*prec)))
# check imaginary part
inv = - im / norm2
left, right = c.imag().endpoints()
left = QQ(left.as_integer_ratio())
right = QQ(right.as_integer_ratio())
if left > inv or right < inv:
print('wrong imag at prec={}: left={}~{} right={}~{} value={}~{}'.format(prec, left, left.n(prec=2*prec), right, right.n(prec=2*prec), inv, inv.n(prec=2*prec))) It seems to be the case that the tight inversion has
|
I started looking at the implementation of the Rokne-Lancaster method that was just removed in 8d59b12 and found a couple of problems:
I think I understand the Rokne-Lancaster paper well enough that I can give an implementation a shot. |
Feel free to assign this to me. |
@unhyperbolic Would be nice if you can provide a (correct) tight enclosure! There is no need for a formal assignment of task. We do not use that much in sagemath. |
This provides a (hopefully) correct implementation of computing a tight enclosure for the inverse of a complex interval. It fixes sagemath#37963. There is some history to this: Commit 84ab655 from sagemath#19964 introduced a tight enclosure but had some bugs such as ticket sagemath#37927. Thus, the that commit (and the subsequent partial fixes) were reverted in commit 8d59b12, see pull request sagemath#37941. This is a new implementation of Rokne-Lancaster that I wrote from scratch. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies sagemath#37941 URL: sagemath#38360 Reported by: Matthias Goerner Reviewer(s): Marc Culler, Nathan Dunfield
In #37941 the
__invert__
implementation of complex intervals was reverted to the straightforward implementation. This issue stands for reintroducing tight reversion (hopefully correct this time).@miguelmarco @mezzarobba
The text was updated successfully, but these errors were encountered: