code: def _central2(f, fx, x, h):
          
          n = len(x)
          ee = np.diag(h)
          dtype = np.result_type(fx)
          g = np.empty(n, dtype=dtype)
          gg = np.empty(n, dtype=dtype)
          for i in range(n):
              g[i] = f(x + ee[i])
              gg[i] = f(x - ee[i])
  
          hess = np.empty((n, n), dtype=dtype)
          np.outer(h, h, out=hess)
          for i in range(n):
              for j in range(i, n):
                  hess[i, j] = (f(x + ee[i, :] + ee[j, :])
                                + f(x - ee[i, :] - ee[j, :])
                                - g[i] - g[j] + fx
                                - gg[i] - gg[j] + fx) / (2 * hess[j, i])
                  hess[j, i] = hess[i, j]
          return hess
docs: Eq. 8