Added a check for function value == -inf. Added a future test for a linear funciton, though the optimizers do not currently pass it