def complex_product(a_re, a_im, b_re, b_im):
    """
    Computes the complex product of a and b, given the real and imaginary components of both.
    :param a_re: real component of a
    :param a_im: imaginary component of a
    :param b_re: real component of a
    :param b_im: imaginary component of a
    :return: tuple of real and imaginary components of result
    """
    a_re_ = a_re * b_re - a_im * b_im
    a_im = a_re * b_im + a_im * b_re
    return a_re_, a_im