Using numpy, I have this definition of a function:
def powellBadlyScaled(X):
f1 = 10**4 * X[0] * X[1] - 1
f2 = numpy.exp(-numpy.float(X[0])) + numpy.exp(-numpy.float(X[1])) - 1.0001
return f1 + f2
This function is evaluated a huge number of times on an optimization routine. It often raises exception:
RuntimeWarning: overflow encountered in exp
I understand that operand cannot be stored in allocated space for a float. But how can I overcome the problem?