def accuracy(y, yhat):
    """Returns the accuracy. Higher is better.

    :param y: true function values
    :param yhat: predicted function values

    """
    return float(sum(map(lambda x: x[0] == x[1],
                            zip(y, yhat)))) / len(y)