Opened 7 years ago

Closed 7 years ago

#1376 closed defect (fixed)

2.8.15.rc0: numerical doctest failure

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

Description

The following is a failed doctest because of we changed the default printing behavior for floats:

sage -t  devel/sage-main/sage/calculus/calculus.py
**********************************************************************
File "calculus.py", line 1973:
    sage: f.n(200)
Expected:
    -0.00000000000074992740280181431112064614366622348652078895136533593355718
Got:
    -7.4992740280181431112064614366622348652078895136533593355718e-13
**********************************************************************
File "calculus.py", line 1975:
    sage: f.n(300)
Expected:
    -0.000000000000749927402801814311120646143662663009137292462589621789352095066181709095575681963967103004
Got:
    -7.49927402801814311120646143662663009137292462589621789352095066181709095575681963967103004e-13
**********************************************************************

Change History (3)

comment:1 Changed 7 years ago by mabshoff

  • Summary changed from 2.8.15.rc0: sage/calculus/calculus.py doctest failure to 2.8.15.rc0: numerical doctest failure
sage -t  devel/sage-main/sage/rings/polynomial/polynomial_element.pyx
**********************************************************************
File "polynomial_element.pyx", line 2632:
    sage: p.roots(ring=QQbar)
Expected:
    [([-0.50000000000000012 .. -0.49999999999999994] + [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([-0.50000000000000000 .. -0.50000000000000000] - [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([0.18123244446987538 .. 0.18123244446987541] + [1.0839541013177105 .. 1.0839541013177108]*I, 2)]
Got:
    [([-0.50000000000000012 .. -0.49999999999999994] + [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([-0.50000000000000012 .. -0.49999999999999994] - [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([0.18123244446987538 .. 0.18123244446987541] + [1.0839541013177105 .. 1.0839541013177108]*I, 2)]
**********************************************************************
File "polynomial_element.pyx", line 2634:
    sage: p.roots(ring=CIF)
Expected:
    [([-0.50000000000000012 .. -0.49999999999999994] + [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([-0.50000000000000000 .. -0.50000000000000000] - [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([0.18123244446987538 .. 0.18123244446987541] + [1.0839541013177105 .. 1.0839541013177108]*I, 2)]
Got:
    [([-0.50000000000000012 .. -0.49999999999999994] + [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([-0.50000000000000012 .. -0.49999999999999994] - [0.86602540378443859 .. 0.86602540378443871]*I, 1), ([0.18123244446987538 .. 0.18123244446987541] + [1.0839541013177105 .. 1.0839541013177108]*I, 2)]
**********************************************************************
File "polynomial_element.pyx", line 2647:
    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.14142505258239399 .. -0.14142505258239376] + [1.2146389322441821 .. 1.2146389322441827]*I, 2), ([0.14142505258239376 .. 0.14142505258239399] - [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.14142505258239376 .. 0.14142505258239397]*I, 2), ([-0.14142505258239397 .. -0.14142505258239376] + [1.2146389322441821 .. 1.2146389322441827]*I, 2), ([0.14142505258239373 .. 0.14142505258239397] - [1.2146389322441821 .. 1.2146389322441827]*I, 2), ([1.2146389322441821 .. 1.2146389322441827] + [0.14142505258239376 .. 0.14142505258239399]*I, 2)]
**********************************************************************
1 items had failures:
   3 of 109 in __main__.example_58
***Test Failed*** 3 failures.

comment:2 Changed 7 years ago by mabshoff

sage -t  devel/sage-main/sage/rings/polynomial/complex_roots.py
**********************************************************************
File "complex_roots.py", line 288:
    sage: rts = complex_roots(p); type(rts[0][0]), rts
Expected:
    (<type 'sage.rings.complex_interval.ComplexIntervalFieldElement'>, [([-0.000000000000000085405681994008930 .. 0.00000000000000018852810564551411] + [1.6180339887498944 .. 1.6180339887498952]*I, 1), ([-1.6180339887498952 .. -1.6180339887498944] + [-0.00000000000000018852810564551411 .. 0.000000000000000085405681994008930]*I, 1), ([0.61803398874989468 .. 0.61803398874989502] + [-0.00000000000000011497311295586537 .. 0.000000000000000052767663576832497]*I, 1), ([-0.000000000000000054022849329007172 .. 0.00000000000000011371792720369062] - [0.61803398874989468 .. 0.61803398874989502]*I, 1)])
Got:
    (<type 'sage.rings.complex_interval.ComplexIntervalFieldElement'>, [([-2.8836212165089293e-16 .. 4.7404441675278100e-17] + [1.6180339887498946 .. 1.6180339887498952]*I, 1), ([-1.6180339887498952 .. -1.6180339887498944] + [-1.8852810564551411e-16 .. 8.5405681994008930e-17]*I, 1), ([0.61803398874989468 .. 0.61803398874989502] + [-1.1236596864560003e-16 .. 5.5374807887097754e-17]*I, 1), ([-5.4022849329007172e-17 .. 1.1371792720369062e-16] - [0.61803398874989468 .. 0.61803398874989502]*I, 1)])
**********************************************************************
File "complex_roots.py", line 290:
    sage: rts = complex_roots(p, retval='algebraic'); type(rts[0][0]), rts
Expected:
    (<class 'sage.rings.qqbar.AlgebraicNumber'>, [([-3.7249532943328317e-20 .. 3.7095114777437122e-20] + [1.6180339887498946 .. 1.6180339887498950]*I, 1), ([-1.6180339887498950 .. -1.6180339887498946] + [-3.7095114777437122e-20 .. 3.7249532943328317e-20]*I, 1), ([0.61803398874989479 .. 0.61803398874989491] + [-1.8145161579843782e-20 .. 3.1750950176743468e-20]*I, 1), ([-2.5399597786669076e-20 .. 2.0313092838036301e-20] - [0.61803398874989479 .. 0.61803398874989491]*I, 1)])
Got:
    (<class 'sage.rings.qqbar.AlgebraicNumber'>, [([-2.5297186544008181e-20 .. 4.5178375837717923e-20] + [1.6180339887498946 .. 1.6180339887498950]*I, 1), ([-1.6180339887498950 .. -1.6180339887498946] + [-3.7095114777437122e-20 .. 3.7249532943328317e-20]*I, 1), ([0.61803398874989479 .. 0.61803398874989491] + [-1.5445351834529870e-20 .. 3.2940467984864619e-20]*I, 1), ([-2.5399597786669076e-20 .. 2.0313092838036301e-20] - [0.61803398874989479 .. 0.61803398874989491]*I, 1)])
**********************************************************************

comment:3 Changed 7 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.