input: Write a function to implement the Gradient Descent Algorithm for linear regression. The function should take in input parameters for the independent variable (x), the dependent variable (y), the learning rate, and the number of iterations. It should return the optimized values of the slope (m) and the intercept (b). If the input arrays for x and y are empty, the function should print an error message and return None.
  
  
  import numpy as np
  
  def gradient_descent(x, y, learning_rate=0.01, iterations=100): 
      if len(x) == 0 or len(y) == 0:
          print("Error: Input arrays are empty.")
          return None
      
      m_curr = b_curr = 0
      n = len(x)
      for i in range(iterations):
          y_predicted = m_curr * x + b_curr
          cost = (1/n) * sum([val**2 for val in (y-y_predicted)])
          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
          print ("m {}, b {}, cost {} iteration {}".format(m_curr,b_curr,cost, i))
      return m_curr, b_curr
  
  assert gradient_descent([], [])==None
  assert gradient_descent([1, 2, 3], [2, 4, 6]) is not None
  assert type(gradient_descent([1, 2, 3], [2, 4, 6])) == tuple
  
output: def gradient_descent(x, y, learning_rate=0.01, iterations=100): 
      if len(x) == 0 or len(y) == 0:
          print("Error: Input arrays are empty.")
          return None
      
      m_curr = b_curr = 0
      n = len(x)
      for i in range(iterations):
          y_predicted = m_curr * x + b_curr
          cost = (1/n) * sum([val**2 for val in (y-y_predicted)])
          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 m_curr, b_curr