code: def goldstein(x):
      """Goldstein-Price's objective function.
  
      Only takes two dimensions and has a global minimum at
      :code:`f([0,-1])`. Its domain is bounded between :code:`[-2, 2]`
  
      Best visualized in the domain of :code:`[-1.3,1.3]` and range :code:`[-1,8000]`
  
      Parameters
      ----------
      x : numpy.ndarray
          set of inputs of shape :code:`(n_particles, dimensions)`
  
      Returns
      -------
      numpy.ndarray
          computed cost of size :code:`(n_particles, )`
  
      Raises
      ------
      IndexError
          When the input dimensions is greater than what the function
          allows
      ValueError
          When the input is out of bounds with respect to the function
          domain
      """
      if not x.shape[1] == 2:
          raise IndexError(
              "Goldstein function only takes two-dimensional " "input."
          )
      if not np.logical_and(x >= -2, x <= 2).all():
          raise ValueError(
              "Input for Goldstein-Price function must be within "
              "[-2, 2]."
          )
  
      x_ = x[:, 0]
      y_ = x[:, 1]
      j = (
          1
          + (x_ + y_ + 1) ** 2.0
          * (
              19
              - 14 * x_
              + 3 * x_**2.0
              - 14 * y_
              + 6 * x_ * y_
              + 3 * y_**2.0
          )
      ) * (
          30
          + (2 * x_ - 3 * y_) ** 2.0
          * (
              18
              - 32 * x_
              + 12 * x_**2.0
              + 48 * y_
              - 36 * x_ * y_
              + 27 * y_**2.0
          )
      )
  
      return j
  
file_path: pyswarms/pyswarms/utils/functions/single_obj.py
imports: import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: goldstein(x) and returns: j