import random
import math


def evaluate_move(prev_td, prev_area, new_td, new_area, T):
    """Evaluates the move

    Parameters
    ----------
    prev_td : float
        Previous timing cost.
    prev_area : float
        Previous area cost.
    new_td : float
        New timing cost.
    new_area : float
        New area cost.
    T : float
        Temperature.
    
    Returns
    -------
    bool
        Indicator of acceptance.
    """

    td_vs_area = 0.5

    delta_td = (new_td - prev_td) / float(prev_td)
    delta_area = (new_area - prev_area) / float(prev_area)
    delta_c = td_vs_area * delta_td + (1.0 - td_vs_area) * delta_area

    if delta_c < 0:
        return True

    energy_threshold = random.random()
    energy = math.exp(-1 * delta_c / T)

    return energy > energy_threshold