-
-
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
abs tol
unable to handle non-real numerical noise
#36631
Comments
It's not precisely that it can't handle complex numerical noise, but there can't be a mismatch between the output type and the expected output type. One of the failing examples on OS X looks like
If we change the expected output like this, it passses: diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py
index bef4a2b6c6..ab4be4fbbc 100644
--- a/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py
+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/mpoly_doctest.py
@@ -398,7 +398,7 @@ Sage example in ./mpoly.tex, line 1882::
sage: ys = CDF['y'](Jy.0).roots(); ys # abs tol 2e-15
[(-0.8, 1), (0.0, 1), (0.8, 1)]
sage: [CDF['x'](p(y=ys[0][0])).roots() for p in J.gens()] # abs tol 2e-15
- [[(-0.5999999999999999, 1), (0.6000000000000001, 1)], [(0.6000000000000001, 1), (2.600000000000001, 1)]]
+ [[(-0.5999999999999999, 1), (0.6000000000000001, 1)], [(0.6000000000000001 + 0*I, 1), (2.600000000000001 + 0*I, 1)]]
Sage example in ./mpoly.tex, line 1911::
As far as I understand, the tolerance checker will check each real number in the output with the corresponding number that Sage actually produces, so if Sage produces a complex number (which gets parsed to a pair of reals), then the doctest has to actually provide a complex number (a pair of reals) to which to compare it. This is certainly a flaw in the doctesting procedure. It would be nice, at least for |
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631
I've implemented the "complex abs tol" proposal in #38433, please review |
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631 URL: sagemath#38433 Reported by: Volker Braun Reviewer(s): Dima Pasechnik
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631 URL: sagemath#38433 Reported by: Volker Braun Reviewer(s): Dima Pasechnik
For calculations over complex numbers that generate numeric noise, one tends to create small but non-zero imaginary parts. This PR updates the "# abs tol" tolerance setting to work over the complex numbers, as the "abs" suggests complex numbers. The real and imaginary parts are compared separately. The ordinary "# tol" and "# rel tol" are left as is. Fixes sagemath#36631 URL: sagemath#38433 Reported by: Volker Braun Reviewer(s): Dima Pasechnik
E.g.
gives
Indeed,
RIF
is used as data to check tolerances, no wonder things go wrong here.By right, one needs a complex
abs tol
andrel tol
.Originally posted by @dimpase in #36509 (comment)
The text was updated successfully, but these errors were encountered: