Polynomial Math is a subset of mathematics dealing with mathematical expressions constructed from variables and constants using only the operations of addition, subtraction, multiplication, and non-negative integer exponents. Any polynomial math question should be programming related.
Questions tagged [polynomial-math]
630 questions
0
votes
1 answer
Polynomial expansion: Separating polynomial coefficients and x's
I want to automatically calculate expansions of polynomials where there are variables (x1,x2,...) as well as coefficients (c1,c2, ...). My goal is to calculate p(1)*(c1*x1+c2*x2+...)^n+ ... + p(n)*(c1*x1+c2*x2+...)^n .
As you can notice the…

jkt
- 2,538
- 3
- 26
- 28
0
votes
2 answers
polynomial fit trough points in matlab
I'm trying to find best polynomial fit to set of input points.
this is my code so far:
x=(1:length(meanValues));
y=meanValues(:);
A=fliplr(vander(x));
v=A \ y;
P(1: length(x))=0;
for i=1: length(x)
for j=1:…

user755974
- 49
- 6
0
votes
1 answer
Isabelle: degree of polynomial multiplied with constant
I am working with the library HOL/Library/Polynomial.thy.
A simple property didn't work. E.g., the degree of 2x *2 is equal to the degree of 2x-
How can I prove the lemmas (i.e., remove "sorry"):
lemma mylemma:
fixes y :: "('a::comm_ring_1…

mrsteve
- 4,082
- 1
- 26
- 63
0
votes
2 answers
Creating a polynomial with a linked list in C
I am creating a polynomial using a linked list in C, and I'm having a problem. Can someone please help me with my code? In the create function, I have just created a node, and I want to place the node in the right position in the function insert,…

user2883824
- 1
- 1
- 1
- 1
0
votes
0 answers
The polynomial of WEP CRC32
This is for my school project. I'm trying to understand the CRC32 implemented in WEP. I've only got one question, which I haven't been able to answer. What polynomial does the WEP algorithm use?
Tristan
0
votes
1 answer
Could this task be solved using more functional approach?
I'm writing simple polynomial-related library for my own needs. As for now, I'm working with just the polynomials in polynomial basis over GF(2), so they are represented simply as
case class Polynomial(coeffs: BitSet)
So I can just write something…

tkroman
- 4,811
- 1
- 26
- 46
0
votes
2 answers
Finding roots of quadratic equation using a specific class
i have this assignment that asks me to write a code that determines the roots of a quadratic equation (ax^2 + bx + c = 0). but i have to use the university's library (type.lib.Equation;).
i almost got everything figured out, except the case where…

Smartian
- 35
- 1
- 7
0
votes
2 answers
Best way to evaluate a matrix-based polynomial in C++
all. I'm trying to set up a program that evaluates a polynomial depending on the user input of X. Another part of the program I want is to then add these polynomials together. I'm using a 2D array to do this. What do you think would be the best way…

Amelia
- 1
- 1
0
votes
1 answer
how to write this script in matlab
I've just started learning Matlab(a few days ago) and I have the following homework that I just don't know how to code it:
Write a script that creates a graphic using the positions of the roots of the polynomial function: p(z)=z^n-1 in the complex…

francydarkcool -
- 85
- 1
- 8
0
votes
2 answers
How can I optimize bisection-method for polynomial root finding in Java?
double findaroot(double x1, double x2){ //finds the root between two values
double gap = Math.abs(x1 - x2); //find the initial interval
while(gap > INTERVAL) { //check for precision
gap = gap / 2; //halve the interval
…

user2806648
- 15
- 3
0
votes
2 answers
Degree of polynomial smaller than a number
I am working on a lemma that shows that the degree of a sum of monomials is always less or equal to n if the exponent of each monomial is less or equal to n.
lemma degree_poly_smaller:
fixes a :: "('a::comm_ring_1 poly)" and n::nat
shows…

mrsteve
- 4,082
- 1
- 26
- 63
0
votes
2 answers
Single variable polynomial addition
I have to write a program in C whereby I have to add two, single-variable polynomials. I can do it partly and I end up with wrong answer.
Consider the two polynomials:
5x^2 + 6x^3 + 9
6x^3 + 5x^2 + 3x + 2
I know what the answer is going to…

An SO User
- 24,612
- 35
- 133
- 221
0
votes
1 answer
Javascript - Parse Polynomials From String
I Just Asked this question for objective-c here, but need the answer quick and am able to do the parsing in either objective-c or javascript, so I will ask for js here.
In my app the user will be inputting a mathematical expression as a string, such…

Ari Porad
- 2,834
- 3
- 33
- 51
0
votes
2 answers
how to calculate equation to a perpendicular to polynomial line
I have a polynomial y = 0.230 + -0.046*x + -0.208*x^2 .
I want to calculate the perpendicular to this line cutting another line at (X,Y).

user2724407
- 99
- 6
0
votes
1 answer
How to use PolynomialSplineFunction from Apache Commons Math
I do not understand number two:
The value of the polynomial spline function for an argument x is
computed as follows:
The knot array is searched to find the segment to which x belongs. If x is less than the smallest knot point or greater than…

smuggledPancakes
- 9,881
- 20
- 74
- 113