The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [polynomials]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
24
votes
5answers
1k views

Why do equi-spaced points behave badly?

Experiment description: In Lagrange interpolation, the exact equation is sampled at $N$ points (polynomial order $N - 1$) and it is interpolated at 101 points. Here $N$ is varied from 2 to 64. Each ...
19
votes
1answer
605 views

Difficulty with Spectral Method using Chebyshev Polynomials

I am having a bit of difficulty in trying to understand a paper. The paper uses spectral method to solve for an eigenvalue that comes from a system of coupled ODEs. I will write out only one equation ...
16
votes
3answers
256 views

Uses of power series maps

I'm from the field of accelerator physics, specifically related to circular storage rings for synchrotron light sources. High energy electrons circulate around the ring, guided by magnetic fields. ...
10
votes
3answers
757 views

Benchmarks for Gröbner bases and polynomial system solution

In the recent question Solving system of 7 nonlinear algebraic equations symbolically, Brian Borchers experimentally confirmed that Maple can solve a polynomial system that Matlab/Mupad cannot handle. ...
10
votes
3answers
3k views

Solution of quartic equation

Is there a open C-implementation for the solution of quartic equations: $$ax⁴+bx³+cx²+dx+e=0$$ I am thinking of an implementation of Ferrari's solution. On Wikipedia I read that the solution is ...
9
votes
2answers
233 views

Numerical stability of higher order Zernike polynomials

I'm trying to calculate higher order (e.g., m=0, n=46) Zernike moments for some image. However, I'm running into a problem ...
9
votes
1answer
107 views

Numerically stable algorithms for computing remainder of polynomials

Let $f, g \in \mathbb{R}[x]$ and $\deg f > \deg g$. I am looking for asymptotically fast and numerically stable algorithms for computing $f \bmod g$. In the applications intended, both $f, g$ are ...
7
votes
4answers
7k views

How to find more than one root of a polynomial?

This program finds the first root of the function f, defined in the code. There are 5 roots of this function. (x=1,2,3,4,5) I wish to find all of the roots in this program and print them to the screen....
7
votes
1answer
689 views

Accurate Polynomial Evaluation in Floating Point

What are the most accurate algorithms for evaluating a polynomial using floating point arithmetic? The internet seems to suggest that Horner's method is commonly used. In particular I have a cubic ...
7
votes
1answer
288 views

Numerically stable computation of the Characteristic Polynomial of a matrix for Cayley-Hamilton Theorem

I was wondering if there is any known way to compute the Charactaristic Polynomial P of a matrix A numerically stable in the sense of realizing the Cayley-Hamilton Theorem, i.e. that P(A)=0. I've ...
7
votes
1answer
758 views

Polynomial Fitting from Chebyshev Coefficients

I have been reading Numerical recipes about how to create a power series approximation to a function once you have a Chebyshev approximation to the function. However it is still very unclear to me how ...
6
votes
2answers
121 views

Positive root of $x^q + bx - b$

Is there either a closed-form expression or fast/elegant algorithm for computing the positive root of the polynomial $$f(x)=x^q + \beta x - \beta,$$ where $\beta>0$ and $q\geq2$? How about the $q\...
6
votes
2answers
189 views

Is there a backward stable $\tilde{O}(n \log(1/\epsilon))$ algorithm to factor a complex polynomial?

Finding the roots of a complex polynomial is in general extremely numerically unstable, as discussed in (1). According to Pan ((2), (3)), this produces a cubic complexity lower bound, and he presents ...
6
votes
1answer
326 views

roots of polynomials with small coefficients

I would like to compute the roots of a polynomial with exponentially small coefficients. $$ \sum_{n=0}^N a_n \frac{z^n}{\sqrt{n!}} \tag{$\ast$}$$ where $a_n$ are Normal random variables with mean $0$...
6
votes
3answers
137 views

Accurate evaluation of the sign of a polynomial

Let $p$ be a polynomial with floating-point coefficients and let $a$ be a floating-point value. Is there a method for accurately evaluating the sign of $p(a)$ in floating-point arithmetic? I don't ...
6
votes
0answers
604 views

Stochastic Galerkin projection approach for using generalized polynomial chaos expansion (GPCE) in solving PDE

I want to know if there is any way to define the test and trial function in the way that I want instead of using the default functions. So if I want define the polynomial and basis and coefficient, ...
5
votes
4answers
3k views

Fastest polynomial root finder for a given accuracy

I am looking for a very fast polynomial root finder, hopefully with a matlab code. I don't need very accurate results, 2-3 decimal places would be fine. Also the method should be able to optionally ...
5
votes
2answers
152 views

