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
3
votes
1 answer
Massive artifacting in bicubic interpolation; how to fix?
I'm trying to implement a bicubic interpolation algorithm to reconstruct higher-resolution data from a heightmap. After some falstarts and sets of instructions containing nearly-incomprehensible math (it's been some years since I had calculus and I…

Michał Gawlas
- 186
- 7
3
votes
1 answer
How to calculate CRC-16 from HEX values?
In my code i need to calculate CRC-16 16 bit values for the HEX values stored as NSdata, below is the code snippet to calculate CRC-16 in c.
void UpdateCRC(unsigned short int *CRC, unsigned char x)
{
// This function uses the initial CRC value…

Satheesh
- 361
- 2
- 6
- 17
3
votes
6 answers
How can I do blind fitting on a list of x, y value pairs if I don't know the form of f(x) = y?
If I have a function f(x) = y that I don't know the form of, and if I have a long list of x and y value pairs (potentially thousands of them), is there a program/package/library that will generate potential forms of f(x)?
Obviously there's a lot of…

tel
- 13,005
- 2
- 44
- 62
3
votes
3 answers
c# Numerical Polynomial Regression
I'm beginning one of my first C# projects--need to find the curve fit for several x-y data points.
For example:
x: 1,2,3,4,5,6
y: 0.5,5,0.5,2.5,5,0.5
As it happens, the proper curve fit I need for these points is a sixth-order polynomial, according…

Kevin Brown
- 12,602
- 34
- 95
- 155
2
votes
3 answers
Jenkins-Traub algorithm open-source java port?
I have a polynomial class similar to one here: Polynomial.java. Except I haven't figured out how to find the zeros of the polynomial. I have head of the Jenkins-Traub Algorithm, but I have no idea on how to implement it in Java. I did manage to find…

Mohit Deshpande
- 53,877
- 76
- 193
- 251
2
votes
2 answers
Given a coefficient vector and a value, what is the fastest way to evaluate a polynomial?
I remember reading somewhere (maybe someone can help remember where), that there is a method that is the fastest for evaluating a polynomial. Something reminds me that it had something to do with Vietta's formula, or the fact that the 0-power…

Cris Stringfellow
- 3,714
- 26
- 48
2
votes
1 answer
Linear least-squares fit with constraint - any ideas?
I have a problem where I am fitting a high-order polynomial to (not very) noisy data using linear least squares. Currently I'm using polynomial orders around 15 - 25, which work surprisingly well: The dependence is very nearly linear, but the…

Max
- 2,121
- 3
- 16
- 20
2
votes
1 answer
What is the logic behind this nvidia 's arctan2?
Nvidia has some functions in Cg 3.1 Toolkit Documentation
arctan2 is implemented as follows
float2 atan2(float2 y, float2 x)
{
float2 t0, t1, t2, t3, t4;
t3 = abs(x);
t1 = abs(y);
t0 = max(t3, t1);
t1 = min(t3, t1);
t3 = float(1) / t0;
…

balu
- 1,023
- 12
- 18
2
votes
0 answers
Calculating plumb-bob coefficients from rational-polynomial coefficients for camera lense distortion
Is it possible to recalculate the plumb-bob coefficients for a given OpenCV calibration file, that was created using a rational-polynomial model?
Concerning group__calib3d.html, the plumb-bob model uses the coefficients [k1, k2, p1, p2, k3] while…

Tik0
- 2,499
- 4
- 35
- 50
2
votes
1 answer
Determining if there exists numbers n1, n2 in a, b and n3 in c such that n1 + n2 = n3 [ftt, polynomial multiplication]
Hello I am working on a problem that seems to be out of my league so any tips, pointers to reading materials etc. are really appreciated. That being said here is the problem:
given 3 subsets of numbers a, b, c ⊆ {0, ..., n}. In nlog(n) check if…

blowtorch
- 83
- 7
2
votes
4 answers
Find the tangent of any polynomial function at x
Problem:
I'm looking for a catch-all function that I can use to calculate the tangent of any polynomial function at x. I'm indifferent to the language used although JavaScript or Python would be prefered! I should be able to pass in any x value and…

Jacob Philpott
- 538
- 1
- 8
- 24
2
votes
3 answers
Integral of a Polynomial in Python
How would we write a function in python that returns the definite integral of a polynomial between two points (X_1 and X_2)?
The function takes 3 arguments:
a list A of polynomial coefficients (i.e. for polynomial f(x)=5x^4−2x+1, this list becomes…

codemachine98
- 61
- 10
2
votes
8 answers
Should methods be destructive in custom objects?
I have to implement Java.Polynomial as a school assignment. Part of the methods are add(polynomial), multiply(polynomial) etc.
In the case of something like
p.add(q); // computes p + q
is it better to return void and keep the sum of the polynomials…

Dan
- 9,912
- 18
- 49
- 70
2
votes
2 answers
Setting up array of complex coefficients, avoiding the leading zero's
I have created a class for complex numbers:
public class Complex {
private double x; //Real part x of the complex number x+iy.
private double y; //Imaginary part y of the complex number x+iy.
public Complex(double x, double y) { …

Slim Shady
- 220
- 3
- 18
2
votes
1 answer
Polynomial evaluation in Isabelle
In the book Concrete Semantics, exercise 2.11 writes:
Define arithmetic expressions in one variable over integers
(type int) as a data type:
datatype exp = Var | Const int | Add exp exp | Mult exp exp
Define a function eval :: exp ⇒ int ⇒ int…

Gergely
- 6,879
- 6
- 25
- 35