Main icon indicating copy to clipboard operation
Main copied to clipboard

Distributive rule of arithemtic: a*b + a*c => a * (b + c)

Open yossigil opened this issue 9 years ago • 14 comments

yossigil avatar Aug 14 '16 06:08 yossigil

same for division

yossigil avatar Aug 14 '16 06:08 yossigil

@M4tt30rru : please commit the tests, and give reference to this current issue in the commit message: You do that by writing "(issue 76)" somewhere in the commit message.

yossigil avatar Aug 29 '16 11:08 yossigil

Tests are committed (one ignored). Not integrated as per request.

M4tt30rru avatar Aug 29 '16 11:08 M4tt30rru

@yossigil : @M4tt30rru : Can you please clarify what should I do here ? I see that there is already an Implementation at InfixMultiplicationDistributive.java

dormaayan avatar Aug 29 '16 19:08 dormaayan

This is a complex issue: You need to first find terms, then find factors, then try to see if you can match factors, and apply a heuristic:

We will eventually end up doing a representation as expressions as Sum of Terms Where each Term is a product of Factors. Where each Factor is either a Term or Elementary where Elementary is something that does not have Plus and Minus or Times or Divide at the upper level.

with this assumption, here is my one suggestion: Make out a list of alternatives, and just pick out the best one. An alternative is defined by three: Term1, Term2, F, where F is a common factor to Term1 and Term2.

make each of these factors as long as possible, by adding more

I think it is pretty challenging, would take a lot of time, would be a wonderful challenge for testing, and is a total waste of time.

The rarity of such cases does not justify the trouble.

@M4tt30rru , FYI

yossigil avatar Aug 29 '16 23:08 yossigil

Moved to bakclog

yossigil avatar Sep 12 '16 18:09 yossigil

It should be easy, but more interesting is the zoomer here.

yossigil avatar Mar 29 '17 18:03 yossigil

@ravivos : Are you on it for that week or can I do that ?

dormaayan avatar Mar 31 '17 06:03 dormaayan

I think this one should be placed on hold. Tough, but not very effective or useful

yossigil avatar Mar 31 '17 07:03 yossigil

@dormaayan I am on it, milestoned for next week

ravivos avatar Mar 31 '17 09:03 ravivos

Why?

yossigil avatar Mar 31 '17 11:03 yossigil

Because of the other tasks we have prioritized for this week... I guess it can be changed or squeezed in because it's a pretty easy issue. Not sure if it should, though

ravivos avatar Mar 31 '17 16:03 ravivos

ok

yossigil avatar Mar 31 '17 17:03 yossigil

Be careful: f() * g() + f() * h() != f() * (g() + h())

OriRoth avatar Mar 31 '17 20:03 OriRoth