scipy/scipy — pull request #4142 by ogrisel (2014-11-13 12:45:14+00:00)
Title: BUG: ZeroDivisionError in scipy.sparse.linalg.lsqr

This problem was found as an unstable test in scikit-learn: scikit-learn/scikit-learn#2986.

This PR includes a non regression test and a potential fix (adding eps's in the denominators of fractions computed for convergence checks). I don't understand the overall algorithm but I think that those eps should be pretty harmless as they only impact quantities computed for breaking out of the loop, not the solution itself.