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
Some more doctests from the book "Calcul mathématique avec Sage" #11672
Comments
comment:2
Martin, please could you review this? This will help our book to be more stable with future Paul |
comment:3
Sure, I can take a look:
File "/mnt/usb1/scratch/malb/sage-4.7.2/devel/sage/sage/tests/french_book/mpoly.py", line 373:
sage: [CDF['x'](p(y=ys[0][0])).roots() for p in J.gens()]
Expected:
[[(-0.6 - 1.30624677741e-16*I, 1), (0.6 + 1.30624677741e-16*I, 1)],
[(0.6 - 3.13499226579e-16*I, 1), (2.6 + 3.13499226579e-16*I, 1)]]
Got:
[[(-0.6 - 1.30628991909e-16*I, 1), (0.6 + 1.30628991909e-16*I, 1)],
[(0.6 - 3.13509580582e-16*I, 1), (2.6 + 3.13509580582e-16*I, 1)]] |
Reviewer: Martin Albrecht |
comment:4
Martin, on which platform do you get numerical noise errors? With Sage 4.7 on a 64-bit Core 2, Paul |
comment:5
This was on sage.math (sorry, should have mentioned). |
comment:6
I will try to make this go through |
comment:7
thanks Charles! Paul |
Author: Marc Mezzarobba |
comment:9
Charles: Thanks! Here is a new version of the patch, updated to the last draft of the book (which contains what should hopefully be the final version of the chapters in question...) and to Sage 5.5. |
comment:10
Looks good to me ! |
This comment has been minimized.
This comment has been minimized.
Changed reviewer from Martin Albrecht to Martin Albrecht, Charles Bouillaguet |
comment:11
On sage.math (Linux x86_64):
|
comment:12
I am unable to reproduce the failure you get on sage.math (though I am working on Linux x86_64 too), so I just reduced the number of digits taken into account in this test again. |
comment:13
I confirm that I ran the tests before giving the earlier positive review. It did work fine on my core i7-3615QM CPU running OS X 10.7.5... The new patch also gets a positive review (the tests pass). |
comment:14
On bsd (OS X 10.6 x86_64):
On arando (Linux Ubuntu 12.04 i686):
|
comment:15
I wonder why we get different results for
Since MPFI is based on MPFR, MPFI should be architecture independent, but I wonder if the same applies to Singular, numpy and ginac... Paul |
Attachment: trac_11672_doctests_from_french_book.patch.gz New version (last draft of the book, Sage 5.5) |
comment:16
Paul: Could it be that whatever is used is compiled using extended precision on some platforms? Another strange thing, though, is that
finds 3 solutions for p as low as 39... Anyway, this test doesn't make much sense, I shouldn't have included this test in the first place. Here is a new version of the patch without that test. I took the opportunity to ignore the last few significant digits in another numerical result that might change a bit in the future. |
comment:18
yes, or with a different rounding precision. Anyway, it might be worth tracking down this issue. Jeroen, is there a way to trace the calls to the different Sage components (MPFI, Singular, numpy, ginac)? Paul |
comment:19
Replying to @mezzarobba:
Well, the test obviously indicate that there is a problem somewhere, and I tend to believe that we should keep the test and track the problem. Either your computation is ill-conditioned, and the test should be removed from Sage (and probably also from the book), or there is a component of sage that misbehaves. We should understand what the situation is, and act accordingly. These tests have been there for 1.5 years, so we are not in a hurry. Maybe we could compare intermediate results on different machines? |
comment:20
Replying to @zimmermann6:
I don't think so. You could of course use |
comment:21
Replying to @sagetrac-Bouillaguet:
Sorry for the lack of context. Yes, the computation is ill-conditioned, that's deliberate (see http://purple.lateralis.org/sagebook-r1014.pdf, p. 210-211), and all three results above are completely wrong (the correct result is x=6.305...). As Paul noted, in an ideal world, this code should nontheless yield the same result everywhere, so it might have made sense to test that the result didn't change over time. But there are a number of reasonable explanations for what we observe, and (as far as I can tell) in Sage, floating-point results are usually interpreted as mere approximations that should agree with the correct answer "up to some numerical noise" rather than well-defined exact results. So I am in favor of dropping this testcase—unless the policy is that machine-precision floating-point computations should yield exactly the same result on all platforms. (Of course, this doesn't mean we shouldn't try to understand exactly what is going on!) |
comment:22
Or, add
|
comment:23
I have created #13980 to keep track of the numerical noise issue, so that we can make progress on this Paul |
comment:24
Replying to @jdemeyer:
Is that better? (Given that many examples from the book are already excluded from the tests for various reasons.) Please tell me if you would like me to update the test file. |
comment:25
It was only a suggestion, do as you wish. |
Merged: sage-5.7.beta2 |
The attached patch adds to the Sage testsuite most examples appearing Chapters 6 and 8 (Polynomials, Polynomial Systems) of the French book Calcul mathématique avec Sage. See #9395 for some background.
All tests pass with sage 5.5.
CC: @malb @sagetrac-Bouillaguet
Component: doctest coverage
Author: Marc Mezzarobba
Reviewer: Martin Albrecht, Charles Bouillaguet
Merged: sage-5.7.beta2
Issue created by migration from https://trac.sagemath.org/ticket/11672
The text was updated successfully, but these errors were encountered: