Post Reply 
(42S) Chebyshev Polynomial
07-07-2017, 05:11 AM
Post: #1
(42S) Chebyshev Polynomial
The trigonometric definition is used to calculate T_n(x):

For |x| > 1, cosh (n * acosh x)
For |x| ≤ 1, cos (n * acos x)
Code:

00 {42-Byte Prgm}
01 LBL “CHEBY”
02 “N”
03 PROMPT
04 STO 00
05 “X”
06 PROMPT
07 STO 01
08 ABS
09 1
10 X≥Y?
11 GTO 00
12 RCL 01
13 ACOSH
14 RCL* 00
15 COSH
16 GTO 01
17 LBL 00
18 RCL 01
19 ACOS
20 RCL* 00
21 COS
22 LBL 01
23 END

Examples:

T_4(2) (n = 4, x = 2). Result: 97

T_4(0.5) (n = 4, x = 0.5) Result: -0.5
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)