docstr: evaluates an 2-dimensional peaks function for a list of coeffs
  
  f(x) = f_0(x) - f_1(x) - f_2(x)
  
  Where:
  f_0(x) = 3 * (1 - x_0)^2 * \exp(-x_0^2 - (x_1 + 1)^2)
  and
  f_1(x) = 10 * (.2 * x_0 - x_0^3 - x_1^5) * \exp(-x_0^2 - x_1^2)
  and
  f_2(x) = \exp(-(x_0 + 1)^2 - x_1^2) / 3
  
  Inspect with mystic_model_plotter using::
      mystic.models.peaks -b "-5:5:.1, -5:5:.1" -d
  
  The minimum is f(x)=-6.551133332835841 at x=(0.22827892, -1.62553496)
docstr_tok: ["evaluates","an","2-dimensional","peaks","function","for","a","list","of","coeffs","f","(","x",")","=","f_0","(","x",")","-","f_1","(","x",")","-","f_2","(","x",")","Where",":","f_0","(","x",")","=","3","*","(","1","-","x_0",")","^2","*","\\exp","(","-x_0^2","-","(","x_1","+","1",")","^2",")","and","f_1","(","x",")","=","10","*","(",".2","*","x_0","-","x_0^3","-","x_1^5",")","*","\\exp","(","-x_0^2","-","x_1^2",")","and","f_2","(","x",")","=","\\exp","(","-","(","x_0","+","1",")","^2","-","x_1^2",")","\/","3","Inspect","with","mystic_model_plotter","using",":",":","mystic.models.peaks","-b","``","-5:5",":",".1",",","-5:5",":",".1","''","-d","The","minimum","is","f","(","x",")","=-6.551133332835841","at","x=","(","0.22827892",",","-1.62553496",")"]
code: def function(self, coeffs):
      r"""evaluates an 2-dimensional peaks function for a list of coeffs
  
      f(x) = f_0(x) - f_1(x) - f_2(x)
  
      Where:
      f_0(x) = 3 * (1 - x_0)^2 * \exp(-x_0^2 - (x_1 + 1)^2)
      and
      f_1(x) = 10 * (.2 * x_0 - x_0^3 - x_1^5) * \exp(-x_0^2 - x_1^2)
      and
      f_2(x) = \exp(-(x_0 + 1)^2 - x_1^2) / 3
  
      Inspect with mystic_model_plotter using::
          mystic.models.peaks -b "-5:5:.1, -5:5:.1" -d
  
      The minimum is f(x)=-6.551133332835841 at x=(0.22827892, -1.62553496)
      """
      # x = asarray(x) #XXX: converting to numpy.array slows by 10x
      x, y = coeffs
      result = (
          3.0 * (1.0 - x) ** 2 * exp(-(x**2) - (y + 1.0) ** 2)
          - 10.0
          * (x * (1.0 / 5.0) - x**3 - y**5)
          * exp(-(x**2) - y**2)
          - 1.0 / 3.0 * exp(-((x + 1.0) ** 2) - y**2)
      )
      return result
  
imports: from .abstract_model import AbstractFunction
  from math import exp
label_desc: Use image node_id 2 for calling the Peaks obj's underlying member method code with example usage: obj.function(coeffs) and returns: result