def implemented_function(symfunc, implementation):
 from sympy.core.function import UndefinedFunction
 if isinstance(symfunc, string_types):
  symfunc = UndefinedFunction(symfunc)
 elif (not isinstance(symfunc, UndefinedFunction)):
  raise ValueError('symfunc should be either a string or an UndefinedFunction instance.')
 symfunc._imp_ = staticmethod(implementation)
 return symfunc

def implemented_function ( symfunc , implementation ) : from sympy . core . function import UndefinedFunction if isinstance ( symfunc , string_types ) : symfunc = UndefinedFunction ( symfunc ) elif ( not isinstance ( symfunc , UndefinedFunction ) ) : raise ValueError ( 'symfunc should be either a string or an UndefinedFunction instance.' ) symfunc . _imp_ = staticmethod ( implementation ) return symfunc
add numerical implementation to function symfunc .