public final class Polynomial extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
chbevl(double x,
double[] coef,
int N)
Evaluates the series of Chebyshev polynomials Ti at argument
x/2.
|
static double |
evalChebyStar(double[] coef,
int N,
double x)
Evaluates a series of shifted Chebyshev polynomials
T_j^* at
x over the basic interval [0, 1] using the method of
Clenshaw. |
static double |
p1evl(double x,
double[] coef,
int N)
Evaluates the given polynomial of degree N at x,
assuming coefficient of N is 1.0.
|
static double |
polevl(double x,
double[] coef,
int N)
Evaluates the given polynomial of degree N at x.
|
public static double p1evl(double x,
double[] coef,
int N)
2 N
y = C + C x + C x +...+ C x
0 1 2 N
where C = 1 and hence is omitted from the array.
N
Coefficients are stored in reverse order:
coef[0] = C , ..., coef[N-1] = C .
N-1 0
Calling arguments are otherwise the same as polevl().
In the interest of speed, there are no checks for out of bounds
arithmetic.x - argument to the polynomialcoef - the coefficients of the polynomialN - the degree of the polynomialpublic static double polevl(double x,
double[] coef,
int N)
2 N
y = C + C x + C x +...+ C x
0 1 2 N
Coefficients are stored in reverse order:
coef[0] = C , ..., coef[N] = C .
N 0
In the interest of speed, there are no checks for out of bounds
arithmetic.x - argument to the polynomialcoef - the coefficients of the polynomialN - the degree of the polynomialpublic static double chbevl(double x,
double[] coef,
int N)
N-1
- '
y = > coef[i] T (x/2)
- i
i=0
Coefficients are stored in reverse order, i.e. the zero order term is
last in the array. Note: N is the number of coefficients, not the order.
If coefficients are for the interval a to b, x must have been transformed
to x -> 2(2x - b - a)/(b-a) before entering the routine. This maps x from
(a, b) to (-1, 1), over which the Chebyshev polynomials are defined.
If the coefficients are for the inverted interval, in which (a, b) is
mapped to (1/b, 1/a), the transformation required is x -> 2(2ab/x - b -
a)/(b-a). If b is infinity, this becomes x -> 4a/x - 1.
SPEED:
Taking advantage of the recurrence properties of the Chebyshev polynomials, the routine requires one more addition per loop than evaluating a nested polynomial of the same degree.
x - argument to the polynomialcoef - the coefficients of the polynomialN - the number of coefficientspublic static double evalChebyStar(double[] coef,
int N,
double x)
T_j^* at
x over the basic interval [0, 1] using the method of
Clenshaw.coef - coefficients of the polynomialsN - largest degree of polynomialsx - the parameter of the T_j^* functionsT_j^*Copyright © 2022. All rights reserved.