docstr: evaluates an N-dimensional Griewangk's function for a list of coeffs
  
  f(x) = f_0(x) - f_1(x) + 1
  
  Where:
  f_0(x) = \sum_(i=0)^(N-1) x_(i)^(2) / 4000.
  and:
  f_1(x) = \prod_(i=0)^(N-1) \cos( x_i / (i+1)^(1/2) )
  
  Inspect with mystic_model_plotter using::
      mystic.models.griewangk -b "-10:10:.1, -10:10:.1" -d -x 5
  
  The minimum is f(x)=0.0 for x_i=0.0
docstr_tok: ["evaluates","an","N-dimensional","Griewangk","'s","function","for","a","list","of","coeffs","f","(","x",")","=","f_0","(","x",")","-","f_1","(","x",")","+","1","Where",":","f_0","(","x",")","=","\\sum_","(","i=0",")","^","(","N-1",")","x_","(","i",")","^","(","2",")","\/","4000.","and",":","f_1","(","x",")","=","\\prod_","(","i=0",")","^","(","N-1",")","\\cos","(","x_i","\/","(","i+1",")","^","(","1\/2",")",")","Inspect","with","mystic_model_plotter","using",":",":","mystic.models.griewangk","-b","``","-10:10",":",".1",",","-10:10",":",".1","''","-d","-x","5","The","minimum","is","f","(","x",")","=0.0","for","x_i=0.0"]
code: def function(self, coeffs):
      r"""evaluates an N-dimensional Griewangk's function for a list of coeffs
  
      f(x) = f_0(x) - f_1(x) + 1
  
      Where:
      f_0(x) = \sum_(i=0)^(N-1) x_(i)^(2) / 4000.
      and:
      f_1(x) = \prod_(i=0)^(N-1) \cos( x_i / (i+1)^(1/2) )
  
      Inspect with mystic_model_plotter using::
          mystic.models.griewangk -b "-10:10:.1, -10:10:.1" -d -x 5
  
      The minimum is f(x)=0.0 for x_i=0.0"""
      # x = asarray(x) #XXX: converting to numpy.array slows by 10x
      term1 = sum([c * c for c in coeffs]) / 4000.0
      term2 = 1
      for i in range(len(coeffs)):
          term2 = term2 * cos(coeffs[i] / sqrt(i + 1.0))
      return term1 - term2 + 1
  
file_path: mystic/mystic/models/storn.py
imports: from .abstract_model import AbstractFunction
  from numpy import asarray
  from math import pow, cos, sqrt
  from numpy import sign, floor
label_desc: Use image node_id 2 for calling the Griewangk obj's underlying member method code with example usage: obj.function(coeffs) and returns: unknown