Or login with:
| doublepolyEval( | double | x | |
| const double* | coef | ||
| int | N | ) |
#include <stdio.h> #include <codecogs/maths/approximation/polynomial/poly_eval.h> int main() { using namespace Maths::Algebra::Polynomial; static double A[] = { 1,2,3 }; for(int x=2;x<=5;x++) printf("\n polyEval(%d, A, 2)=%.1lf", x, polyEval(x, A, 2)); return 0; }
polyEval(2, A, 2)=11.0 polyEval(3, A, 2)=18.0 polyEval(4, A, 2)=27.0 polyEval(5, A, 2)=38.0
| x | main variant |
| coef | array of coefficients <tt>coef[0..N]</tt> in reverse order |
| N | degree of polynomial, also one less that number of coefficients supplied. |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
| doublepolyEval1( | double | x | |
| const double* | coef | ||
| int | N | ) |
#include <stdio.h> #include <codecogs/maths/approximation/polynomial/poly_eval.h> int main() { using namespace Algebra::Polynomial; static double A[] = { -5, 4 }; for(int x=2;x<=5;x++) printf("\n polyEval1(%d, A, 2)=%.1lf", x, polyEval(x, A, 2)); return 0; }
polyEval1(2, A, 2)=-2.0 polyEval1(3, A, 2)=-2.0 polyEval1(4, A, 2)=0.0 polyEval1(5, A, 2)=4.0
| x | main variant |
| coef | array of coefficients <tt>coef[0..N-1]</tt> in reverse order |
| N | degree of polynomial, also number of coefficients supplied. Must be 2 or more. |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge