Talk:Common subexpression elimination

From Wikipedia, the free encyclopedia
Revision as of 21:32, 30 January 2024 by imported>Cewbot (Maintain {{WPBS}} and vital articles: 1 WikiProject template. Create {{WPBS}}. Keep majority rating "Start" in {{WPBS}}. Remove 1 same rating as {{WPBS}} in {{WikiProject Computer science}}.)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:WikiProject banner shell This problem seems much more complicated than the article suggests. For example,

x3+3x2y+3xy2+y3x22xy+2xcy2+2ycc2

takes 19 multiplications and 9 additions to evaluate, but it can be rewritten as

(x+y)3+(x+yc)2

which only requires 3 multiplications and 3 additions. How does subexpression elimination know how to do this?