google / mathsteps

Step by step math solutions for everyone
https://socratic.org
Apache License 2.0
2.12k stars 275 forks source link

Canceling out of more node types (functions) #110

Closed aelnaiem closed 7 years ago

aelnaiem commented 7 years ago

nthRoot(2)/nthRoot(2) should simplify to 1, similarly for abs(x)/abs(x)

evykassirer commented 7 years ago

I tried adding these two tests to cancelLikeTerms.test.js

and both passed

is this failing somewhere else @aelnaiem ?

kevinbarabash commented 7 years ago

Not sure where this should go, but would another test case be ['((-x)^2)/(x^2)', '1']?

evykassirer commented 7 years ago

ooo yeah.

I think that'd be separate from this though. We want to handle (-x)^2 -> x^2. This is a dealing with negatives/coefficients when squaring thing, which we don't do at all i think? (2x)^2 might not even go to 4x^2. Let's open an issue for that

aelnaiem commented 7 years ago

Interesting! Let's close this and open another issue, and I'll track down why our specific implementation had this bug.