input: Write a function to implement the Gradient Descent Algorithm for linear regression. The function should take an array of input values `x`, an array of target values `y`, a learning rate, and the number of iterations as parameters. It should return the final slope `m_curr` and intercept `b_curr` after performing the specified number of iterations.
  assert gradient_descent([1, 2, 3, 4, 5], [2, 4, 5, 4, 5], 0.01, 100) == (0.6203, 0.3988)
  assert gradient_descent([1, 2, 3], [3, 5, 7], 0.01, 100) == (1.999, 1.0)
  assert gradient_descent([1, 2, 3, 4], [1, 2, 3, 4], 0.01, 100) == (1.0, 0.0)
  assert gradient_descent([], [], 0.01, 100) == (0.0, 0.0)
  assert gradient_descent([1, 2, 3, 4], [1, 4, 9, 16], 0.01, 100) == (3.499, -0.499)
  assert gradient_descent([1, 2, 3], [2, 4, 6], 0.01, 100) == (2.0, 0.0)
output: 
  def gradient_descent(x, y, learning_rate, num_iterations):
      n = len(x)
      if n == 0:
          return 0.0, 0.0
      m_curr = 0.0
      b_curr = 0.0
      for _ in range(num_iterations):
          y_predicted = m_curr * x + b_curr
          md = -(2/n) * sum(x * (y - y_predicted))
          bd = -(2/n) * sum(y - y_predicted)
          m_curr = m_curr - learning_rate * md
          b_curr = b_curr - learning_rate * bd
      return round(m_curr, 4), round(b_curr, 4)
  