Skip to content
Advertisement

How to write a polynomial in x**3 instead of x using Polynomial

At the moment i have a polynomial (of a galois field) in function of x. But i want to “evaluate” it in x^3.

Any ideas on how to do it?

JavaScript

So now f is in function of x: f(x) But i want to have f(x^3)

Advertisement

Answer

I am the author of the galois library. Converting f(x) to g(x) = f(x^3) is equivalent to multiplying the degrees of f(x) with non-zero coefficients by 3. In galois, this is done like this.

JavaScript

EDIT: As of v0.0.31, polynomial composition is supported. You can now evaluate a polynomial f(x) at a second polynomial g(x).

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement