#14965: FloatingPoint exception when multiplying matrix over QQ by vector over 
SR
-------------------------------------+-------------------------------------
       Reporter:  dkrenn             |        Owner:
           Type:  defect             |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-
      Component:  linear algebra     |  duplicate/invalid/wontfix
       Keywords:  matrix, vector,    |   Resolution:
  mutliplication, floatingpoint      |    Merged in:
  exception                          |    Reviewers:  Jeroen Demeyer
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |     Stopgaps:
   Dependencies:  #16908             |
-------------------------------------+-------------------------------------
Description changed by nbruin:

Old description:

> The input
> {{{
> Z=1/3
> def matrix_entry(s,r):
>     result = 0
>     result += Z^(s-r)
>     return result
> A = matrix([[matrix_entry(s,r) for r in range(1,22)] for s in
> range(1,22)])
> v = vector([(2/3)^s+x*(2/3+4/9*(2/3)^30)^s for s in range(1,22)])
> A*v
> }}}
> gives
> {{{
> Traceback (click to the left of this block for traceback)
> ...
> RuntimeError: Floating point exception
> }}}
> Since the matrix has entries in {{{QQ}}} and the vector entries in the
> symbolic ring, there should not be any floating point operations
> involved.
>
> The example starts to work if you take smaller matrices or other entries.

New description:

 The input
 {{{
 Z=1/3
 def matrix_entry(s,r):
     result = 0
     result += Z^(s-r)
     return result
 A = matrix([[matrix_entry(s,r) for r in range(1,22)] for s in
 range(1,22)])
 v = vector([(2/3)^s+x*(2/3+4/9*(2/3)^30)^s for s in range(1,22)])
 A*v
 }}}
 gives
 {{{
 Traceback (click to the left of this block for traceback)
 ...
 RuntimeError: Floating point exception
 }}}
 Since the matrix has entries in {{{QQ}}} and the vector entries in the
 symbolic ring, there should not be any floating point operations involved.

 The example starts to work if you take smaller matrices or other entries.

 '''NOTE:'''
 The way to trigger the bug from sage is now:
 {{{
 sage:
 
f=84644440725961403098463183554485799389772425728699536724546678651368471662755793858191462623325951275455550962101277270763335324980423888503086416881487600951168887632284102290001262851926718316596582705934285641705714110547524777517804311041930987129930496818273454551255885915706318740821679919000000000000000000000*x/422165920314471048721358275854632323285179941428330150821135511815100042994592631347355397175387243022779234708963662480477375868719044084318634583443223137428890926160543699705457864438134730545535596936604372279922247951010042249163649352110753480952771747316504857000652757440826179465253453626540111934123296968384641+2097152/10460353203;
 sage: maxima_calculus(f)==0
 FloatingPointError
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/14965#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to