orthpoly::chebyshev1
-- the
Chebyshev polynomials of the first kindorthpoly::chebyshev1
(n,x)
computes the
value of the n-th degree Chebyshev polynomial of the first
kind at the point x.
orthpoly::chebyshev1(n, x)
n |
- | a nonnegative integer: the degree of the polynomial. |
x |
- | an indeterminate or an arithmetical expression. An
indeterminate is either an identifier (of domain type DOM_IDENT ) or an indexed identifier (of type
"_index" ). |
If x
is an indeterminate, then a polynomial of domain
type DOM_POLY
is
returned. If x
is an arithmetical expression, then the
value of the Chebyshev polynomial at this point is returned as an
arithmetical expression. If n
is not a nonnegative
integer, then orthpoly::chebyshev1
returns itself
symbolically.
orthpoly::chebyshev2
, orthpoly::jacobi
orthpoly::chebyshev2
implements
the Chebyshev polynomials of the second kind.Polynomials of domain type DOM_POLY
are returned, if
identifiers or indexed identifiers are specified:
>> orthpoly::chebyshev1(2, x)
2 poly(2 x - 1, [x])
>> orthpoly::chebyshev1(3, x[1])
3 poly(4 x[1] - 3 x[1], [x[1]])
However, using arithmetical expressions as input the ``values'' of these polynomials are returned:
>> orthpoly::chebyshev1(2, 6*x)
2 72 x - 1
>> orthpoly::chebyshev1(3, x[1] + 2)
2 2 (x[1] + 2) (2 (x[1] + 2) - 1) - x[1] - 2
``Arithmetical expressions'' include numbers:
>> orthpoly::chebyshev1(2, sqrt(2)), orthpoly::chebyshev1(3, 8 + I), orthpoly::chebyshev1(1000, 0.3)
3, 1928 + 761 I, -0.9991251117
If no integer degree is specified,
orthpoly::chebyshev1
returns itself symbolically:
>> orthpoly::chebyshev1(n, x), orthpoly::chebyshev1(1/2, x)
orthpoly::chebyshev1(n, x), orthpoly::chebyshev1(1/2, x)
If a floating point value is desired, then a direct call such as
>> orthpoly::chebyshev1(200, 0.3)
-0.316963268
is appropriate and yields a correct result. One should not evaluate the symbolic polynomial at a floating point value, because this may be numerically unstable:
>> T200 := orthpoly::chebyshev1(200, x):
>> DIGITS := 10: evalp(T200, x = 0.3)
56068.79149
This result is caused by numerical round-off. Also with
increased DIGITS
only a
few leading digits are correct:
>> DIGITS := 20: evalp(T200, x = 0.3)
-0.31701395850025751393
>> delete DIGITS, T200:
orthpoly::chebyshev1
for
floating point values in this range.T(n,x) = 2*x*T(n-1,x) - T(n-2,x)with T(0,x)=1 and T(1,x)=x.
T(n,x) = 2^(2*n)*(n!)^2/(2*n)!*P(n,-1/2,-1/2,x)