M2T

Display

Overview
The M2T program can multiply two norder polynomials, e.g.:
(a3x3 + a2x2 + a1x + a0)(b2x2 + b1x + b0) = c5x5 + c4x4 + c3x3 + c2x2 + c1x + c0

The program is limited to a maximum order of 9 for each of the polynomials (10 coefficients each).
(The mathematical calculations center of Ben Langton, QuickMath, helps to solve any entered expression.)

Examples
Please note that my default FIX 5 setting which can be replaced by your preferred number of decimals.

Keystrokes:               Display:             Comments:
- Multiply (2x2 -11x + 12)(12x2 + 3x - 42)
[XEQ][ALPHA] M2T [ALPHA] DEG.1=? - Degree of first polynomial
2 [R/S] a2=? - Enter a2=2
-11 [R/S] a1=? - Enter a1=-11
12 [R/S] a0=? - Enter a0=12
2 [R/S] DEG.2=? - Degree of second polynomial
12 [R/S] b2=? - Enter a2=12
3 [R/S] b1=? - Enter b1=3
-42 [R/S] b0=? - Enter b0=-42
(see also example in M1t)
[R/S] a4=24,00000 - Coefficients
[R/S] a3=-126,00000
[R/S] a2=27,00000
[R/S] a1=498,00000
[R/S] a0=-504,00000 - f(x) = 24x4 -126x3 + 27x2 + 498x - 504

[R/S] - run another multiplication

Program Listing

LINE  KEYS                LINE  KEYS              LINE  KEYS              LINE  KEYS               

01 LBL'M2T' 25 LBL 03 49 LBL 06 73 RCL 41
02 FIX 0 26 11 50 RCL 42 74 +
03 CF 29 27 X<>Y 51 1 75 21,02
04 CLRG 28 + 52 + 76 +
05 'DEG.1=?' 29 'b' 53 STO 44 77 STO 00
06 1 30 ARCL L 54 RCL 43 78 LBL 07
07 PROMPT 31 '»=?' 55 11 79 'c'
08 STO 40 32 PROMPT 56 + 80 RCL 00
09 + 33 STO IND Y 57 STO 45 81 21
10 X<>Y 34 LASTX 58 RCL 42 82 -
11 LBL 01 35 -1 59 RCL 43 83 INT
12 'a' 36 ST+ Y 60 + 84 FIX 0
13 ARCL L 37 X<>Y 61 21 85 ARCL X
14 '»=?' 38 X>Y? 62 + 86 '»='
15 PROMPT 39 GTO 03 63 STO 46 87 FIX 5
16 STO IND Z 40 RCL 40 64 RCL IND 44 88 ARCL IND 00
17 LASTX 41 1 E3 65 RCL IND 45 89 PROMPT
18 1 42 / 66 * 90 DSE 00
19 ST- L 43 STO 42 67 ST+ IND 46 91 GTO 07
20 X<=Y ? 44 LBL 05 68 ISG 43 92 SF 29
21 GTO 01 45 RCL 41 69 GTO 06 93 END
22 'DEG.2=?' 46 1 E3 70 ISG 42
23 PROMPT 47 / 71 GTO 05
24 STO 41 48 STO 43 72 RCL 40 (178 bytes)

Registers
R01-R10 Coefficients a0 - a9, first polynomial
R11-R20 Coefficients b0 - b9, second polynomial
R21-R39 Coefficients c0 - a18, result polynomial
R40 Degree of first polynomial
R41 Degree of second polynomial
R42-R46 Work registers for pointers to coefficients

© 1999 by Auke Hoekstra

Leave a Reply