#NEWLINE# def himmelblau( p ) : #NEWLINE# #INDENT# '\n    R^2 -> R^1 test function for optimization.  The function has four local\n    minima where himmelblau(xopt) == 0.\n    ' #NEWLINE# ( x , y ) = p #NEWLINE# a = ( ( ( x * x ) + y ) - 11 ) #NEWLINE# b = ( ( x + ( y * y ) ) - 7 ) #NEWLINE# return ( ( a * a ) + ( b * b ) )