def PF_op_pw(u, df, inverses, x):
    """
    PERRON-FROBENIUS OPERATOR POINTWISE
    
    Arguments:
    - <u> a function with one argument
    - <df> a function: the derivative of the dynamical system function f
      (should take one arg)
    - <inverses> a list of functions, each taking one argument, that find the
      inverse of x under each branch of f
    - <x> a float
    
    Returns:
    - a float, which is the value of PF(u) at the point x -- where PF is the
      PF-operator associated to the system f.
     
    NOTES:
    - Uses a formula for the PF-operator that only works if f is piecewise
      monotonic.
    """
    y = 0
    for inv in inverses:
        z = inv(x)
        y += u(z) / abs(df(z))
    return y