Bug#499565: basic matrix computations give incorrect results

Frederic Lehobey Frederic at Lehobey.net
Mon Sep 22 13:29:17 UTC 2008


Hi,

Sylvestre Ledru <sylvestre.ledru at inria.fr> (2008-09-22 14:45:50) :
> 
> > -->A = [ 1 2 0 0 1; 2 0 1 0 2; 3 2 1 -1 4]
> >   A  =
> > 
> >      1.    2.    0.    0.    1.
> >      2.    0.    1.    0.    2.  	
> >      3.    2.    1.  - 1.    4.
> > 
> > -->R = rref(A)
> >   R  =
> > 
> >      1.    0.    0.5     0.    2.
> >      0.    1.  - 0.25    0.    2.776D-17
> >      0.    0.    0.      1.  - 2.
> > 
> > -->C = 2 * R
> >   C  =
> > 
> >      2.    0.    2.     0.    2.
> >      0.    2.  - 0.5    0.    5.551D-17
> >      0.    0.    0.     2.  - 2.
> > 
> > The result of C=2*R is incorrect. C(1,3) should be 1 not 2, C(1,5) should be 4 
> > not 2, and C(3,5) should be -4 not -2.
> After this example, could you try 
> -- > C(1,3)-1
> What is the result ?

I tried it on Sparc 64.

        -------------------------------------------
                         scilab-4.1.2

                  Copyright (c) 1989-2007          
              Consortium Scilab (INRIA, ENPC)      
        -------------------------------------------
 
 
Startup execution:
  loading initial environment
 
-->A = [ 1 2 0 0 1; 2 0 1 0 2; 3 2 1 -1 4]
 A  =
 
    1.    2.    0.    0.    1.  
    2.    0.    1.    0.    2.  
    3.    2.    1.  - 1.    4.  
 
-->R = rref(A)
 R  =
 
    1.    0.    0.5     0.    2.         
    0.    1.  - 0.25    0.    2.776D-17  
    0.    0.    0.      1.  - 2.         
 
-->C = 2 * R
 C  =
 
    2.    0.    2.     0.    2.         
    0.    2.  - 0.5    0.    5.551D-17  
    0.    0.    0.     2.  - 2.         
 
-->C(1,3)-1
 ans  =
 
  - 1.110D-16  
 
> We believe this might be a display issues (ie the internal value is OK
> but the display is wrong...).

  Then the issue is less important than what I thought. Could be
misleading and error prone though for the scientists using 64 bits
architectures. I let you decide on the severity.

> This used to occur with old version of gfortran.

$ LANG=C aptitude show gfortran
Package: gfortran
New: yes
State: installed
Automatically installed: yes
Version: 4:4.3.0-8
Priority: optional
Section: devel
Maintainer: Debian GCC Maintainers <debian-gcc at lists.debian.org>
Uncompressed Size: 41.0k
Depends: cpp (>= 4:4.3.0-8), gcc (>= 4:4.3.0-8), gfortran-4.3 (>= 4.3.0-5)
Suggests: gfortran-multilib, gfortran-doc
Provides: fortran-compiler
Description: The GNU Fortran 95 compiler
 This is the GNU Fortran 95 compiler, which compiles Fortran 95 on platforms
 supported by the gcc compiler. It uses the gcc backend to generate optimized
 code. 
 
 This is a dependency package providing the default GNU Fortran 95 compiler.

I updated (in sid) then the gfortran to

----
Package: gfortran
New: yes
State: installed
Automatically installed: yes
Version: 4:4.3.2-1
Priority: optional
Section: devel
Maintainer: Debian GCC Maintainers <debian-gcc at lists.debian.org>
Uncompressed Size: 41.0k
Depends: cpp (>= 4:4.3.2-1), gcc (>= 4:4.3.2-1), gfortran-4.3 (>= 4.3.2-1)
Suggests: gfortran-multilib, gfortran-doc
Provides: fortran-compiler
Description: The GNU Fortran 95 compiler
 This is the GNU Fortran 95 compiler, which compiles Fortran 95 on platforms
 supported by the gcc compiler. It uses the gcc backend to generate optimized
 code. 
 
 This is a dependency package providing the default GNU Fortran 95 compiler.
----

The scilab output is the same.

Best regards,
Frédéric





More information about the debian-science-maintainers mailing list