scipy/scipy — pull request #2864 by pv (2013-09-13 18:13:46+00:00)
Title: BUG: optimize: ensure line search is not confused by float issues

Detect non-finite (nan, inf) results from _cubicmin and _quadmin so that
the rest of the line search doesn't become confused. Avoids problems
when float overflows etc. occur.

Also replace intermediate value checks by exceptions.

Fixes gh-2169