<p dir="auto">I get very very strange numerical inconsistencies like these:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1093567/40580834-df8b364e-6147-11e8-9b4d-4f6aa0300643.png"><img width="789" alt="screen shot 2018-05-27 at 0 29 08" src="https://user-images.githubusercontent.com/1093567/40580834-df8b364e-6147-11e8-9b4d-4f6aa0300643.png" style="max-width: 100%;"></a><br>
I could reproduce this in ipython and jupyter notebook but only on macOS, not on Linux. Here is a gist with <a href="https://gist.github.com/cod3licious/d2926e0bdc1355f0a921ac083d2799eb">code to reproduce the error</a> (Note that you need to download and unzip a file first and then appropriately copy your value of <code class="notranslate">vec_x</code> to <code class="notranslate">a</code>.) The error also happens for <code class="notranslate">np.dot</code> and possibly other functions.</p>
<p dir="auto">My system specs:<br>
macOS 10.13.4 (17E202)<br>
Python 3.6.4 :: Anaconda custom (64-bit)<br>
jupyter-notebook 5.4.0<br>
ipython 6.2.1<br>
numpy 1.14.2<br>
gensim 3.4.0</p>
<p dir="auto">This is a cross post from this <a href="https://github.com/jupyter/notebook/issues/3641" data-hovercard-type="issue" data-hovercard-url="/jupyter/notebook/issues/3641/hovercard">jupyter notebook issue</a> (as I really don't know who's the culprit in the end).</p>
<p dir="auto">Running numpy.dot normally produces the expected answer:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$  python -c &quot;import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)&quot;
2.0"><pre class="notranslate"><code class="notranslate">$  python -c "import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)"
2.0
</code></pre></div>
<p dir="auto">If I import a PyQt5 module first, I get a different answer:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$  python -c &quot;import PyQt5.QtWidgets ; import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)&quot;
0.0"><pre class="notranslate"><code class="notranslate">$  python -c "import PyQt5.QtWidgets ; import numpy ; f=numpy.ones(2,dtype=numpy.float32);print f.dot(f)"
0.0
</code></pre></div>
<p dir="auto">Other folks appear to have found the issue <a href="https://support.enthought.com/hc/en-us/articles/204469560--RESOLVED-OSX-Numpy-float32-linear-algebra-bug" rel="nofollow">here</a>, with an implied implication of the Accelerate library being loaded first. I could not discover the resolution they used, and I would prefer one that did not require fixing python import order.</p>