home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sources / hp48 / 295 < prev    next >
Encoding:
Text File  |  1992-11-19  |  10.5 KB  |  232 lines

  1. Newsgroups: comp.sources.hp48
  2. Path: sparky!uunet!seq!spell
  3. From: Carlos Ferraro <carlos@fy.chalmers.se>
  4. Subject:  v07i044:  poly.cf - Poly v2.2, Part01/01
  5. Message-ID: <1992Nov19.211041.25183@seq.uncwil.edu>
  6. Followup-To: comp.sys.hp48
  7. Sender: spell@seq.uncwil.edu (Chris Spell)
  8. Organization: Univ. of North Carolina @ Wilmington
  9. Date: Thu, 19 Nov 1992 21:10:41 GMT
  10. Approved: spell@seq.uncwil.edu
  11. Lines: 223
  12.  
  13. Checksum: 2978283719 (verify with brik -cv)
  14. Submitted-by: Carlos Ferraro <carlos@fy.chalmers.se>
  15. Posting-number: Volume 7, Issue 44
  16. Archive-name: poly.cf
  17.  
  18.  
  19. BEGIN_DOC poly.doc
  20.  
  21. (Unshure of which version you have? Hit REVIEW once you are 
  22. in the LIBRARIES menu !)
  23. Gbg. , November 92
  24.  
  25. Hello everybody!
  26.  
  27. This is a very little (1702 bytes) and very fast (full
  28. sys-rpl !) xlib to deal with the fundamental polynom necessities:
  29.  
  30. ROOTS (all roots of poly), PDIV (poly div), PMULT (obvious), 
  31. PADD (poly add), PEVAL (poly eval in a point), PDER (poly der).
  32.  
  33. IMPORTANT : Unlike other polynom utilities I use vectors 
  34. instead of lists to represent polynoms.
  35.  
  36. ## ROOTS takes all the roots (real or complex) of a real poly.
  37. Up to 2nd degree polynoms can also have complex coefficients.
  38. An aptent to round every element of the resulting polynoms,
  39. as well as every root - taking the real and imaginary
  40. parts of the complex numbers separatelly - is made. 
  41. Sometimes it works fine, sometimes not, see :
  42.  
  43. Taking the roots of [ 4 33 68 15 ] :
  44. the answer { -4.9999999998 -3 -.25000000005 } = { -5 -3 -.25 }
  45. comes in 1,78 seconds !!!
  46.  
  47. Taking the roots of [ 5 16 18 18 13 2 ]  gives 
  48. the answer { -1 (0,-1) (0,1) -2 -.2 } in 7,1 seconds !!
  49.  
  50. Taking the roots of [ (1,0) (9,0) (20,0) (12,0) ] gives
  51. the answer { (-6,0) -2 -1 } after only 2 seconds !!
  52. Observe that althought the coefficients look complex, they
  53. are merely real numbers !
  54.  
  55. ## PDIV  checks for 2 vectors at level 1 and 2 and if not found,
  56. dispatches to the usual / (division). It will give the
  57. (eventual) rest at level 2. If it's found to be close to
  58. zero, it won't appear.
  59.  
  60. ## PMULT checks for 2 vectors at level 1 and 2 and if not found,
  61. dispatches to the usual * (multiplication)
  62.  
  63. ## PADD is obvious.
  64.  
  65. ## PEVAL takes a vector from level 2 and a number or a
  66. symbol from level 1.
  67.  
  68. ## PDER takes a vector from level 1.
  69.  
  70.  
  71. In the next coming versions I may replace PDER by
  72. a prog taking rational poly as well. Also PADD may desappear and
  73. instead a partial fraction "solver" will come.
  74.  
  75.  
  76. INSTRUCTIONS FOR DOWNLOADING:
  77. First you must uudecode or ASC-> the corresponding versions.
  78. In order to make it really ease for you, I include both
  79. the code of the librarie and an auto-instalation program called INSTL in a 
  80. directory called XLIBS which simply  will auto-purge itself once the lib is 
  81. installed ! Simply go into XLIBS and press INSTL. The  calc will turn off, but 
  82. don't worry, it's part of the instrucctions! When you turn it on, you'll find
  83. a little surprize in your CST! Yes, I include 1 menu-label (GROB) called
  84. POLY who will   auto-include in your CST...for your comfort!
  85. Once the libs are installed, the values are :
  86. Library POLY , LID 1224 , bytes 1702 , chksum #15FAh .
  87.  
  88. (Observe that this values are from taking "bytes" when the stack shows :
  89. Library 1224 : POLY )
  90.  
  91. INSTRUCCIONS TO PURGE THE LIBRARIES:
  92. Althought I can't imagine why anybody would like to purge this beauty, 
  93. here it is:
  94. :&:1224 DUP DETACH PURGE
  95.  
  96. Thanks ...
  97. a lot to Detlef Mueller for his <-LIB-> and <-RPL-> !!
  98.  
  99. Any questions? Call me!
  100.  
  101. END_DOC
  102.  
  103.  
  104. BEGIN_ASC poly.asc
  105. %%HP: T(1)A(R)F(.); @ tasc v2.52 file
  106. "69A20FF71CE00000005094E43545C450D9D20E1632C2A201400054E647562702
  107. 07F6274702E627A047F60296E6374716C602C696263702A347A204B2A24B2A28
  108. 4E201065B2130AC422B7FC1858A1C2A203300094E6374716C6C696E676A0C696
  109. 26271627965637E2E2E2ED2A2485A184E2020C41384E204034354513B51A1456
  110. 3284E205085C494243597632A3212041A14563284E203034354597632FD332B4
  111. 402F1732DCC025DF22DBBF1DCC02E13A193632B21309510020C4132004B2074D
  112. 005105F4C4950202A30223E22302341627C6F637729323518C4C3C0000000CEB
  113. 0050000D9D20119208C40090770B2130D9D20ECE819FF3029E208C460030040D
  114. 9D20C2D5029E208C46003223029E208C46003223072C50B2130B2130D9D20BA0
  115. D144230EF116EEDA1803A2EEDA12C23088130EEDA13223090DA1473B12C23059
  116. 9A12C23090DA133F06599A13223076BA1EF116ED2A2EEDA150FA133F06ED2A2E
  117. EDA150FA1B2130D9D20BA0D198050AEC81FEF30322309C2A29C2A203D4371040
  118. 073E5954500D4702A1704B2A2E04163A1164B2A24B2A24B2A2C121612040E041
  119. 6CBD30FED30516162A17083416A1826516162E2307E31628216CB9A2479A26B3
  120. 169A216CB9A2479A2B60167A726AF0167E316EF116CB9A2479A26B316C1216CB
  121. 9A2479A28DF0644230834165304091D308C170EF11688130CB9A2EF116E5216C
  122. B9A2189A288130F1AA1B67A28DA16D9D20442309C2A29C2A2B2130D9D20E5216
  123. E5216CB9A2A3216940402E230CB9A2189A22C230EF9A2C1216940402E230CB9A
  124. 29A21628216CB9A2189A259230EF9A2B2130881306B316479A20E516747267E3
  125. 16479A20F51672C5026025339201990000000000010178A24CB2666F068C170E
  126. 0416E62309C2A27E31629E208C4B00029A26B43629E208C4B00029A23F2A2C20
  127. D1B2130D9D20881302653047A2003D4303D43B21300D4706B31630040D2C26D9
  128. D207E3168DA3632230D1730442309FF3059230D17304423050FA1599A1DEE32D
  129. 6E2040C4963747F125079E60D6E2040C496374772D70B2130D9D206B316D0040
  130. D2C26D9D207E31629E208C4A0029E208C4B003223029E208C4B009B136D6E204
  131. 0C4963747F125079E60D6E2040C496374772D70B2130D9D207E3168813029E20
  132. 8C49008813029E208C4A0029E208C4B003223029E208C4B009B136D6E2040C49
  133. 63747F125079E60D6E2040C496374772D7029E208C41001DF6029E208C4800B2
  134. 130B213079470B2130D9D201981644230AC4363C3704B2A2433706B316FED305
  135. 2330BA0D1980506B436FBD81479A2C20D1B2130D9D209BC269C2A2925B2189A2
  136. 009A23392049900000000000106B8A2CB916D9D209C2A2925B2B2130B213088C
  137. 4500D9D20ECE8171040D9D20BA0D1980506720588130FC436B9F06AEC81BD370
  138. 122705233012270FBD81CB9A212270E9330433706B436C20D1B2130B213088C4
  139. 400D9D20FDE81ADB46D9D2032230BA0D198050AEC815C2263991685230881303
  140. 0040CBD30523304B2A233F069FF30CBD3047A2003D4303D43B21300D4702A170
  141. 6B3165233076BA17E316EEDA16B316E0E30881300E5163004091D308C1707947
  142. 076BA1B2130B213088C4300D9D20FDE8120C46D9D201413614136CA13047A200
  143. 3D4303D43B21300D4704EC30CB916322307E3166B436B0591189A2009A2AEC81
  144. 29E208C470051163B2130B213088C4200D9D20FDE8120C46D9D2014136881306
  145. 2D36D9D20C0726BA0D144230CD263B2130141368813062D36D9D2085230BA0D1
  146. 44230CD263B21304EC30CB916322301413614136CA130CBD30E0E3012F0647A2
  147. 003D4303D4303D4303D43B21300D4709FF30E0416D17304423083416EEDA16B3
  148. 16DEE32F0E737E316FED30300407F37012270E0416D17304423083416EEDA112
  149. 270E0E3029E208C47006B316DEE32F0E73511634337079470B2130FEF30EEDA1
  150. B213088C4100D9D20FDE8120C46D9D20141368813062D362AC81141368813062
  151. D36D9D2085230BA0D144230CC363B2130B0591CA130189A2262052C230672050
  152. 3D43B2040073E5954500D47083416AEC81BD37012270C6416D173044230ED2A2
  153. 12270FBD817E316189A2262055F6A2E041626205322307F4917F370122708527
  154. 038D302FA30CB916D9D20122702E23012270C5416D173044230EEDA190DA1B21
  155. 3043370122707E316AEC8138D302FA30CB916D9D209FF30C5416D17304423050
  156. FA1B2130433706B316C20D188130BC963339200000000000000010A88A28DA16
  157. D9D207E31626205AEC81E9330B2130442307E31679470C20D1B2130FEF3050FA
  158. 1B213088C4000D9D20ECE8171040D9D20881302653062D362AC81881308A7533
  159. 9916D9D20852302AC81B2130442309E55047A20D6E2040C4963747B21300D470
  160. 29E208C4800D6E2040C496374779470B2130B2130E4A2014000A5FFF45DFF4EB
  161. FF55BFFC7AFF8F9FF699FFC39FFC67FFEE4FF354FF6F3FFE4A20CC0000000000
  162. 0000000064000860000000000000000000000000000000000000000000000000
  163. 000000000950004005449465100400514444430040054454255005025F4F4453
  164. 50005005D455C4452005005546514C4400D20009500082000650003200035000
  165. 171E45D0040343545134047A2047A20E1B20F30008000051000000000000000C
  166. D5410455410C558004458004CD900000000D9D2088704119208C400FBD819761
  167. 4B2130B2130B2130CEC2"
  168. @ BYTES: #2CECh 1960
  169. END_ASC
  170.  
  171. BYTES: #2CECh 1960
  172.  
  173. BEGIN_UU poly.uue
  174. begin 644 poly
  175. M2%!(4#0X+466*O!_P0X````%24Y35$P%G2W@82,L*A`$`$5N=&5R('!O<G0@
  176. M;G(*=&\@:6YS=&%L(&QI8G,@.G0J0"LJM**"Y`(!5BLQH$PB>\^!A1HL*C`#
  177. M`$EN<W1A;&QI;F<*;&EB<F%R:65S+BXNWJ)"6!I(+B#`%(/D`@1#4U0Q6Z%!
  178. M92-(+E"`Q90D-)5G(SH2`A0:5#:"Y`(#0U-4>3;R/2-+!/)Q(\T,4OTBO?O1
  179. MS"`>HY%C(RLQD!4``DPQ`D`K<-0`%5!/3%D@(#H@,BXR($-A<FQO<R<Y,A7(
  180. MQ,,```#`O@`%`-#9`A$I@$P`"7>P$@.=+>#L&/D_(.D"R&0``T#0V0(L72#I
  181. M`LAD`",R(.D"R&0`(S)PP@4K,;`2`YTML`H=1#+@'V'NK8$P*NZ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P$@,K
  214. M,>"D`D$`H/7_5/U/OO]5^\^G__CY;YG_//G/=O_N]#]%__;S[Z0"S```````
  215. M`````$8`@`8`````````````````````````````````````D`4`!%!$258!
  216. M0``51$0T``101$52!5`@]?1$-04`!5!-54Q4`E``5605Q$0`+0"0!0`H`&`%
  217. M`",`,`4`<>%4#4`P-$450T"G`G0JX+$"/P"````5`````````,!=%$!5%,!5
  218. A"$!4"$#<"0```-#9`H@'%)$"R`3PVQAY%K02`RLQL!(#
  219. `
  220. end
  221. sum -r/size 27921/2733 section (from "begin" to "end")
  222. sum -r/size 50947/1968 entire input file
  223. END_UU
  224. --
  225. +--------------------------+----------------+
  226. | carlos@fy.chalmers.se    | "The ultimate  |
  227. | Carlos Angel Ferraro     |  truth was the |
  228. | Mathematical physics     |  penultimate   |
  229. | University of Gothemburg |  falsehood..." |
  230. | SWEDEN                   |                |
  231. +--------------------------+----------------+
  232.