'Stub that should be overridden by new Functions to return
the first non-zero term in a series if ever an x-dependent
argument whose leading term vanishes as x -> 0 might be encountered.
See, for example, cos._eval_as_leading_term.'

def _eval_as_leading_term(self, x):

    from sympy import Order
    args = [a.as_leading_term(x) for a in self.args]
    o = Order(1, x)
    if any((((x in a.free_symbols) and o.contains(a)) for a in args)):
        raise NotImplementedError(('%s    has    no    _eval_as_leading_term    routine' % self.func))
    else:
        return self.func(*args)
