home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.math.symbolic      Symbolic algebra discussion      10,432 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,324 of 10,432   
   Nasser M. Abbasi to All   
   leaf count for sympy?   
   29 Mar 17 18:24:30   
   
   From: nma@12000.org   
      
   Any one knows how to find leaf count using python/sympy I could use?   
      
   I am not able to find such function in sympy. Leaf count is   
   build-in Maple and Mathematica. For example   
      
   r = -((1 - Sqrt[2]*Sin[z])/(Cos[z] - Sin[z]));   
   LeafCount[r]   
      
       Out[23]= 22   
      
   https://reference.wolfram.com/language/ref/LeafCount.html   
   "gives the total number of indivisible subexpressions in expr."   
      
   May be someone implemented something similar in   
   python for sympy? Currently in my sympy integration tests, I   
   have this field not filled, since I do not know how to do this   
   yet in sympy/python. It does not have to be very accurate,   
   but something that will give a measure of how big an expression is.   
      
      
   Thanks,   
   --Nasser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca