code: def fiedler_companion(a):
      """Returns a Fiedler companion matrix
  
      Given a polynomial coefficient array ``a``, this function forms a
      pentadiagonal matrix with a special structure whose eigenvalues coincides
      with the roots of ``a``.
  
      Args:
          a (cupy.ndarray): 1-D array of polynomial coefficients in descending
              order with a nonzero leading coefficient. For ``N < 2``, an empty
              array is returned.
  
      Returns:
          cupy.ndarray: Resulting companion matrix
  
      Notes:
          Similar to ``companion`` the leading coefficient should be nonzero. In
          the case the leading coefficient is not 1, other coefficients are
          rescaled before the array generation. To avoid numerical issues, it is
          best to provide a monic polynomial.
  
      .. seealso:: :func:`cupyx.scipy.linalg.companion`
      .. seealso:: :func:`scipy.linalg.fiedler_companion`
      """
      if a.ndim != 1:
          raise ValueError("Input `a` must be a 1-D array.")
      if a.size < 2:
          return cupy.zeros((0,), a.dtype)
      if a.size == 2:
          return (-a[1] / a[0])[None, None]
      # Following check requires device-to-host synchronization so will we not
      # raise an error this situation
      # if a[0] == 0.:
      #     raise ValueError('Leading coefficient is zero.')
      a = a / a[0]
      n = a.size - 1
      c = cupy.zeros((n, n), dtype=a.dtype)
      # subdiagonals
      cupy.fill_diagonal(c[3::2, 1::2], 1)
      cupy.fill_diagonal(c[2::2, 1::2], -a[3::2])
      # superdiagonals
      cupy.fill_diagonal(c[::2, 2::2], 1)
      cupy.fill_diagonal(c[::2, 1::2], -a[2::2])
      c[0, 0] = -a[1]
      c[1, 0] = 1
      return c
  
imports: import math
  import warnings
  import cupy
  from cupy import _core
  from cupyx.scipy.linalg import _uarray
label_desc: Use image node_id 17 for calling a global function with example usage: fiedler_companion(a) and returns: c, cupy, unknown