def polyval(fit, arg):
    """
    Calculate polynomial value at arg. x=f(y)

    :param fit: polynomial parameters
    :param arg: numerical or array of y values
    :return: x
    """
    return fit[0]*arg**2 + fit[1]*arg + fit[2]