'Evaluate functional transformation ``q**n * f(p/q)``.'

def transform(f, p, q):

    if f.lev:
        raise ValueError('univariate    polynomial    expected')
    (lev, dom, per, P, Q) = p.unify(q)
    (lev, dom, per, F, P) = f.unify(per(P, dom, lev))
    (lev, dom, per, F, Q) = per(F, dom, lev).unify(per(Q, dom, lev))
    if (not lev):
        return per(dup_transform(F, P, Q, dom))
    else:
        raise ValueError('univariate    polynomial    expected')
