# polynomial-math

##### 使用法拉利的方法找到四次方程的实根(Finding real roots of quartic equation using ferrari's method)

2021-09-16 03:42:10    分类:技术分享    java   math   trigonometry   polynomial-math   equation-solving

##### 使用霍纳算法评估多项式并计算步骤 (Java)(Evaluating a polynomial with Horner's Algorithm and calculating steps (Java))

2021-09-12 03:14:07    分类:技术分享    java   evaluation   polynomial-math

##### 对两个多项式求和(Summing two polynomials)

2021-09-11 00:57:09    分类:技术分享    matlab   sum   polynomial-math   built-in

##### How to generate a symbolic multivariate polynomial of a given dimension in SymPy?

I want to use power series to approximate some PDEs. The first step I need to generate symbolic multivariate polynomials, given a numpy ndarray. Consider the polynomial below: I want to take a m dimensional ndarray of D=[d1,...,dm] where djs are non-negative integers, and generate a symbolic multivariate polynomial in the form of symbolic expression. The symbolic expression consists of monomials of the form: Fo example if D=[2,3] the output should be For this specific case I could nest two for loops and add the expressions. But I don't know what to do for Ds with arbitrary length. If I could

2021-09-09 03:09:51    分类:问答    python   numpy   sympy   polynomial-math   power-series

##### SymPy: Factorization of polynomials over symbolic roots with combined square roots

SymPy factor function can factorize over symbolic roots, e.g. : In [1]: from sympy import * In [2]: init_printing(use_latex=False) In [3]: z, a, b = symbols('z a b') In [4]: poly = expand((z - sqrt(a))*(z - sqrt(b)), z) In [5]: poly Out[5]: 2 √a⋅√b - √a⋅z - √b⋅z + z In [6]: factor(poly, z) Out[6]: (-√a + z)⋅(-√b + z) but the factorization fails if b = a : In [10]: b = a In [11]: poly = expand((z - sqrt(a))*(z - sqrt(b)), z) In [12]: poly Out[12]: 2 -2⋅√a⋅z + a + z In [13]: factor(poly, z) Out[13]: 2 -2⋅√a⋅z + a + z Thus, the factorization fails if the identity sqrt(a) * sqrt(a) = a is applied

2021-09-08 09:17:29    分类:问答    python   math   sympy   polynomials   polynomial-math

##### Summing two polynomials

I'm looking for a built-in Matlab function that sums two polynomial. Example: p1(x) and p2(x) are represented in code standard Matlab vectors: p1 = [500 400 300 200 100 50]; p2 = [3 2 1 5]; How do I sum these two polynomials to get ps(x) with using built-in Matlab function(s); without writing an explicit m-file function?

2021-09-07 12:43:22    分类:问答    matlab   sum   polynomial-math   built-in

##### How can I use gsl to calculate polynomial regression data points?

(Disclaimer: I am terrible with math and am coming from JavaScript, so I apologize for any inaccuracies and will do my best to correct them.) The example on Rosetta Code shows how to calculate coefficients using gsl. Here is the code: polifitgsl.h: #ifndef _POLIFITGSL_H #define _POLIFITGSL_H #include <gsl/gsl_multifit.h> #include <stdbool.h> #include <math.h> bool polynomialfit(int obs, int degree, double *dx, double *dy, double *store); /* n, p */ #endif polifitgsl.cpp: #include "polifitgsl.h" bool polynomialfit(int obs, int degree, double *dx, double *dy, double *store) /* n, p */ { gsl

2021-09-05 15:01:07    分类:问答    c   polynomial-math   gsl

##### Evaluating a polynomial with Horner's Algorithm and calculating steps (Java)

I need help on my java code. What I'm trying to accomplish is to calculate the size of each step on a polynomial: double s = (b-a)/nsteps; The inputs for the polynomial to be created is degree, coefficient, start value of x, stopping value of x, and the number of steps. Whenever I try to run a test, my output is 0 for x and y and I'm not sure what I am missing on my code. Here is my run test on how its supposed to work, but my result for x and y is 0: Enter degree:2 Enter coefficient 2:1 Enter coefficient 1:0 Enter coefficient 0:0 f(x) = 1.0x^2 + .0x^1 + 0.0 Enter initial x:0 Enter final x:10

2021-09-04 16:26:48    分类:问答    java   evaluation   polynomial-math

##### 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) { //Constructor: Initializes x, y. this.x=x; this.y=y; } public Complex(double x) { //Real constructor - initialises with a real number. this(x, 0.0); } public Complex() { //Default constructor; initialiase x and y to zero. this(0.0, 0.0); } } What I would like to do is create a function Polynomial, which would take an array of coefficients, and filter it so that if for

2021-09-04 07:13:29    分类:问答    java   math   numbers   polynomials   polynomial-math

##### Java中多项式x^16 + x^12 + x^5 + 1计算CCITT标准CRC(Calculation of CCITT standard CRC with polynomial x^16 + x^12 + x^5 + 1 in Java)

2021-09-01 02:13:46    分类:技术分享    java   calculator   polynomial-math   crc16