Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should be able to just check if it has no variables.

def is_numerically_evaluable(expr):
    return not expr.variables()

Then:

sage: is_numerically_evaluable(sin(1))
True
sage: is_numerically_evaluable(x)
False