Strategies for simplifying math expressions

前端 未结 6 1711
醉梦人生
醉梦人生 2020-11-27 10:28

I have a well-formed tree that represents a mathematical expression. For example, given the string: \"1+2-3*4/5\", this gets parsed into:

subtr         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 11:08

    This task can become quite complicated (besides the simplest transformation). Essentially this is what algebra software does all the time.

    You can find a readable introduction how this is done (rule-based evaluation) e.g. for Mathematica.

提交回复
热议问题