# TITLE: Polynomial Multiplication (Expanding 2 Brackets) # AUTHOR: Roy F.A. Maclean # EMAIL: rfamgm at gmail # WEB: http://www.spiderpixel.co.uk/caspro # DATE: 20Sep1996 # MAKE: CASIO # MODEL: fx6300 or greater # SIZE: 188 # # Use this program to multiply two polynomials together. # You are asked for the degree of each equation, then the coeffs. # You MUST allocate enough memory, so where it says 'Defm 50' make # sure the '50' is at least twice the sum of the degrees involved. # # example: # to multiply (x^2+2x+1)(x^2+2x+1), enter 2 for the the degrees # "Deg 1"? # 2 # "Deg 2"? # 2 # # Then enter the coeffs: 1,2,1 1,2,1 # # Then 1 4 6 4 1 will be displayed # # This shows that the answer is x^4+4x^3+6x^2+4x+1 @@ Program 1 Lbl 0 Defm 50:Mcl "Deg 1"?->A "Deg 2"?->B "FIRST COEFFS" 0->C:Lbl 1 C=A+1=>"NEXT COEFFS" ?->Z[C] Isz C CGoto 1 A+1->D:Lbl 2 B+1->E:Lbl 3 A+B+D+E->F Z[D-1]Z[A+E]+Z[F]->Z[F] Dsz E:Goto 3 Dsz D:Goto 2 A+B+2->G:Lbl 4 Z[G]_ Isz G G<=2(A+B+1)=>Goto 4 Goto 0