求两个一元多项式A(X)=a0+a1x+a2x^2+....+anx^n和B(X)=b0+b1x+b2x^2+....+bnx^n
的和C(X),差D(X),积(X)。
算法的输入:两个多项式(分别输入各项的系数和指数)
算法的输出:多项式的和,差,积。
One of the polynomial for the two A (X) = a0+ A1x+ A2x ^ 22B !....+ Anx ^ n and B (X) = b0+ B1x+ B2x ^ 22B !....+ Bnx ^ n and C (X), poor D (X), plot (X). Algorithm input: two polynomial (respectively, the input of the coefficient and index) algorithm Output: Polynomials and, worse, the plot. (2007-10-28, C/C++, 1KB, 下载5次)
bf 533 c code example
bf 533 c code example (2009-11-28, C/C++, 45KB, 下载4次)
//参考 《常用算法程序集 (C语言描述 第三版)》
//最小二乘法
//x[n] y[n] 已知输入
//n输入点个数
//a[m] 返回m-1次拟合多项式的m个系数
//m 拟合多项式的项数,即拟合多项式的最高次为m-1
//dt[3] dt[0]返回拟合多项式与各数据点误差的平方和,
dt[1]返回拟合多项式与各数据点误差的绝对值之和
dt[2]返回拟合多项式与各数据点误差的绝对值的最大值
//拟合多项式的输出
//Y(x) = a0 + a1(x-X) + a2(x-X)^2 + …… am(x-X)^m
// 其中X为已知点x的平均值
Refer to common algorithm assembly (C language description, Third Edition)
Least square method
X [n] y [n] known input
N number of input points
A [M] returns m coefficients of M-1 degree fitting polynomial
The number of terms of m-fitting polynomial, that is, the highest degree of fitting polynomial is M-1
DT [3] DT [0] returns the sum of squares of the fitting polynomial and the errors of each data point,
DT [1] returns the sum of the absolute values of the fitting polynomial and the errors of each data point
DT [2] returns the maximum value of absolute error between fitting polynomial and each data point (2020-11-27, C/C++, 1KB, 下载0次)