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

Sage 2.10.alpha3: numerical noise doctest failure with gcc 4.2.2/x86-64 #1790

Closed
sagetrac-mabshoff mannequin opened this issue Jan 16, 2008 · 7 comments
Closed

Sage 2.10.alpha3: numerical noise doctest failure with gcc 4.2.2/x86-64 #1790

sagetrac-mabshoff mannequin opened this issue Jan 16, 2008 · 7 comments

Comments

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 16, 2008

As reported by Kate in https://groups.google.com/group/sage-devel/t/1cd682b8f3e49748

sage -t  devel/sage-main/sage/rings/polynomial/
polynomial_element.pyx**********************************************************************
File "polynomial_element.pyx", line 2644:
    sage: p.roots(ring=ComplexIntervalField(200))
Expected:

[([1.1673039782614186842560458998548421807205603715254890391400816 ..
1.1673039782614186842560458998548421807205603715254890391400829], 1),
([0.18123244446987538390180023778112063996871646618462304743773153 ..
0.18123244446987538390180023778112063996871646618462304743773341] +
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([0.18123244446987538390180023778112063996871646618462304743773153 ..
0.18123244446987538390180023778112063996871646618462304743773341] -
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777454 ..
-0.76488443360058472602982318770854173032899665194736756700777...] +
[0.35247154603172624931794709140258105439420648082424733283769... ..
0.35247154603172624931794709140258105439420648082424733283769...]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777454 ..
-0.764884433600584726029823187708541730328996651947367567007772...] -
[0.352471546031726249317947091402581054394206480824247332837691... ..
0.35247154603172624931794709140258105439420648082424733283769341]*I,
1)]
Got:

[([1.1673039782614186842560458998548421807205603715254890391400816 ..
1.1673039782614186842560458998548421807205603715254890391400829], 1),
([0.18123244446987538390180023778112063996871646618462304743773153 ..
0.18123244446987538390180023778112063996871646618462304743773341] +
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([0.18123244446987538390180023778112063996871646618462304743773153 ..
0.18123244446987538390180023778112063996871646618462304743773341] -
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777516 ..
-0.76488443360058472602982318770854173032899665194736756700777204] +
[0.35247154603172624931794709140258105439420648082424733283769091 ..
0.35247154603172624931794709140258105439420648082424733283769372]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777454 ..
-0.76488443360058472602982318770854173032899665194736756700777204] -
[0.35247154603172624931794709140258105439420648082424733283769091 ..
0.35247154603172624931794709140258105439420648082424733283769372]*I,
1)]
**********************************************************************
File "polynomial_element.pyx", line 2666:
    sage: p.roots(ring=CIF)
Expected:
    [([-1.4142135623730952 .. -1.4142135623730949], 1),
([1.4142135623730949 .. 1.4142135623730952], 1),
([-1.2146389322441827 .. -1.2146389322441821] -
[0.1414250525823937... .. 0.1414250525823939...]*I, 2),
([-0.141425052582393... .. -0.14142505258239376] +
[1.2146389322441821 .. 1.2146389322441827]*I, 2),
([0.141425052582393... .. 0.141425052582393...] -
[1.2146389322441821 .. 1.2146389322441827]*I, 2),
([1.2146389322441821 .. 1.2146389322441827] + [0.14142505258239376 ..
0.14142505258239399]*I, 2)]
Got:
    [([-1.4142135623730952 .. -1.4142135623730949], 1),
([1.4142135623730949 .. 1.4142135623730952], 1),
([-1.2146389322441827 .. -1.2146389322441821] -
[0.14142505258239373 .. 0.14142505258239397]*I, 2),
([-0.14142505258239397 .. -0.14142505258239373] +
[1.2146389322441821 .. 1.2146389322441827]*I, 2),
([0.14142505258239376 .. 0.14142505258239397] - [1.2146389322441821 ..
1.2146389322441827]*I, 2), ([1.2146389322441821 .. 1.2146389322441827]
+ [0.14142505258239376 .. 0.14142505258239399]*I, 2)]
**********************************************************************

Component: doctest coverage

Issue created by migration from https://trac.sagemath.org/ticket/1790

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.10 milestone Jan 16, 2008
@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Jan 16, 2008

@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Jan 16, 2008

comment:2

Merged in Sage 2.10.alpha4

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Jan 16, 2008
@robertwb
Copy link
Contributor

comment:3

Wait, RIF is based on mpfr/gmp, right? So the answers should be the same right down to the last bit on any platform...something deeper is going on here that (unless I'm mistaken) shouldn't just be covered up with ... in the doctests.

@robertwb robertwb reopened this Jan 16, 2008
@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Jan 16, 2008

comment:4

Well, Carl Witty and others are aware of the issue and we have been "fixing" those issue like this for a while. I think the real issue might be that the routine that converts the binary representation to string does give you more decimal places than you ask for to ensure that on reconversion you will get the same binary representation. But that is an issue that should be discussed on sage-devel with people like Paul Zimmermann. For that please open another ticket and close this ticket, unless you disagree.

Cheers,

Michael

@robertwb
Copy link
Contributor

comment:5

If Carl Witty and others are already aware of the issue, I'm more confident about this. I'll re-close the ticket.

@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Jan 16, 2008

comment:6

Well, I am fairly sure that Carl knows about this since it has been discussed in his presence in IRC. Please also have a look at [and its follow ups]

http://websympa.loria.fr/wwsympa/arc/mpfr/2008-01/msg00039.html

which discusses reqdigits in our mpfr wrapper. This might cause some of the above issue, but we should really discuss this on sage-devel in my opinion and then comment in the sources, so this is solved once and for all. I had the same reaction as you initially since I also expected the results from computations in this ring [and the mpfi wrapper] to be identical every time.

Cheers,

Michael

@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Jan 16, 2008

Attachment: Sage-2.10.alpha3-#1790-leftovers.patch.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant