Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle exponents on coefficients of polynomial terms #113

Open
evykassirer opened this issue Jan 31, 2017 · 6 comments · Fixed by #123
Open

handle exponents on coefficients of polynomial terms #113

evykassirer opened this issue Jan 31, 2017 · 6 comments · Fixed by #123

Comments

@evykassirer
Copy link
Contributor

evykassirer commented Jan 31, 2017

Right now there's this bug:

  • (2x)^2 -> 2x^2 (instead of 4x^2)
  • (-x)^2 -> -x^2 (instead of x^2)

There's nothing that handles exponents on simple polynomial terms like this. We should fix removeUnnecessaryParens to not remove parens if there's an exponent, and then implement the polynomial operation to do exponents on polynomial terms. (probably in its own tree search after divisionSearch?)

  • (13 / 64) ^ 2 => 13^2 / 64^2
  • (2x)^2 -> 2^2 x^2
  • (2^x)^2 -> 2^(2*x)

thanks to @kevinbarabash for finding this

@shirleymiao
Copy link
Contributor

shirleymiao commented Feb 9, 2017

Taking a crack at this!

16652609_10158072220025618_2123774942_n

@evykassirer
Copy link
Contributor Author

not done yet! still need to add stuff to do exponent things

@evykassirer evykassirer reopened this Feb 10, 2017
@evykassirer evykassirer removed the bug label Feb 10, 2017
@shirleymiao
Copy link
Contributor

and by "stuff to do exponent things," we still need to handle distributing the exponent to inner ops (namely, nested exponents, multiplication, division).

@evykassirer
Copy link
Contributor Author

added some more clear tests in the description to show what the next steps should implement

@aelnaiem
Copy link
Collaborator

Can we close this issue and make a new one that clearly explains what needs to be done here. I'm not sure what @shirleymiao's PR already fixed and what hasn't been fixed yet.

@evykassirer
Copy link
Contributor Author

sure! the bug is fixed, the examples at the bottom of the main issue description aren't

we still need to handle distributing the exponent to inner ops (namely, nested exponents, multiplication, division).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants