MHB How can I determine a polynomial is irreducible in C?

  • Thread starter Thread starter Nonad
  • Start date Start date
  • Tags Tags
    Polynomial
AI Thread Summary
Eisenstein's irreducibility criterion is challenging to apply when dealing with large integer coefficients, particularly those around 1e9. While using int64_t can handle large numbers, verifying the primality of such integers may require optimizations. Shifting variables with x+a or reversing coefficients can help, but these methods do not guarantee conclusive results. A systematic approach to selecting values for a, such as trying every integer from 1 to the highest coefficient, may yield better outcomes. Ultimately, the Factorization theorem for real coefficient polynomials was implemented to address the limitations encountered.
Nonad
Messages
2
Reaction score
0
Hello!(Blush)

I learned about Eisenstein's irreducibility criterion. But it's still hard for me to implement it when the integer coefficients may be as larger as 1e9.
What's more, how can I (or my computer?) know when to change x into x+a?

It really puzzles me(O_o)??
 
Technology news on Phys.org
Nonad said:
Hello!

I learned about Eisenstein's irreducibility criterion. But it's still hard for me to implement it when the integer coefficients may be as larger as 1e9.

Welcome to MHB Nonad! (Wave)

What is the problem with such large coefficients?
If we use a [m]int64_t[/m] we support up to [m]9e18[/m].
It may become more problematic to verify primality of integers within a reasonable time, but there are some optimizations that can be done there.

Nonad said:
What's more, how can I (or my computer?) know when to change x into x+a?

It really puzzles me(O_o)??

If the criterion is satisfied, we are done.
If it is not, then the result is inconclusive.
Shifting with $x+a$, or reversing coefficients will not necessarily lead to a conclusive result.
It is just something to try so that we get conclusive results in more cases.
I'm not aware yet of a heuristic how to pick $a$.
We might simply try every $a$ from $1$ up to the highest coefficient or some such.
 
Klaas van Aarsen said:
It is just something to try so that we get conclusive results in more cases.
I'm not aware yet of a heuristic how to pick $a$.
We might simply try every $a$ from $1$ up to the highest coefficient or some such.

Thank you very much(Blush)
Yes, you are right. I have to enumerate using Eisenstein's irreducibility criterion.
It's not acceptable for my task which includes large data and, as a sufficient condition, it may provide wrong answers.
Finally, we implemented Factorization theorem of real coefficient polynomials to solve the problem.

Thanks again(Smile)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top