Building Gaussian-type quadrature schemes with Zernike polynomials

The abscissas for Gauss quadrature are given by the zeros of the Legendre polynomials. The Legendre polynomials form an orthogonal set over $[-1, 1]$, and it is shown in (for instance) Kress that the ...
5
votes
2answers
177 views

What are the numerical methods for huge polynomial systems?

Let a system of $n$ polynomial equations of degree $d$ with $m$ variables. I'm interested in a sparse system with $d = 3$, $n \sim 2000000$, $m \sim 50000$ and integer coefficients. What techniques ...
5
votes
3answers
222 views

Fast evaluation functions given by straight-line programs

I have a simple but long function that takes a vector x[10], and outputs a vector y[100]. It is an automatically generated eval function for a multivariate polynomial, ie, there is only (complex) ...
5
votes
2answers
160 views

Polynomial approximation spaces

I often see people using products of 1-D polynomials to do interpolation or projection of smooth multivariate functions over grids or cells because it is intuitive and simple to implement. What are ...
5
votes
1answer
348 views

Polynomial order of an approximation of a section of sine and numerical accuracy

I was playing with the idea that a sine function is periodic. But even within one period there are symmetries, namely the second fourth of a period is the mirror image of the first fourth and the ...
5
votes
0answers
150 views

How to optimally choose points for multivariable Hermite interpolation?

I have a multi-variate, continuous function $f$ from $R^n$ to $R$, which I can query for its output for any input. I would like to create interpolation polynomial for it. In one-dimensional case ...
4
votes
1answer
252 views

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" $N_1, N_2, N_3,$ and $N_4$, for which the following ...
4
votes
2answers
124 views

Intervals where the sign of a polynomial can be computed reliably

This is a follow-up of a previous question. Let $p$ be a polynomial with floating-point coefficients. Is there a method for finding intervals where evaluating $p$ in floating-point arithmetic always ...
4
votes
1answer
240 views

Chebyshev and Legendre expansions

I am looking at approximating my function $f(x)$ using a Chebyshev and Legendre series and I ran into this question. Is interpolation using $n+1$ Chebyshev nodes the same as representing the ...
4
votes
1answer
70 views

Fastest method for evaluating the limit of the sign of a polynomial

Consider a multivariate polynomial $f(x) = f(x_1, \ldots, x_n)$ with maximum degree $d$. Following the linear symbolic perturbation scheme described in Seidel 1998, I want to evaluate the limit $$\...
4
votes
1answer
238 views

Problems Implementing the Remez Algorithm

So first off: *** This code is not being used in production software. It is a personal project of mine, trying to understand approximation theory and advanced curve fitting. In other words, I'm ...
4
votes
1answer
162 views

Computing size of N-Dimensional Polynomial Basis and Efficient Representation of Basis

A problem I have had on my mind recently has been a compact way to compute the size of an $N$-Dimensional Polynomial basis of some order $p$, where a linear basis is $p=1$. I have attempted searching ...
3
votes
3answers
379 views

Evaluating large determinants with multivariate polynomial entries

I have some large (n~100) square matrices with entries two variable polynomials of bounded degree (roughly <20, but many entries are smaller) and integer coefficients, and I'd like to be able to ...
3
votes
2answers
405 views

Trajectory Planning: Polynomials as universal, integrable approximation functions?

I'd like to program a trajectory planner, let's say for a robot, and I can pass acceleration commands to the robot, the robot can move in one dimension. The outcome of the planner is now a vector with ...
3
votes
2answers
1k views

Evaluation of multivariate polynomials

I am seeking for an efficient algorithm to compute a multivariate polynomial of a fixed structure, but different coefficients and evaluation points. The question is the same as this one, which ...
3
votes
1answer
154 views

What is the most efficient way to represent a 1D function using $hp$-finite element basis functions

