def function_application(func):
 if (func not in NUMEXPR_MATH_FUNCS):
  raise ValueError(("Unsupported mathematical function '%s'" % func))
 @with_name(func)
 def mathfunc(self):
  if isinstance(self, NumericalExpression):
   return NumExprFactor('{func}({expr})'.format(func=func, expr=self._expr), self.inputs, dtype=float64_dtype)
  else:
   return NumExprFactor('{func}(x_0)'.format(func=func), (self,), dtype=float64_dtype)
 return mathfunc

def function_application ( func ) : if ( func not in NUMEXPR_MATH_FUNCS ) : raise ValueError ( ( "Unsupported mathematical function '%s'" % func ) ) @ with_name ( func ) def mathfunc ( self ) : if isinstance ( self , NumericalExpression ) : return NumExprFactor ( '{func}({expr})' . format ( func = func , expr = self . _expr ) , self . inputs , dtype = float64_dtype ) else : return NumExprFactor ( '{func}(x_0)' . format ( func = func ) , ( self , ) , dtype = float64_dtype ) return mathfunc
factory function for producing function application methods for factor subclasses .