#NEWLINE# def _eval_evalf( self , prec ) : #NEWLINE# #INDENT# "\n        Evaluate the parts of self that are numbers; if the whole thing\n        was a number with no functions it would have been evaluated, but\n        it wasn't so we must judiciously extract the numbers and reconstruct\n        the object. This is *not* simply replacing numbers with evaluated\n        numbers. Nunmbers should be handled in the largest pure-number\n        expression as possible. So the code below separates ``self`` into\n        number and non-number parts and evaluates the number parts and\n        walks the args of the non-number part recursively (doing the same\n        thing).\n        " #NEWLINE# from . add import Add #NEWLINE# from . mul import Mul #NEWLINE# from . symbol import Symbol #NEWLINE# from . function import AppliedUndef #NEWLINE# if isinstance ( self , ( Mul , Add ) ) : #NEWLINE# #INDENT# ( x , tail ) = self . as_independent ( Symbol , AppliedUndef ) #NEWLINE# if ( not ( ( tail is self . identity ) or ( isinstance ( x , AssocOp ) and x . is_Function ) or ( ( x is self . identity ) and isinstance ( tail , AssocOp ) ) ) ) : #NEWLINE# #INDENT# x = ( x . _evalf ( prec ) if ( x is not self . identity ) else self . identity ) #NEWLINE# args = [ ] #NEWLINE# tail_args = tuple ( self . func . make_args ( tail ) ) #NEWLINE# for a in tail_args : #NEWLINE# #INDENT# newa = a . _eval_evalf ( prec ) #NEWLINE# if ( newa is None ) : #NEWLINE# #INDENT# args . append ( a ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# args . append ( newa ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not _aresame ( tuple ( args ) , tail_args ) ) : #NEWLINE# #INDENT# tail = self . func ( * args ) #NEWLINE# #UNINDENT# return self . func ( x , tail ) #NEWLINE# #UNINDENT# #UNINDENT# args = [ ] #NEWLINE# for a in self . args : #NEWLINE# #INDENT# newa = a . _eval_evalf ( prec ) #NEWLINE# if ( newa is None ) : #NEWLINE# #INDENT# args . append ( a ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# args . append ( newa ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not _aresame ( tuple ( args ) , self . args ) ) : #NEWLINE# #INDENT# return self . func ( * args ) #NEWLINE# #UNINDENT# return self