Ticket #1790 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

[with patch] Sage 2.10.alpha3: numerical noise doctest failure with gcc 4.2.2/x86-64

Reported by: mabshoff Owned by: failure
Priority: major Milestone: sage-2.10
Component: doctest coverage Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

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)]
**********************************************************************

Attachments

Sage-2.10.alpha3-fix-numerical-doctest-failure-gcc-4.2.2-x86-64.patch Download (5.6 KB) - added by mabshoff 5 years ago.
Sage-2.10.alpha3-#1790-leftovers.patch Download (4.1 KB) - added by mabshoff 5 years ago.

Change History

comment:1 Changed 5 years ago by mabshoff

  • Summary changed from Sage 2.10.alpha3: numerical noise doctest failure with gcc 4.2.2/x86-64 to [with patch] Sage 2.10.alpha3: numerical noise doctest failure with gcc 4.2.2/x86-64

comment:2 Changed 5 years ago by mabshoff

  • Status changed from new to closed
  • Resolution set to fixed

Merged in Sage 2.10.alpha4

comment:3 Changed 5 years ago by robertwb

  • Status changed from closed to reopened
  • Resolution fixed deleted

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.

comment:4 Changed 5 years ago by mabshoff

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

comment:5 Changed 5 years ago by robertwb

  • Status changed from reopened to closed
  • Resolution set to fixed

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

comment:6 Changed 5 years ago by mabshoff

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

Changed 5 years ago by mabshoff

Note: See TracTickets for help on using tickets.