To be clear, this function is unbounded below and does not have a minimum.
That means it does not satisfy the preconditions of minimize
, assumptions that it makes about its input, so you should not pass it to minimize
.
Anyone know why scipy.minimize with SLSQP terminates successfully?
It uses some heuristics to determine what's going on and whether it's appropriate to terminate, and in this case of an invalid input the heuristics failed because the author of those heuristics did not take this input into account. All heuristics are, by nature, heuristic, and not guaranteed to be correct.
One commonly made assumption is that all interesting values of $x$ and $f(x)$ are of reasonably small magnitude (not huge, or infinite, as in this case). Not that this is ideal, but it holds (possibly after rescaling) for most interesting problems.
Am I supposed to interpret -3e8 as negative infinity?
No. Numerical algorithms only aim to be approximately correct, and rarely offer any strong guarantees on the correctness of their outputs. All you can conclude is that $-3\times 10^8$ is the algorithm's best guess at the minimum value. In this case, the result is clearly wrong, but that is because you violated the assumptions the algorithm makes about its input functions.
Either change your function so that it does have a minimum, or consider filing a bug report with scipy, so that the invalid input gets recognized and causes an explicit error.
This doesn't inspire much confidence.
Any introductory numerical analysis textbook discusses the issues involved in using floating-point arithmetic (which is by nature and by necessity approximate), so I would recommend reading some introductions to numerical analysis to understand the challenges involved here, before blaming the authors of scipy.