Given a one-dimensional function (let's say infinitely differentiable) and a prescribed accuracy of an L2 (or H1) norm, what is the optimal mesh and (in general arbitrary) polynomial orders on each ...
3
votes
2answers
875 views

How to properly use polynomial projection to get values at visualization nodes?

I am trying to implementing a nodal discontinuous Galerkin spectral element method for linear and non-linear systems of equations. The solution at each time step is given at ...
3
votes
2answers
2k views

C++ Library: What is the common libraries that do polynomial arithmetic?

I need to know what libraries (in C++) support polynomial arithmetic specially over a field. So I can give to it an array of coefficients of polynomial over a field and it returns the roots of ...
3
votes
1answer
104 views

Numerically stable real solution(s) to a system of bivariate quadratics

I have a a system of bivariate polynomials as follows: $ E(u,v): e_2(u) v^2 + e_1(u) v + e_0(v) = 0 \\ F(u,v): f_2(u) v^2 + f_1(u) v + f_0(v) = 0$ where $e_n(u) = e_{n_2}u^2 + e_{n_1} u + e_{n_0}$ ...
3
votes
0answers
102 views

Closed form PDF/CDF using Orthogonal Polynomial Expansion (gPC)

Consider a random variable which is given by an orthogonal polynomial expansion in one parameter (or polynomial chaos expansion PCE), i.e. , $$ f(\alpha) = \sum\limits_{n=0}^{\infty} \hat{f} (n) \psi ...
2
votes
1answer
1k views

rational functions in Python

I would like use Python to verify the following identities: $ \frac{1}{1-z} = 1 + z + z^2 + z^3 + \dots $ $ \frac{1}{1-z - z^2} = 1 + z + 2z^2 + 3z^3 + \dots $ $ q \prod_{n \geq 1} (1 - q^n)^{24} = ...
2
votes
2answers
298 views

Stable formula for a specific root of a depressed cubic

I have a cubic of the form $$x^3 - a x - b = 0$$ where $a, b > 0$. Thus, I know there is exactly one positive root. Is there a nice stable formula for this unique positive root?
2
votes
1answer
55 views

How to robustly and numerically expand a $k$-order polynomial in two variables defined on a polygon domain?

Given a $k$-order polynomial in two variable $p(x, y)$ defined on a polygon domain $K$. And I want to numerically expand it to the following form $$ p(x, y) = c_0 + c_1 x + c_2 y + c_3 x^2 + c_4 xy + ...
2
votes
1answer
95 views

Differentiation Matrix In DG-FEM - Hesthaven/Warburton

In the book of Hesthaven and Warburton on discontinual Galerkin methods the authors give motivation to the differentiation matrix (page 52), referred to as $D_r(i,j)=\frac{dl_j}{dr}|_{r_i}$ where $l_i(...
2
votes
2answers
653 views

Polynomial Interpolation with Matlab polyfit

Given $N$ data points, does polyfit of degree $N-1$ produces the unique interpolating polynomial? For concreteness, here is a code example: ...
2
votes
1answer
1k views

Multivariate Orthogonal Polynomial Generation

I'm trying to apply the stochastic galerkin method to partial differential equation with multiple uniform random coefficients. I'm puzzled as to how to extend the corresponding orthogonal (legendre) ...
2
votes
1answer
49 views

Test on a set of high degree polynomials whose coefficients in {-1,0,1}

I'm looking for the best way of implementing the following algorithm: consider the set of all polynomials with a high degree (say, degree 30) whose coefficients ranges from a given set of values (say, ...
2
votes
1answer
68 views

Legendre expansion of $r(x) = f(x)/g(x)$ using a finite number of samples from $f(x)$ and $g(x)$

I have two finite sets of events $\{x_1, ..., x_N\}$ and $\{y_1, ..., y_N\}$ that are sampled from the PDFs $f(x)$ and $g(x)$, respectively, where $x \in [-1,+1]$. I want to estimate the Legendre ...
2
votes
1answer
269 views

How to compute the Jacobi matrix (tridiagonal matrix) of a polynomial with a recurrence relationship?

I am looking at Trefethen and Bau Exercise 37.1: I have two normalizations of the Legendre polynomials with corresponding recurrence relations: $$P_n(1)=1$$ which follows $$P_n(x) = \frac{2n-1}{n} x ...
2
votes
0answers
26 views

Find solution to Polynomial Sequences without going through variety in Sage

I'm computing the Groebner basis of an ideal defined over the QQ ring. Once I have this Groebner basis, I would like to obtain a set of values that satisfy the equations in the Groebner basis. I know ...
2
votes
0answers
37 views

Can I expect reasonable results when expanding in scaled Legendre polynomials?

Imagine I want to compute the eigenvalues of an operator $\hat O$ defined on $ L^2(\mathbb{R})$, however using a properly scaled N-dimensional polynomial basis of $ L^2([-a,a]) $ which fulfills ...
2
votes
0answers
96 views

Is the numerical resolution of this huge sparse polynomial system tractable?

I'd like to find numerically a solution to a sparse system of 2000000 polynomial equations of degree 3 with 50000 variables and integer coefficients (or at least to decide whether or not a solution ...
2
votes
0answers
26 views

Choosing suitable polynomial degree based on information in advection stencil

I'm working on a finite volume advection scheme for unstructured meshes which uses a multidimensional polynomial weighted least squares fit for interpolating from cell centres onto faces. In 2D, the ...