Numpy dot too clever about symmetric multiplications
Anybody know about documentation for this behaviour? import numpy as np A = np.random.uniform(0,1,(10,5)) w = np.ones(5) Aw = A*w Sym1 = Aw.dot(Aw.T) Sym2 = (A*w).dot((A*w).T) diff = Sym1 - Sym2 diff.max() is near machine-precision non-zero , e.g. 4.4e-16. This (the discrepancy from 0) is usually fine... in a finite-precision world we should not be surprised. Moreover, I would guess that numpy is being smart about symmetric products, to save flops and ensure symmetric output... But I deal with chaotic systems, and this small discrepancy quickly becomes noticeable when debugging . So I'd like