catch roundoff error exceptions in optimization