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

Add a factor method for Polynomials #474

Open
n-gram-hub opened this issue Nov 8, 2023 · 4 comments
Open

Add a factor method for Polynomials #474

n-gram-hub opened this issue Nov 8, 2023 · 4 comments

Comments

@n-gram-hub
Copy link

n-gram-hub commented Nov 8, 2023

Add a proper factor method for Polynomials (many libraries don't support/recognize differences of squares with fractions, for example)

@markrogoyski
Copy link
Owner

Hi @n-gram-hub,

Thank you for your interest in MathPHP.

Can you provide some more details about your feature request. It will be helpful to provide some example inputs and outputs to clarify the functionality you are requesting.

Thanks!
Mark

@n-gram-hub
Copy link
Author

The first functionality is factoring polynomials in general (that is, decompose a polynomial into a product of two, or more, polynomials).

The second one is related to fractions and differences of squares, eg.

4/9x^2-9/4y^2

should produce as its first result (you can have many different ways of factoring):

(2/3x-3/2y)*(2/3x+3/2y)

@Beakerboy
Copy link
Contributor

If you can find another library that does this, the code could be translated to PHP. Floating point arithmetic makes this extremely difficult due to the accumulation of tiny errors.

@n-gram-hub
Copy link
Author

If you can find another library that does this, the code could be translated to PHP. Floating point arithmetic makes this extremely difficult due to the accumulation of tiny errors.

I couldn't find any library doing this, but maybe the idea to make it work is not thinking in terms of floating point numbers

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

No branches or pull requests

3 participants