unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41665: python-numpy: incorrect results on i686-linux
@ 2020-06-02 16:16 Diego Nicola Barbato
  0 siblings, 0 replies; only message in thread
From: Diego Nicola Barbato @ 2020-06-02 16:16 UTC (permalink / raw)
  To: 41665

Hi Guix,

On i686-linux Numpy produces incorrect results for some matrix
products.

This minimal reproducer ...

--8<---------------cut here---------------start------------->8---
python3 <<EOF
from numpy import array
from numpy.linalg import inv
A = array([[1. , 0. , 0. ],
           [0. , 3. , 3. ],
           [0. , 0. , 1. ]])
print(inv(A) @ A[:,2])
print((inv(A) @ A)[:,2])
EOF
--8<---------------cut here---------------end--------------->8---

... should return:

--8<---------------cut here---------------start------------->8---
[0. 0. 1.]
[0. 0. 1.]
--8<---------------cut here---------------end--------------->8---

On x86_64-linux, armhf-linux, and aarch64-linux I get the correct
result.  On i686-linux I get this instead:

--8<---------------cut here---------------start------------->8---
[ 0.00000000e+00 -5.55111512e-17  1.00000000e+00]
[0. 0. 1.]
--8<---------------cut here---------------end--------------->8---

I came across this bug while looking into https://debbugs.gnu.org/40406,
for which it seems to be the underlying cause.

I'm surprised this wasn't caught by Numpy's test suite.

Regards,

Diego




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-02 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 16:16 bug#41665: python-numpy: incorrect results on i686-linux Diego Nicola Barbato

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).