def def_N(ifevalf):
    """
    Define a function that calls .evalf() if ifevalf.
    """
    if ifevalf:
        def N(arg):
            """call .evalf()"""
            return arg.evalf()
    else:
        def N(arg):
            """do not call .evalf()"""
            return arg
    return N