r38_0250.html 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693
  1. <a name=r38_0250>
  2. <title>COSH</title></a>
  3. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  4. E"></p>
  5. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  6. <b>COSH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  7. <P>
  8. <P>
  9. <P>
  10. The <em>cosh</em> operator returns the hyperbolic cosine of its argument.
  11. The derivative of <em>cosh</em> and some simple transformations are known
  12. to the system.
  13. <P>
  14. <P>
  15. <P> <H3>
  16. syntax: </H3>
  17. <em>cosh</em>(&lt;expression&gt;) or <em>cosh</em> &lt;simple\_expression&gt;
  18. <P>
  19. <P>
  20. <P>
  21. &lt;expression&gt; may be any scalar REDUCE expression, not an array, matrix or
  22. vector expression. &lt;simple\_expression&gt; must be a single identifier or
  23. begin with a prefix operator name.
  24. <P>
  25. <P>
  26. <P> <H3>
  27. examples: </H3>
  28. <p><pre><tt>
  29. cosh b;
  30. COSH(B)
  31. cosh(0);
  32. 1
  33. df(cosh(x*y),x);
  34. SINH(X*Y)*Y
  35. int(cosh(x),x);
  36. SINH(X)
  37. </tt></pre><p>You may attach further functionality by defining its inverse (see
  38. <a href=r38_0200.html#r38_0237>acosh</a>).
  39. A numeric value is not returned by <em>cosh</em> unless the switch
  40. <a href=r38_0300.html#r38_0330>rounded</a> is on and its argument evaluates to a
  41. number.
  42. <P>
  43. <P>
  44. <P>
  45. <P>
  46. <a name=r38_0251>
  47. <title>COT</title></a>
  48. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  49. E"></p>
  50. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  51. <b>COT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  52. <P>
  53. <em>cot</em> represents the cotangent of its argument. It takes an arbitrary
  54. scalar expression as its argument. The derivative of <em>acot</em> and some
  55. simple properties are known to the system.
  56. <P>
  57. <P>
  58. <P> <H3>
  59. syntax: </H3>
  60. <em>cot</em>(&lt;expression&gt;) or <em>cot</em> &lt;simple\_expression&gt;
  61. <P>
  62. <P>
  63. <P>
  64. &lt;expression&gt; may be any scalar REDUCE expression. &lt;simple\_expression
  65. &gt;
  66. must be a single identifier or begin with a prefix operator name.
  67. <P>
  68. <P>
  69. <P> <H3>
  70. examples: </H3>
  71. <p><pre><tt>
  72. cot(a)*tan(a);
  73. COT(A)*TAN(A))
  74. cot(1);
  75. COT(1)
  76. df(cot(2*x),x);
  77. 2
  78. - 2*(COT(2*X) + 1)
  79. </tt></pre><p>Numerical values of expressions involving <em>cot</em> may be foun
  80. d by
  81. turning on the switch
  82. <a href=r38_0300.html#r38_0330>rounded</a>.
  83. <P>
  84. <P>
  85. <P>
  86. <P>
  87. <a name=r38_0252>
  88. <title>COTH</title></a>
  89. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  90. E"></p>
  91. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  92. <b>COTH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  93. <P>
  94. <P>
  95. <P>
  96. The <em>coth</em> operator returns the hyperbolic cotangent of its argument.
  97. The derivative of <em>coth</em> and some simple transformations are known
  98. to the system.
  99. <P>
  100. <P>
  101. <P> <H3>
  102. syntax: </H3>
  103. <em>coth</em>(&lt;expression&gt;) or <em>coth</em> &lt;simple\_expression&gt;
  104. <P>
  105. <P>
  106. <P>
  107. &lt;expression&gt; may be any scalar REDUCE expression. &lt;simple\_expression
  108. &gt;
  109. must be a single identifier or begin with a prefix operator name.
  110. <P>
  111. <P>
  112. <P> <H3>
  113. examples: </H3>
  114. <p><pre><tt>
  115. df(coth(x*y),x);
  116. 2
  117. - Y*(COTH(X*Y) - 1)
  118. coth acoth z;
  119. Z
  120. </tt></pre><p>You can write
  121. <a href=r38_0150.html#r38_0199>let</a> statements and procedures to add further
  122. functionality to <em>coth</em> if you wish. Numerical values of expressions
  123. involving <em>coth</em> may also be found by turning on the switch
  124. <a href=r38_0300.html#r38_0330>rounded</a>.
  125. <P>
  126. <P>
  127. <P>
  128. <P>
  129. <a name=r38_0253>
  130. <title>CSC</title></a>
  131. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  132. E"></p>
  133. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  134. <b>CSC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  135. <P>
  136. <P>
  137. <P>
  138. The <em>csc</em> operator returns the cosecant of its argument.
  139. The derivative of <em>csc</em> and some simple transformations are known
  140. to the system.
  141. <P>
  142. <P>
  143. <P> <H3>
  144. syntax: </H3>
  145. <em>csc</em>(&lt;expression&gt;) or <em>csc</em> &lt;simple\_expression&gt;
  146. <P>
  147. <P>
  148. <P>
  149. &lt;expression&gt; may be any scalar REDUCE expression. &lt;simple\_expression
  150. &gt;
  151. must be a single identifier or begin with a prefix operator name.
  152. <P>
  153. <P>
  154. <P> <H3>
  155. examples: </H3>
  156. <p><pre><tt>
  157. csc(q)*sin(q);
  158. CSC(Q)*SIN(Q)
  159. df(csc(x*y),x);
  160. -COT(X*Y)*CSC(X*Y)*Y
  161. </tt></pre><p>You can write
  162. <a href=r38_0150.html#r38_0199>let</a> statements and procedures to add further
  163. functionality to <em>csc</em> if you wish. Numerical values of expressions
  164. involving <em>csc</em> may also be found by turning on the switch
  165. <a href=r38_0300.html#r38_0330>rounded</a>.
  166. <P>
  167. <P>
  168. <P>
  169. <P>
  170. <a name=r38_0254>
  171. <title>CSCH</title></a>
  172. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  173. E"></p>
  174. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  175. <b>CSCH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  176. <P>
  177. <P>
  178. <P>
  179. The <em>cosh</em> operator returns the hyperbolic cosecant of its argument.
  180. The derivative of <em>csch</em> and some simple transformations are known
  181. to the system.
  182. <P>
  183. <P>
  184. <P> <H3>
  185. syntax: </H3>
  186. <em>csch</em>(&lt;expression&gt;) or <em>csch</em> &lt;simple\_expression&gt;
  187. <P>
  188. <P>
  189. <P>
  190. &lt;expression&gt; may be any scalar REDUCE expression, not an array, matrix or
  191. vector expression. &lt;simple\_expression&gt; must be a single identifier or
  192. begin with a prefix operator name.
  193. <P>
  194. <P>
  195. <P> <H3>
  196. examples: </H3>
  197. <p><pre><tt>
  198. csch b;
  199. CSCH(B)
  200. csch(0);
  201. 0
  202. df(csch(x*y),x);
  203. - COTH(X*Y)*CSCH(X*Y)*Y
  204. int(csch(x),x);
  205. INT(CSCH(X),X)
  206. </tt></pre><p>A numeric value is not returned by <em>csch</em> unless the switch
  207. <a href=r38_0300.html#r38_0330>rounded</a> is on and its argument evaluates to a
  208. number.
  209. <P>
  210. <P>
  211. <P>
  212. <a name=r38_0255>
  213. <title>ERF</title></a>
  214. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  215. E"></p>
  216. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  217. <b>ERF</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  218. <P>
  219. <P>
  220. <P>
  221. The <em>erf</em> operator represents the error function, defined by
  222. <P>
  223. <P>
  224. erf(x) = (2/sqrt(pi))*int(e^(-x^2),x)
  225. <P>
  226. <P>
  227. A limited number of its properties are known to the system, including the
  228. fact that it is an odd function. Its derivative is known, and from this,
  229. some integrals may be computed. However, a complete integration procedure
  230. for this operator is not currently included.
  231. <P>
  232. <P>
  233. <P> <H3>
  234. examples: </H3>
  235. <p><pre><tt>
  236. erf(0);
  237. 0
  238. erf(-a);
  239. - ERF(A)
  240. df(erf(x**2),x);
  241. 4*SQRT(PI)*X
  242. ------------
  243. 4
  244. X
  245. E *PI
  246. int(erf(x),x);
  247. 2
  248. X
  249. E *ERF(X)*PI*X + SQRT(PI)
  250. ---------------------------
  251. 2
  252. X
  253. E *PI
  254. </tt></pre><p>
  255. <a name=r38_0256>
  256. <title>EXP</title></a>
  257. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  258. E"></p>
  259. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  260. <b>EXP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  261. <P>
  262. <P>
  263. <P>
  264. The <em>exp</em> operator returns <em>e</em> raised to the power of its argument
  265. .
  266. <P> <H3>
  267. syntax: </H3>
  268. <P>
  269. <P>
  270. <em>exp</em>(&lt;expression&gt;) or <em>exp</em> &lt;simple\_expression&gt;
  271. <P>
  272. <P>
  273. <P>
  274. &lt;expression&gt; can be any valid REDUCE scalar expression.
  275. &lt;simple\_expression&gt; must be a single identifier or begin with a
  276. prefix operator.
  277. <P>
  278. <P>
  279. <P> <H3>
  280. examples: </H3>
  281. <p><pre><tt>
  282. exp(sin(x));
  283. SIN X
  284. E
  285. exp(11);
  286. 11
  287. E
  288. on rounded;
  289. exp sin(pi/3);
  290. 2.37744267524
  291. </tt></pre><p>Numeric values are returned only when <em>rounded</em> is on.
  292. The single letter <em>e</em> with the exponential operator <em>^</em> or
  293. <em>**</em> may be substituted for <em>exp</em> without change of function.
  294. <P>
  295. <P>
  296. <P>
  297. <a name=r38_0257>
  298. <title>SEC</title></a>
  299. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  300. E"></p>
  301. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  302. <b>SEC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  303. <P>
  304. The <em>sec</em> operator returns the secant of its argument.
  305. <P>
  306. <P>
  307. <P> <H3>
  308. syntax: </H3>
  309. <em>sec</em>(&lt;expression&gt;) or <em>sec</em> &lt;simple\_expression&gt;
  310. <P>
  311. <P>
  312. <P>
  313. &lt;expression&gt; is any valid scalar REDUCE expression,
  314. &lt;simple\_expression&gt; is a single identifier or begins with a prefix
  315. operator name.
  316. <P>
  317. <P>
  318. <P> <H3>
  319. examples: </H3>
  320. <p><pre><tt>
  321. sec abc;
  322. SEC(ABC)
  323. sec(pi);
  324. -1
  325. sec 4;
  326. SEC(4)
  327. on rounded;
  328. sec(4);
  329. - 1.52988565647
  330. sec log 5;
  331. - 25.8852966005
  332. </tt></pre><p><em>sec</em>returns a numeric value only if
  333. <a href=r38_0300.html#r38_0330>rounded</a> is on. Then the
  334. secant is calculated to the current degree of floating point precision.
  335. <P>
  336. <P>
  337. <P>
  338. <a name=r38_0258>
  339. <title>SECH</title></a>
  340. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  341. E"></p>
  342. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  343. <b>SECH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  344. <P>
  345. <P>
  346. <P>
  347. The <em>sech</em> operator returns the hyperbolic secant of its argument.
  348. <P>
  349. <P>
  350. <P> <H3>
  351. syntax: </H3>
  352. <em>sech</em>(&lt;expression&gt;) or <em>sech</em> &lt;simple\_expression&gt;
  353. <P>
  354. <P>
  355. <P>
  356. &lt;expression&gt; is any valid scalar REDUCE expression,
  357. &lt;simple\_expression&gt; is a single identifier or begins with a prefix
  358. operator name.
  359. <P>
  360. <P>
  361. <P> <H3>
  362. examples: </H3>
  363. <p><pre><tt>
  364. sech abc;
  365. SECH(ABC)
  366. sech(0);
  367. 1
  368. sech 4;
  369. SECH(4)
  370. on rounded;
  371. sech(4);
  372. 0.0366189934737
  373. sech log 5;
  374. 0.384615384615
  375. </tt></pre><p><em>sech</em>returns a numeric value only if
  376. <a href=r38_0300.html#r38_0330>rounded</a> is on. Then the
  377. expression is calculated to the current degree of floating point precision.
  378. <P>
  379. <P>
  380. <P>
  381. <a name=r38_0259>
  382. <title>SIN</title></a>
  383. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  384. E"></p>
  385. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  386. <b>SIN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  387. <P>
  388. <P>
  389. <P>
  390. The <em>sin</em> operator returns the sine of its argument.
  391. <P> <H3>
  392. syntax: </H3>
  393. <P>
  394. <P>
  395. <em>sin</em>(&lt;expression&gt;) or <em>sin</em> &lt;simple\_expression&gt;
  396. <P>
  397. <P>
  398. <P>
  399. &lt;expression&gt; is any valid scalar REDUCE expression,
  400. &lt;simple\_expression&gt; is a single identifier or begins with a prefix
  401. operator name.
  402. <P>
  403. <P>
  404. <P> <H3>
  405. examples: </H3>
  406. <p><pre><tt>
  407. sin aa;
  408. SIN(AA)
  409. sin(pi/2);
  410. 1
  411. on rounded;
  412. sin 3;
  413. 0.14112000806
  414. sin(pi/2);
  415. 1.0
  416. </tt></pre><p><em>sin</em>returns a numeric value only if <em>rounded</em> is on
  417. .
  418. Then the sine is calculated to the current degree of floating point precision.
  419. The argument in this case is assumed to be in radians.
  420. <P>
  421. <P>
  422. <P>
  423. <a name=r38_0260>
  424. <title>SINH</title></a>
  425. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  426. E"></p>
  427. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  428. <b>SINH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  429. <P>
  430. <P>
  431. <P>
  432. The <em>sinh</em> operator returns the hyperbolic sine of its argument.
  433. The derivative of <em>sinh</em> and some simple transformations are known
  434. to the system.
  435. <P>
  436. <P>
  437. <P> <H3>
  438. syntax: </H3>
  439. <em>sinh</em>(&lt;expression&gt;) or <em>sinh</em> &lt;simple\_expression&gt;
  440. <P>
  441. <P>
  442. <P>
  443. &lt;expression&gt; may be any scalar REDUCE expression, not an array, matrix or
  444. vector expression. &lt;simple\_expression&gt; must be a single identifier or
  445. begin with a prefix operator name.
  446. <P>
  447. <P>
  448. <P> <H3>
  449. examples: </H3>
  450. <p><pre><tt>
  451. sinh b;
  452. SINH(B)
  453. sinh(0);
  454. 0
  455. df(sinh(x**2),x);
  456. 2
  457. 2*COSH(X )*X
  458. int(sinh(4*x),x);
  459. COSH(4*X)
  460. ---------
  461. 4
  462. on rounded;
  463. sinh 4;
  464. 27.2899171971
  465. </tt></pre><p>You may attach further functionality by defining its inverse (see
  466. <a href=r38_0200.html#r38_0245>asinh</a>).
  467. A numeric value is not returned by <em>sinh</em> unless the switch
  468. <a href=r38_0300.html#r38_0330>rounded</a> is on and its argument evaluates to a
  469. number.
  470. <P>
  471. <P>
  472. <P>
  473. <a name=r38_0261>
  474. <title>TAN</title></a>
  475. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  476. E"></p>
  477. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  478. <b>TAN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  479. <P>
  480. The <em>tan</em> operator returns the tangent of its argument.
  481. <P> <H3>
  482. syntax: </H3>
  483. <P>
  484. <P>
  485. <em>tan</em>(&lt;expression&gt;) or <em>tan</em> &lt;simple\_expression&gt;
  486. <P>
  487. <P>
  488. <P>
  489. <P>
  490. &lt;expression&gt; is any valid scalar REDUCE expression,
  491. &lt;simple\_expression&gt; is a single identifier or begins with a prefix
  492. operator name.
  493. <P>
  494. <P>
  495. <P> <H3>
  496. examples: </H3>
  497. <p><pre><tt>
  498. tan a;
  499. TAN(A)
  500. tan(pi/5);
  501. PI
  502. TAN(--)
  503. 5
  504. on rounded;
  505. tan(pi/5);
  506. 0.726542528005
  507. </tt></pre><p><em>tan</em>returns a numeric value only if <em>rounded</em> is on
  508. . Then the
  509. tangent is calculated to the current degree of floating point accuracy.
  510. <P>
  511. <P>
  512. When
  513. <a href=r38_0300.html#r38_0330>rounded</a> is on,
  514. no check is made to see if the argument of <em>tan</em> is a multiple of
  515. pi/2, for which the tangent goes to positive or negative infinity.
  516. (Of course, since REDUCE uses a fixed-point representation of pi/2,
  517. it produces a large but not infinite number.) You need to make a check for
  518. multiples of pi/2 in any program you use that might possibly ask
  519. for the tangent of such a quantity.
  520. <P>
  521. <P>
  522. <P>
  523. <a name=r38_0262>
  524. <title>TANH</title></a>
  525. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  526. E"></p>
  527. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  528. <b>TANH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
  529. <P>
  530. <P>
  531. <P>
  532. The <em>tanh</em> operator returns the hyperbolic tangent of its argument.
  533. The derivative of <em>tanh</em> and some simple transformations are known
  534. to the system.
  535. <P>
  536. <P>
  537. <P> <H3>
  538. syntax: </H3>
  539. <em>tanh</em>(&lt;expression&gt;) or <em>tanh</em> &lt;simple\_expression&gt;
  540. <P>
  541. <P>
  542. <P>
  543. &lt;expression&gt; may be any scalar REDUCE expression, not an array, matrix or
  544. vector expression. &lt;simple\_expression&gt; must be a single identifier or
  545. begin with a prefix operator name.
  546. <P>
  547. <P>
  548. <P> <H3>
  549. examples: </H3>
  550. <p><pre><tt>
  551. tanh b;
  552. TANH(B)
  553. tanh(0);
  554. 0
  555. df(tanh(x*y),x);
  556. 2
  557. Y*( - TANH(X*Y) + 1)
  558. int(tanh(x),x);
  559. 2*X
  560. LOG(E + 1) - X
  561. on rounded; tanh 2;
  562. 0.964027580076
  563. </tt></pre><p>You may attach further functionality by defining its inverse (see
  564. <a href=r38_0200.html#r38_0247>atanh</a>).
  565. A numeric value is not returned by <em>tanh</em> unless the switch
  566. <a href=r38_0300.html#r38_0330>rounded</a> is on and its argument evaluates to a
  567. number.
  568. <P>
  569. <P>
  570. <P>
  571. <a name=r38_0263>
  572. <title>Elementary Functions</title></a>
  573. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  574. E"></p>
  575. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  576. <b>Elementary Functions</b><menu>
  577. <li><a href=r38_0200.html#r38_0236>ACOS operator</a><P>
  578. <li><a href=r38_0200.html#r38_0237>ACOSH operator</a><P>
  579. <li><a href=r38_0200.html#r38_0238>ACOT operator</a><P>
  580. <li><a href=r38_0200.html#r38_0239>ACOTH operator</a><P>
  581. <li><a href=r38_0200.html#r38_0240>ACSC operator</a><P>
  582. <li><a href=r38_0200.html#r38_0241>ACSCH operator</a><P>
  583. <li><a href=r38_0200.html#r38_0242>ASEC operator</a><P>
  584. <li><a href=r38_0200.html#r38_0243>ASECH operator</a><P>
  585. <li><a href=r38_0200.html#r38_0244>ASIN operator</a><P>
  586. <li><a href=r38_0200.html#r38_0245>ASINH operator</a><P>
  587. <li><a href=r38_0200.html#r38_0246>ATAN operator</a><P>
  588. <li><a href=r38_0200.html#r38_0247>ATANH operator</a><P>
  589. <li><a href=r38_0200.html#r38_0248>ATAN2 operator</a><P>
  590. <li><a href=r38_0200.html#r38_0249>COS operator</a><P>
  591. <li><a href=r38_0250.html#r38_0250>COSH operator</a><P>
  592. <li><a href=r38_0250.html#r38_0251>COT operator</a><P>
  593. <li><a href=r38_0250.html#r38_0252>COTH operator</a><P>
  594. <li><a href=r38_0250.html#r38_0253>CSC operator</a><P>
  595. <li><a href=r38_0250.html#r38_0254>CSCH operator</a><P>
  596. <li><a href=r38_0250.html#r38_0255>ERF operator</a><P>
  597. <li><a href=r38_0250.html#r38_0256>EXP operator</a><P>
  598. <li><a href=r38_0250.html#r38_0257>SEC operator</a><P>
  599. <li><a href=r38_0250.html#r38_0258>SECH operator</a><P>
  600. <li><a href=r38_0250.html#r38_0259>SIN operator</a><P>
  601. <li><a href=r38_0250.html#r38_0260>SINH operator</a><P>
  602. <li><a href=r38_0250.html#r38_0261>TAN operator</a><P>
  603. <li><a href=r38_0250.html#r38_0262>TANH operator</a><P>
  604. </menu>
  605. <a name=r38_0264>
  606. <title>SWITCHES</title></a>
  607. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  608. E"></p>
  609. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  610. <b>SWITCHES</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>introduction</b><P>
  611. <P>
  612. Switches are set on or off using the commands
  613. <a href=r38_0200.html#r38_0210>on</a> or
  614. <a href=r38_0200.html#r38_0209>off</a>, respectively.
  615. The default setting of the switches described in this section is
  616. <a href=r38_0200.html#r38_0209>off</a> unless stated otherwise.
  617. <P>
  618. <P>
  619. <a name=r38_0265>
  620. <title>ALGINT</title></a>
  621. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  622. E"></p>
  623. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  624. <b>ALGINT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  625. <P>
  626. <P>
  627. <P>
  628. When the <em>algint</em> switch is on, the algebraic integration module (which
  629. must be loaded from the REDUCE library) is used for integration.
  630. <P>
  631. <P>
  632. Loading <em>algint</em> from the library automatically turns on the
  633. <em>algint</em> switch. An error message will be given if <em>algint</em> is
  634. turned on when the <em>algint</em> has not been loaded from the library.
  635. <P>
  636. <P>
  637. <P>
  638. <a name=r38_0266>
  639. <title>ALLBRANCH</title></a>
  640. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  641. E"></p>
  642. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  643. <b>ALLBRANCH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  644. <P>
  645. When <em>allbranch</em> is on, the operator
  646. <a href=r38_0150.html#r38_0179>solve</a> selects all
  647. branches of solutions.
  648. When <em>allbranch</em> is off, it selects only the principal
  649. branches. Default is <em>on</em>.
  650. <P>
  651. <P>
  652. <P> <H3>
  653. examples: </H3>
  654. <p><pre><tt>
  655. solve(log(sin(x+3)),x);
  656. {X=2*ARBINT(1)*PI - ASIN(1) - 3,
  657. X=2*ARBINT(1)*PI + ASIN(1) + PI - 3}
  658. off allbranch;
  659. solve(log(sin(x+3)),x);
  660. X=ASIN(1) - 3
  661. </tt></pre><p>
  662. <a href=r38_0100.html#r38_0138>arbint</a>(1) indicates an arbitrary integer, whi
  663. ch is given a
  664. unique identifier by REDUCE, showing that there are infinitely many
  665. solutions of this type. When <em>allbranch</em> is off, the single
  666. canonical solution is given.
  667. <P>
  668. <P>
  669. <P>
  670. <a name=r38_0267>
  671. <title>ALLFAC</title></a>
  672. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  673. E"></p>
  674. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  675. <b>ALLFAC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  676. <P>
  677. <P>
  678. <P>
  679. The <em>allfac</em> switch, when on, causes REDUCE to factor out automatically
  680. common products in the output of expressions. Default is <em>on</em>.
  681. <P>
  682. <P>
  683. <P> <H3>
  684. examples: </H3>
  685. <p><pre><tt>
  686. x + x*y**3 + x**2*cos(z);
  687. 3
  688. X*(COS(Z)*X + Y + 1)
  689. off allfac;
  690. x + x*y**3 + x**2*cos(z);
  691. 2 3
  692. COS(Z)*X + X*Y + X
  693. </tt></pre><p>The <em>allfac</em> switch has no effect when <em>pri</em> is off.
  694. Although the
  695. switch setting stays as it was, printing behavior is as if it were off.
  696. <P>
  697. <P>
  698. <P>
  699. <a name=r38_0268>
  700. <title>ARBVARS</title></a>
  701. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  702. E"></p>
  703. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  704. <b>ARBVARS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  705. <P>
  706. <P>
  707. <P>
  708. When <em>arbvars</em> is on, the solutions of singular or underdetermined
  709. systems of equations are presented in terms of arbitrary complex variables
  710. (see
  711. <a href=r38_0100.html#r38_0139>arbcomplex</a>). Otherwise, the solution is param
  712. etrized in
  713. terms of some of the input variables. Default is <em>on</em>.
  714. <P>
  715. <P>
  716. <P> <H3>
  717. examples: </H3>
  718. <p><pre><tt>
  719. solve({2x + y,4x + 2y},{x,y});
  720. arbcomplex(1)
  721. {{x= - -------------,y=arbcomplex(1)}}
  722. 2
  723. solve({sqrt(x)+ y**3-1},{x,y});
  724. 6 3
  725. {{y=arbcomplex(2),x=y - 2*y + 1}}
  726. off arbvars;
  727. solve({2x + y,4x + 2y},{x,y});
  728. y
  729. {{x= - -}}
  730. 2
  731. solve({sqrt(x)+ y**3-1},{x,y});
  732. 6 3
  733. {{x=y - 2*y + 1}}
  734. </tt></pre><p>With <em>arbvars</em> off, the return value <em>{{}}</em> means th
  735. at the
  736. equations given to
  737. <a href=r38_0150.html#r38_0179>solve</a> imply no relation among the input
  738. variables.
  739. <P>
  740. <P>
  741. <P>
  742. <a name=r38_0269>
  743. <title>BALANCED_MOD</title></a>
  744. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  745. E"></p>
  746. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  747. <b>BALANCED\_MOD</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  748. <P>
  749. <P>
  750. <P>
  751. <a href=r38_0300.html#r38_0305>modular</a>numbers are normally produced in the r
  752. ange [0,...&lt;n&gt;),
  753. where
  754. &lt;n&gt; is the current modulus. With <em>balanced_mod</em> on, the range
  755. [-&lt;n&gt;/2,&lt;n&gt;/2], or more precisely
  756. [-floor((&lt;n&gt;-1)/2), ceiling((&lt;n&gt;-1)/2)], is used instead.
  757. <P>
  758. <P>
  759. <P> <H3>
  760. examples: </H3>
  761. <p><pre><tt>
  762. setmod 7;
  763. 1
  764. on modular;
  765. 4;
  766. 4
  767. on balanced_mod;
  768. 4;
  769. -3
  770. </tt></pre><p>
  771. <a name=r38_0270>
  772. <title>BFSPACE</title></a>
  773. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  774. E"></p>
  775. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  776. <b>BFSPACE</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  777. <P>
  778. <P>
  779. <P>
  780. Floating point numbers are normally printed in a compact notation (either
  781. fixed point or in scientific notation if
  782. <a href=r38_0200.html#r38_0219>SCIENTIFIC_NOTATION</a>
  783. has been used). In some (but not all) cases, it helps comprehensibility
  784. if spaces are inserted in the number at regular intervals. The switch
  785. <em>bfspace</em>, if on, will cause a blank to be inserted in the number after
  786. every five characters.
  787. <P> <H3>
  788. examples: </H3>
  789. <p><pre><tt>
  790. on rounded;
  791. 1.2345678;
  792. 1.2345678
  793. on bfspace;
  794. 1.2345678;
  795. 1.234 5678
  796. </tt></pre><p><P>
  797. <P>
  798. <em>bfspace</em>is normally off.
  799. <P>
  800. <P>
  801. <P>
  802. <a name=r38_0271>
  803. <title>COMBINEEXPT</title></a>
  804. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  805. E"></p>
  806. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  807. <b>COMBINEEXPT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  808. <P>
  809. <P>
  810. <P>
  811. REDUCE is in general poor at surd simplification. However, when the
  812. switch <em>combineexpt</em> is on, the system attempts to combine
  813. exponentials whenever possible.
  814. <P>
  815. <P>
  816. <P> <H3>
  817. examples: </H3>
  818. <p><pre><tt>
  819. 3^(1/2)*3^(1/3)*3^(1/6);
  820. 1/3 1/6
  821. SQRT(3)*3 *3
  822. on combineexpt;
  823. ws;
  824. 1
  825. </tt></pre><p>
  826. <a name=r38_0272>
  827. <title>COMBINELOGS</title></a>
  828. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  829. E"></p>
  830. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  831. <b>COMBINELOGS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  832. <P>
  833. <P>
  834. <P>
  835. In many cases it is desirable to expand product arguments of logarithms,
  836. or collect a sum of logarithms into a single logarithm. Since these are
  837. inverse operations, it is not possible to provide rules for doing both at
  838. the same time and preserve the REDUCE concept of idempotent evaluation.
  839. As an alternative, REDUCE provides two switches
  840. <a href=r38_0250.html#r38_0285>expandlogs</a> and
  841. <em>combinelogs</em> to carry out these operations.
  842. <P> <H3>
  843. examples: </H3>
  844. <p><pre><tt>
  845. on expandlogs;
  846. log(x*y);
  847. LOG(X) + LOG(Y)
  848. on combinelogs;
  849. ws;
  850. LOG(X*Y)
  851. </tt></pre><p><P>
  852. <P>
  853. At the present time, it is possible to have both switches on at once,
  854. which could lead to infinite recursion. However, an expression is
  855. switched from one form to the other in this case. Users should not rely
  856. on this behavior, since it may change in the next release.
  857. <P>
  858. <P>
  859. <P>
  860. <a name=r38_0273>
  861. <title>COMP</title></a>
  862. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  863. E"></p>
  864. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  865. <b>COMP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  866. <P>
  867. <P>
  868. <P>
  869. When <em>comp</em> is on, any succeeding function definitions are compiled
  870. into a faster-running form. Default is <em>off</em>.
  871. <P>
  872. <P>
  873. <P> <H3>
  874. examples: </H3>
  875. <p><pre><tt></tt></pre><p>The following procedure finds Fibonacci numbers recurs
  876. ively.
  877. Create a new file ``refib&quot; in your current directory with the following
  878. lines in it:<p><pre><tt>
  879. procedure refib(n);
  880. if fixp n and n &gt;= 0 then
  881. if n &lt;= 1 then 1
  882. else refib(n-1) + refib(n-2)
  883. else rederr &quot;nonnegative integer only&quot;;
  884. end;
  885. </tt></pre><p>Now load REDUCE and run the following:<p><pre><tt>
  886. on time;
  887. Time: 100 ms
  888. in &quot;refib&quot;$
  889. Time: 0 ms
  890. REFIB
  891. Time: 260 ms
  892. Time: 20 ms
  893. refib(80);
  894. 37889062373143906
  895. Time: 14840 ms
  896. on comp;
  897. Time: 80 ms
  898. in &quot;refib&quot;$
  899. Time: 20 ms
  900. REFIB
  901. Time: 640 ms
  902. refib(80);
  903. 37889062373143906
  904. Time: 10940 ms
  905. </tt></pre><p>
  906. <P>
  907. <P>
  908. Note that the compiled procedure runs faster. Your time messages will
  909. differ depending upon which system you have. Compiled functions remain so
  910. for the duration of the REDUCE session, and are then lost. They must be
  911. recompiled if wanted in another session. With the switch
  912. <a href=r38_0300.html#r38_0333>time</a> on
  913. as shown above, the CPU time used in executing the command is returned in
  914. milliseconds. Be careful not to leave <em>comp</em> on unless you want it,
  915. as it makes the processing of procedures much slower.
  916. <P>
  917. <P>
  918. <P>
  919. <P>
  920. <a name=r38_0274>
  921. <title>COMPLEX</title></a>
  922. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  923. E"></p>
  924. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  925. <b>COMPLEX</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  926. <P>
  927. <P>
  928. <P>
  929. When the <em>complex</em> switch is on, full complex arithmetic is used in
  930. simplification, function evaluation, and factorization. Default is <em>off</em>.
  931. <P>
  932. <P>
  933. <P> <H3>
  934. examples: </H3>
  935. <p><pre><tt>
  936. factorize(a**2 + b**2);
  937. 2 2
  938. {{A + B ,1}}
  939. on complex;
  940. factorize(a**2 + b**2);
  941. {{A + I*B,1},{A - I*B,1}}
  942. (x**2 + y**2)/(x + i*y);
  943. X - I*Y
  944. on rounded;
  945. *** Domain mode COMPLEX changed to COMPLEX_FLOAT
  946. sqrt(-17);
  947. 4.12310562562*I
  948. log(7*i);
  949. 1.94591014906 + 1.57079632679*I
  950. </tt></pre><p>Complex floating-point can be done by turning on
  951. <a href=r38_0300.html#r38_0330>rounded</a> in
  952. addition to <em>complex</em>. With <em>complex</em> off however, REDUCE knows
  953. that i is the square root of -1 but will not
  954. carry out more complicated complex operations. If you want complex
  955. denominators cleared by multiplication by their conjugates, turn on the
  956. switch
  957. <a href=r38_0300.html#r38_0324>rationalize</a>.
  958. <P>
  959. <P>
  960. <P>
  961. <a name=r38_0275>
  962. <title>CREF</title></a>
  963. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  964. E"></p>
  965. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  966. <b>CREF</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  967. <P>
  968. <P>
  969. <P>
  970. The switch <em>cref</em> invokes the CREF cross-reference program that
  971. processes a set of procedure definitions to produce a summary of their
  972. entry points, undefined procedures, non-local variables and so on. The
  973. program will also check that procedures are called with a consistent
  974. number of arguments, and print a diagnostic message otherwise.
  975. <P>
  976. <P>
  977. The output is alphabetized on the first seven characters of each function
  978. name.
  979. <P>
  980. <P>
  981. To invoke the cross-reference program, <em>cref</em> is first turned on.
  982. This causes the program to load and the cross-referencing process to
  983. begin. After all the required definitions are loaded, turning <em>cref</em>
  984. off will cause a cross-reference listing to be produced.
  985. <P>
  986. <P>
  987. Algebraic procedures in REDUCE are treated as if they were symbolic, so
  988. that algebraic constructs will actually appear as calls to symbolic
  989. functions, such as <em>aeval</em>.
  990. <P>
  991. <P>
  992. <P>
  993. <a name=r38_0276>
  994. <title>CRAMER</title></a>
  995. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  996. E"></p>
  997. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  998. <b>CRAMER</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  999. <P>
  1000. <P>
  1001. <P>
  1002. When the <em>cramer</em> switch is on,
  1003. <a href=r38_0300.html#r38_0345>matrix</a> inversion
  1004. and linear equation
  1005. solving (operator
  1006. <a href=r38_0150.html#r38_0179>solve</a>) is done by Cramer's rule, through exte
  1007. rior
  1008. multiplication. Default is <em>off</em>.
  1009. <P>
  1010. <P>
  1011. <P> <H3>
  1012. examples: </H3>
  1013. <p><pre><tt>
  1014. on time;
  1015. Time: 80 ms
  1016. off output;
  1017. Time: 100 ms
  1018. mm := mat((a,b,c,d,f),(a,a,c,f,b),(b,c,a,c,d), (c,c,a,b,f),
  1019. (d,a,d,e,f));
  1020. Time: 300 ms
  1021. inverse := 1/mm;
  1022. Time: 18460 ms
  1023. on cramer;
  1024. Time: 80 ms
  1025. cramersinv := 1/mm;
  1026. Time: 9260 ms
  1027. </tt></pre><p>Your time readings will vary depending on the REDUCE version you u
  1028. se.
  1029. After you invert the matrix, turn on
  1030. <a href=r38_0300.html#r38_0314>output</a> and ask for one of
  1031. the elements of the inverse matrix, such as <em>cramersinv(3,2)</em>, so that
  1032. you can see the size of the expressions produced.
  1033. <P>
  1034. <P>
  1035. Inversion of matrices and the solution of linear equations with dense
  1036. symbolic entries in many variables is generally considerably faster with
  1037. <em>cramer</em> on. However, inversion of numeric-valued matrices is
  1038. slower. Consider the matrices you're inverting before deciding whether to
  1039. turn <em>cramer</em> on or off. A substantial portion of the time in matrix
  1040. inversion is given to formatting the results for printing. To save this
  1041. time, turn <em>output</em> off, as shown in this example or terminate the
  1042. expression with a dollar sign instead of a semicolon. The results are
  1043. still available to you in the workspace associated with your prompt
  1044. number, or you can assign them to an identifier for further use.
  1045. <P>
  1046. <P>
  1047. <P>
  1048. <a name=r38_0277>
  1049. <title>DEFN</title></a>
  1050. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1051. E"></p>
  1052. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1053. <b>DEFN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1054. <P>
  1055. <P>
  1056. <P>
  1057. When the switch <em>defn</em> is on, the Standard Lisp equivalent of the
  1058. input statement or procedure is printed, but not evaluated. Default is
  1059. <em>off</em>.
  1060. <P>
  1061. <P>
  1062. <P> <H3>
  1063. examples: </H3>
  1064. <p><pre><tt>
  1065. on defn;
  1066. 17/3;
  1067. (AEVAL (LIST 'QUOTIENT 17 3))
  1068. df(sin(x),x,2);
  1069. (AEVAL (LIST 'DF (LIST 'SIN 'X) 'X 2))
  1070. procedure coshval(a);
  1071. begin scalar g;
  1072. g := (exp(a) + exp(-a))/2;
  1073. return g
  1074. end;
  1075. (AEVAL
  1076. (PROGN
  1077. (FLAG '(COSHVAL) 'OPFN)
  1078. (DE COSHVAL (A)
  1079. (PROG (G)
  1080. (SETQ G
  1081. (AEVAL
  1082. (LIST
  1083. 'QUOTIENT
  1084. (LIST
  1085. 'PLUS
  1086. (LIST 'EXP A)
  1087. (LIST 'EXP (LIST 'MINUS A)))
  1088. 2)))
  1089. (RETURN G)))) )
  1090. coshval(1);
  1091. (AEVAL (LIST 'COSHVAL 1))
  1092. off defn;
  1093. coshval(1);
  1094. Declare COSHVAL operator? (Y or N)
  1095. n
  1096. procedure coshval(a);
  1097. begin scalar g;
  1098. g := (exp(a) + exp(-a))/2;
  1099. return g
  1100. end;
  1101. COSHVAL
  1102. on rounded;
  1103. coshval(1);
  1104. 1.54308063482
  1105. </tt></pre><p>The above function <em>coshval</em> finds the hyperbolic cosine (c
  1106. osh) of its
  1107. argument. When <em>defn</em> is on, you can see the Standard Lisp equivalent
  1108. of the function, but it is not entered into the system as shown by the
  1109. message <em>Declare COSHVAL operator?</em>. It must be reentered with
  1110. <em>defn</em> off to be recognized. This procedure is used as an example; a
  1111. more efficient procedure would eliminate the unnecessary local variable
  1112. with
  1113. <p><pre><tt>
  1114. procedure coshval(a);
  1115. (exp(a) + exp(-a))/2;
  1116. </tt></pre><p><P>
  1117. <P>
  1118. <P>
  1119. <P>
  1120. <a name=r38_0278>
  1121. <title>DEMO</title></a>
  1122. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1123. E"></p>
  1124. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1125. <b>DEMO</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1126. <P>
  1127. <P>
  1128. <P>
  1129. The <em>demo</em> switch is used for interactive files, causing the system
  1130. to pause after each command in the file until you type a <em>Return</em>.
  1131. Default is <em>off</em>.
  1132. <P>
  1133. <P>
  1134. The switch <em>demo</em> has no effect on top level interactive
  1135. statements. Use it when you want to slow down operations in a file so
  1136. you can see what is happening.
  1137. <P>
  1138. <P>
  1139. You can either include the <em>on demo</em> command in the file, or enter
  1140. it from the top level before bringing in any file. Unlike the
  1141. <a href=r38_0100.html#r38_0128>pause</a> command, <em>on demo</em> does not perm
  1142. it you to interrupt
  1143. the file for questions of your own.
  1144. <P>
  1145. <P>
  1146. <P>
  1147. <P>
  1148. <a name=r38_0279>
  1149. <title>DFPRINT</title></a>
  1150. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1151. E"></p>
  1152. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1153. <b>DFPRINT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1154. <P>
  1155. <P>
  1156. <P>
  1157. When <em>dfprint</em> is on, expressions in the differentiation operator
  1158. <a href=r38_0100.html#r38_0148>df</a> are printed in a more ``natural'' notation
  1159. , with the
  1160. differentiation variables appearing as subscripts. In addition, if the
  1161. switch
  1162. <a href=r38_0300.html#r38_0310>noarg</a> is on (the default), the arguments of t
  1163. he
  1164. differentiated operator are suppressed.
  1165. <P>
  1166. <P>
  1167. <P> <H3>
  1168. examples: </H3>
  1169. <p><pre><tt>
  1170. operator f;
  1171. df(f x,x);
  1172. DF(F(X),X);
  1173. on dfprint;
  1174. ws;
  1175. F
  1176. X
  1177. df(f(x,y),x,y);
  1178. F
  1179. Y
  1180. off noarg;
  1181. ws;
  1182. F(X,Y)
  1183. X
  1184. </tt></pre><p>
  1185. <a name=r38_0280>
  1186. <title>DIV</title></a>
  1187. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1188. E"></p>
  1189. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1190. <b>DIV</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1191. <P>
  1192. <P>
  1193. <P>
  1194. When <em>div</em> is on, the system divides any simple factors found in
  1195. the denominator of an expression into the numerator. Default is <em>off</em>.
  1196. <P>
  1197. <P>
  1198. <P> <H3>
  1199. examples: </H3>
  1200. <p><pre><tt>
  1201. on div;
  1202. a := x**2/y**2;
  1203. 2 -2
  1204. A := X *Y
  1205. b := a/(3*z);
  1206. 1 2 -2 -1
  1207. B := -*X *Y *Z
  1208. 3
  1209. off div;
  1210. a;
  1211. 2
  1212. X
  1213. ---
  1214. 2
  1215. Y
  1216. b;
  1217. 2
  1218. X
  1219. -------
  1220. 2
  1221. 3*Y *Z
  1222. </tt></pre><p>The <em>div</em> switch only has effect when the
  1223. <a href=r38_0300.html#r38_0319>pri</a> switch is on.
  1224. When <em>pri</em> is off, regardless of the setting of <em>div</em>, the
  1225. printing behavior is as if <em>div</em> were off.
  1226. <P>
  1227. <P>
  1228. <P>
  1229. <a name=r38_0281>
  1230. <title>ECHO</title></a>
  1231. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1232. E"></p>
  1233. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1234. <b>ECHO</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1235. <P>
  1236. <P>
  1237. <P>
  1238. The <em>echo</em> switch is normally off for top-level entry, and on when files
  1239. are brought in. If <em>echo</em> is turned on at the top level, your input
  1240. statements are echoed to the screen (thus appearing twice). Default
  1241. <em>off</em> (but note default <em>on</em> for files).
  1242. <P>
  1243. <P>
  1244. If you want to display certain portions of a file and not others, use the
  1245. commands <em>off echo</em> and <em>on echo</em> inside the file. If you want
  1246. no display of the file, use the input command
  1247. <P>
  1248. <P>
  1249. <em>in</em> filename<em>$</em>
  1250. <P>
  1251. <P>
  1252. rather than using the semicolon delimiter.
  1253. <P>
  1254. <P>
  1255. Be careful when you use commands within a file to generate another file.
  1256. Since <em>echo</em> is on for files, the output file echoes input statements
  1257. (unlike its behavior from the top level). You should explicitly turn off
  1258. <em>echo</em> when writing output, and turn it back on when you're done.
  1259. <P>
  1260. <P>
  1261. <P>
  1262. <a name=r38_0282>
  1263. <title>ERRCONT</title></a>
  1264. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1265. E"></p>
  1266. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1267. <b>ERRCONT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1268. <P>
  1269. <P>
  1270. <P>
  1271. When the <em>errcont</em> switch is on, error conditions do not stop file
  1272. execution. Error messages will be printed whether <em>errcont</em> is on or
  1273. off.
  1274. <P>
  1275. <P>
  1276. Default is <em>off</em>.
  1277. <P>
  1278. <P>
  1279. The following describes what happens when an error occurs in a file under
  1280. each setting of <em>errcont</em> and <em>int</em>:
  1281. <P>
  1282. <P>
  1283. Both off: Message is printed and parsing continues, but no further
  1284. statements are executed; no commands from keyboard accepted except bye or
  1285. end;
  1286. <P>
  1287. <P>
  1288. <em>errcont</em>off, <em>int</em> on: Message is printed, and you are asked
  1289. if you wish to continue. (This is the default behavior);
  1290. <P>
  1291. <P>
  1292. <em>errcont</em>on, <em>int</em> off: Message is printed, and file continues
  1293. to execute without pause;
  1294. <P>
  1295. <P>
  1296. Both on: Message is printed, and file continues to execute without pause.
  1297. <P>
  1298. <P>
  1299. <P>
  1300. <P>
  1301. <a name=r38_0283>
  1302. <title>EVALLHSEQP</title></a>
  1303. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1304. E"></p>
  1305. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1306. <b>EVALLHSEQP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1307. <P>
  1308. <P>
  1309. <P>
  1310. Under normal circumstances, the right-hand-side of an
  1311. <a href=r38_0001.html#r38_0045>equation</a>
  1312. is evaluated but not the left-hand-side. This also applies to any
  1313. substitutions made by the
  1314. <a href=r38_0150.html#r38_0182>sub</a> operator. If both sides are to be
  1315. evaluated, the switch <em>evallhseqp</em> should be turned on.
  1316. <P>
  1317. <P>
  1318. <a name=r38_0284>
  1319. <title>EXP_switch</title></a>
  1320. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1321. E"></p>
  1322. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1323. <b>EXP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1324. <P>
  1325. <P>
  1326. <P>
  1327. When the <em>exp</em> switch is on, powers and products of expressions are
  1328. expanded. Default is <em>on</em>.
  1329. <P>
  1330. <P>
  1331. <P> <H3>
  1332. examples: </H3>
  1333. <p><pre><tt>
  1334. (x+1)**3;
  1335. 3 2
  1336. X + 3*X + 3*X + 1
  1337. (a + b*i)*(c + d*i);
  1338. A*C + A*D*I + B*C*I - B*D
  1339. off exp;
  1340. (x+1)**3;
  1341. 3
  1342. (X + 1)
  1343. (a + b*i)*(c + d*i);
  1344. (A + B*I)*(C + D*I)
  1345. length((x+1)**2/(y+1));
  1346. 2
  1347. </tt></pre><p>Note that REDUCE knows that i^2 = -1.
  1348. When <em>exp</em> is off, equivalent expressions may not simplify to the same
  1349. form, although zero expressions still simplify to zero. Several operators
  1350. that expect a polynomial argument behave differently when <em>exp</em> is
  1351. off, such as
  1352. <a href=r38_0150.html#r38_0157>length</a>. Be cautious about leaving <em>exp
  1353. </em> off.
  1354. <P>
  1355. <P>
  1356. <P>
  1357. <a name=r38_0285>
  1358. <title>EXPANDLOGS</title></a>
  1359. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1360. E"></p>
  1361. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1362. <b>EXPANDLOGS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1363. <P>
  1364. <P>
  1365. <P>
  1366. In many cases it is desirable to expand product arguments of logarithms,
  1367. or collect a sum of logarithms into a single logarithm. Since these are
  1368. inverse operations, it is not possible to provide rules for doing both at
  1369. the same time and preserve the REDUCE concept of idempotent evaluation.
  1370. As an alternative, REDUCE provides two switches <em>expandlogs</em> and
  1371. <a href=r38_0250.html#r38_0272>combinelogs</a> to carry out these operations. Bo
  1372. th are off by default.
  1373. <P> <H3>
  1374. examples: </H3>
  1375. <p><pre><tt>
  1376. on expandlogs;
  1377. log(x*y);
  1378. LOG(X) + LOG(Y)
  1379. on combinelogs;
  1380. ws;
  1381. LOG(X*Y)
  1382. </tt></pre><p><P>
  1383. <P>
  1384. At the present time, it is possible to have both switches on at once,
  1385. which could lead to infinite recursion. However, an expression is
  1386. switched from one form to the other in this case. Users should not rely
  1387. on this behavior, since it may change in the next release.
  1388. <P>
  1389. <P>
  1390. <P>
  1391. <a name=r38_0286>
  1392. <title>EZGCD</title></a>
  1393. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1394. E"></p>
  1395. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1396. <b>EZGCD</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1397. <P>
  1398. <P>
  1399. <P>
  1400. When <em>ezgcd</em> and
  1401. <a href=r38_0050.html#r38_0086>gcd</a> are on, greatest common divisors are
  1402. computed using the EZ GCD algorithm that uses modular arithmetic (and is
  1403. usually faster). Default is <em>off</em>.
  1404. <P>
  1405. <P>
  1406. As a side effect of the gcd calculation, the expressions involved are
  1407. factored, though not the heavy-duty factoring of
  1408. <a href=r38_0150.html#r38_0151>factorize</a>. The
  1409. EZ GCD algorithm was introduced in a paper by J. Moses and D.Y.Y. Yun in
  1410. &lt;Proceedings of the ACM&gt;, 1973, pp. 159-166.
  1411. <P>
  1412. <P>
  1413. Note that the
  1414. <a href=r38_0050.html#r38_0086>gcd</a> switch must also be on for <em>ezgcd</em>
  1415. to have
  1416. effect.
  1417. <P>
  1418. <P>
  1419. <P>
  1420. <a name=r38_0287>
  1421. <title>FACTOR</title></a>
  1422. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1423. E"></p>
  1424. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1425. <b>FACTOR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1426. <P>
  1427. <P>
  1428. <P>
  1429. When the <em>factor</em> switch is on, input expressions and results are
  1430. automatically factored.
  1431. <P>
  1432. <P>
  1433. <P> <H3>
  1434. examples: </H3>
  1435. <p><pre><tt>
  1436. on factor;
  1437. aa := 3*x**3*a + 6*x**2*y*a + 3*x**3*b + 6*x**2*y*b
  1438. + x*y*a + 2*y**2*a + x*y*b + 2*y**2*b;
  1439. 2
  1440. AA := (A + B)*(3*X + Y)*(X + 2*Y)
  1441. off factor;
  1442. aa;
  1443. 3 2 2 3 2
  1444. 3*A*X + 6*A*X *Y + A*X*Y + 2*A*Y + 3*B*X + 6*B*X *Y
  1445. + B*X*Y + 2*B*Y^{2}
  1446. on factor;
  1447. ab := x**2 - 2;
  1448. 2
  1449. AB := X - 2
  1450. </tt></pre><p>REDUCE factors univariate and multivariate polynomials with
  1451. integer coefficients, finding any factors that also have integer coefficients.
  1452. The factoring is done by reducing multivariate problems to univariate
  1453. ones with symbolic coefficients, and then solving the univariate ones modulo
  1454. small primes. The results of these calculations are merged to
  1455. determine the factors of the original polynomial. The factorizer normally
  1456. selects evaluation points and primes using a random number generator.
  1457. Thus, the detailed factoring behavior may be different each time any
  1458. particular problem is tackled.
  1459. <P>
  1460. <P>
  1461. When the <em>factor</em> switch is turned on, the
  1462. <a href=r38_0250.html#r38_0256>exp</a> switch is
  1463. turned off, and when the <em>factor</em> switch is turned off, the
  1464. <a href=r38_0250.html#r38_0256>exp</a> switch is turned on, whether it was on pr
  1465. eviously or not.
  1466. <P>
  1467. <P>
  1468. When the switch
  1469. <a href=r38_0300.html#r38_0335>trfac</a> is on, informative messages are generat
  1470. ed at
  1471. each call to the factorizer. The
  1472. <a href=r38_0300.html#r38_0334>trallfac</a> switch causes the
  1473. production of a more verbose trace message. It takes precedence over
  1474. <em>trfac</em> if they are both on.
  1475. <P>
  1476. <P>
  1477. To factor a polynomial explicitly and store the results, use the operator
  1478. <a href=r38_0150.html#r38_0151>factorize</a>.
  1479. <P>
  1480. <P>
  1481. <P>
  1482. <a name=r38_0288>
  1483. <title>FAILHARD</title></a>
  1484. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1485. E"></p>
  1486. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1487. <b>FAILHARD</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1488. <P>
  1489. <P>
  1490. <P>
  1491. When the <em>failhard</em> switch is on, the integration operator
  1492. <a href=r38_0150.html#r38_0154>int</a>
  1493. terminates with an error message if the integral cannot be done in closed
  1494. terms.
  1495. Default is off.
  1496. <P>
  1497. <P>
  1498. Use the <em>failhard</em> switch when you are dealing with complicated integrals
  1499. and want to know immediately if REDUCE was unable to handle them. The
  1500. integration operator sometimes returns a formal integration form that is
  1501. more complicated than the original expression, when it is unable to
  1502. complete the integration.
  1503. <P>
  1504. <P>
  1505. <P>
  1506. <a name=r38_0289>
  1507. <title>FORT</title></a>
  1508. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1509. E"></p>
  1510. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1511. <b>FORT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1512. <P>
  1513. <P>
  1514. <P>
  1515. When <em>fort</em> is on, output is given Fortran-compatible syntax. Default
  1516. is <em>off</em>.
  1517. <P>
  1518. <P>
  1519. <P> <H3>
  1520. examples: </H3>
  1521. <p><pre><tt>
  1522. on fort;
  1523. df(sin(7*x + y),x);
  1524. ANS=7.*COS(7*X+Y)
  1525. on rounded;
  1526. b := log(sin(pi/5 + n*pi));
  1527. B=LOG(SIN(3.14159265359*N+0.628318530718))
  1528. </tt></pre><p>REDUCE results can be written to a file (using
  1529. <a href=r38_0200.html#r38_0233>out</a>) and used as data
  1530. by Fortran programs when <em>fort</em> is in effect. <em>fort</em> knows about
  1531. correct statement length, continuation characters, defining a symbol when
  1532. it is first used, and other Fortran details.
  1533. <P>
  1534. <P>
  1535. The
  1536. <a href=r38_0650.html#r38_0652>GENTRAN</a> package offers many more possibilitie
  1537. s than the
  1538. <em>fort</em> switch. It produces Fortran (or C or Ratfor) code from REDUCE
  1539. procedures or structured specifications, including facilities for producing
  1540. double precision output.
  1541. <P>
  1542. <P>
  1543. <P>
  1544. <a name=r38_0290>
  1545. <title>FORTUPPER</title></a>
  1546. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1547. E"></p>
  1548. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1549. <b>FORTUPPER</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1550. <P>
  1551. <P>
  1552. <P>
  1553. When <em>fortupper</em> is on, any Fortran-style output appears in upper case.
  1554. Default is <em>off</em>.
  1555. <P>
  1556. <P>
  1557. <P> <H3>
  1558. examples: </H3>
  1559. <p><pre><tt>
  1560. on fort;
  1561. df(sin(7*x + y),x);
  1562. ans=7.*cos(7*x+y)
  1563. on fortupper;
  1564. df(sin(7*x + y),x);
  1565. ANS=7.*COS(7*X+Y)
  1566. </tt></pre><p>
  1567. <a name=r38_0291>
  1568. <title>FULLPREC</title></a>
  1569. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1570. E"></p>
  1571. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1572. <b>FULLPREC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1573. <P>
  1574. <P>
  1575. <P>
  1576. Trailing zeroes of rounded numbers to the full system precision are
  1577. normally not printed. If this information is needed, for example to get a
  1578. more understandable indication of the accuracy of certain data, the switch
  1579. <em>fullprec</em> can be turned on.
  1580. <P>
  1581. <P>
  1582. <P> <H3>
  1583. examples: </H3>
  1584. <p><pre><tt>
  1585. on rounded;
  1586. 1/2;
  1587. 0.5
  1588. on fullprec;
  1589. ws;
  1590. 0.500000000000
  1591. </tt></pre><p>This is just an output options which neither influences
  1592. the accuracy of the computation nor does it give additional
  1593. information about the precision of the results.
  1594. See also
  1595. <a href=r38_0200.html#r38_0219>scientific_notation</a>.
  1596. <P>
  1597. <P>
  1598. <P>
  1599. <a name=r38_0292>
  1600. <title>FULLROOTS</title></a>
  1601. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1602. E"></p>
  1603. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1604. <b>FULLROOTS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1605. <P>
  1606. <P>
  1607. <P>
  1608. Since roots of cubic and quartic polynomials can often be very
  1609. messy, a switch <em>fullroots</em> controls the production
  1610. of results in closed form.
  1611. <a href=r38_0150.html#r38_0179>solve</a> will apply the
  1612. formulas for explicit forms for degrees 3 and 4 only if
  1613. <em>fullroots</em> is <em>on</em>. Otherwise the result forms
  1614. are built using
  1615. <a href=r38_0150.html#r38_0176>root_of</a>. Default is <em>off</em>.
  1616. <P>
  1617. <P>
  1618. <a name=r38_0293>
  1619. <title>GC</title></a>
  1620. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1621. E"></p>
  1622. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1623. <b>GC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1624. <P>
  1625. <P>
  1626. <P>
  1627. With the <em>gc</em> switch, you can turn the garbage collection messages on
  1628. or off. The form of the message depends on the particular Lisp used for
  1629. the REDUCE implementation.
  1630. <P>
  1631. <P>
  1632. See
  1633. <a href=r38_0100.html#r38_0130>reclaim</a> for an explanation of garbage collect
  1634. ion. REDUCE does
  1635. garbage collection when needed even if you have turned the notices off.
  1636. <P>
  1637. <P>
  1638. <P>
  1639. <a name=r38_0294>
  1640. <title>GCD_switch</title></a>
  1641. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1642. E"></p>
  1643. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1644. <b>GCD</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1645. <P>
  1646. <P>
  1647. <P>
  1648. When <em>gcd</em> is on, common factors in numerators and denominators of
  1649. expressions are canceled. Default is <em>off</em>.
  1650. <P>
  1651. <P>
  1652. <P> <H3>
  1653. examples: </H3>
  1654. <p><pre><tt>
  1655. (2*(f*h)**2 - f**2*g*h - (f*g)**2 - f*h**3 + f*h*g**2
  1656. - h**4 + g*h**3)/(f**2*h - f**2*g - f*h**2 + 2*f*g*h
  1657. - f*g**2 - g*h**2 + g**2*h);
  1658. 2 2 2 2 2 2 3 3 4
  1659. F *G + F *G*H - 2*F *H - F*G *H + F*H - G*H + H
  1660. ----------------------------------------------------
  1661. 2 2 2 2 2 2
  1662. F *G - F *H + F*G - 2*F*G*H + F*H - G *H + G*H
  1663. on gcd;
  1664. ws;
  1665. 2
  1666. F*G + 2*F*H + H
  1667. ----------------
  1668. F + G
  1669. e2 := a*c + a*d + b*c + b*d;
  1670. E2 := A*C + A*D + B*C + B*D
  1671. off exp;
  1672. e2;
  1673. (A + B)*(C + D)
  1674. </tt></pre><p>Even with <em>gcd</em> off, a check is automatically made for comm
  1675. on variable
  1676. and numerical products in the numerators and denominators of expression,
  1677. and the appropriate cancellations made. Thus the example demonstrating the
  1678. use of <em>gcd</em> is somewhat complicated. Note when
  1679. <a href=r38_0250.html#r38_0256>exp</a> is off,
  1680. <em>gcd</em> has the side effect of factoring the expression.
  1681. <P>
  1682. <P>
  1683. <P>
  1684. <a name=r38_0295>
  1685. <title>HORNER</title></a>
  1686. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1687. E"></p>
  1688. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1689. <b>HORNER</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1690. <P>
  1691. <P>
  1692. <P>
  1693. When the <em>horner</em> switch is on, polynomial expressions are printed
  1694. in Horner's form for faster and safer numerical evaluation. Default
  1695. is <em>off</em>. The leading variable of the expression is selected as
  1696. Horner variable. To select the Horner variable explicitly use the
  1697. <a href=r38_0150.html#r38_0198>korder</a> declaration.
  1698. <P>
  1699. <P>
  1700. <P> <H3>
  1701. examples: </H3>
  1702. <p><pre><tt>
  1703. on horner;
  1704. (13p-4q)^3;
  1705. 3 2
  1706. ( - 64)*q + p*(624*q + p*(( - 2028)*q + p*2197))
  1707. korder q;
  1708. ws;
  1709. 3 2
  1710. 2197*p + q*(( - 2028)*p + q*(624*p + q*(-64)))
  1711. </tt></pre><p>
  1712. <a name=r38_0296>
  1713. <title>IFACTOR</title></a>
  1714. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1715. E"></p>
  1716. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1717. <b>IFACTOR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1718. <P>
  1719. <P>
  1720. <P>
  1721. When the <em>ifactor</em> switch is on, any integer terms appearing as a result
  1722. of the
  1723. <a href=r38_0150.html#r38_0151>factorize</a> command are factored themselves int
  1724. o primes. Default
  1725. is <em>off</em>. If the argument of <em>factorize</em> is an integer,
  1726. <em>ifactor</em> has no effect, since the integer is always factored.
  1727. <P>
  1728. <P>
  1729. <P> <H3>
  1730. examples: </H3>
  1731. <p><pre><tt>
  1732. factorize(4*x**2 + 28*x + 48);
  1733. {{4,1},{X + 4,1},{X + 3,1}}
  1734. factorize(22587);
  1735. {{3,1},{7529,1}}
  1736. on ifactor;
  1737. factorize(4*x**2 + 28*x + 48);
  1738. {{2,2},{X + 4,1},{X + 3,1}}
  1739. factorize(22587);
  1740. {{3,1},{7529,1}}
  1741. </tt></pre><p>Constant terms that appear within nonconstant
  1742. polynomial factors are not factored.
  1743. <P>
  1744. <P>
  1745. The <em>ifactor</em> switch affects only factoring done specifically
  1746. with
  1747. <a href=r38_0150.html#r38_0151>factorize</a>, not on factoring done automaticall
  1748. y when the
  1749. <a href=r38_0250.html#r38_0287>factor</a> switch is on.
  1750. <P>
  1751. <P>
  1752. <P>
  1753. <a name=r38_0297>
  1754. <title>INT_switch</title></a>
  1755. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1756. E"></p>
  1757. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1758. <b>INT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1759. <P>
  1760. <P>
  1761. <P>
  1762. The <em>int</em> switch specifies an interactive mode of operation. Default
  1763. <em>on</em>.
  1764. <P>
  1765. <P>
  1766. There is no reason to turn <em>int</em> off during interactive calculations,
  1767. since there are no benefits to be gained. If you do have <em>int</em> off
  1768. while inputting a file, and REDUCE finds an error, it prints the message
  1769. ``Continuing with parsing only.&quot; In this state, REDUCE accepts only
  1770. <a href=r38_0001.html#r38_0044>end</a><em>;</em> or
  1771. <a href=r38_0100.html#r38_0124>bye</a><em>;</em> from the keyboard;
  1772. everything else is ignored, even the command <em>on int</em>.
  1773. <P>
  1774. <P>
  1775. <P>
  1776. <a name=r38_0298>
  1777. <title>INTSTR</title></a>
  1778. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1779. E"></p>
  1780. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1781. <b>INTSTR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1782. <P>
  1783. <P>
  1784. <P>
  1785. If <em>intstr</em> (for ``internal structure'') is on, arguments of an
  1786. operator are printed in a more structured form.
  1787. <P>
  1788. <P>
  1789. <P> <H3>
  1790. examples: </H3>
  1791. <p><pre><tt>
  1792. operator f;
  1793. f(2x+2y);
  1794. F(2*X + 2*Y)
  1795. on intstr;
  1796. ws;
  1797. F(2*(X + Y))
  1798. </tt></pre><p>
  1799. <a name=r38_0299>
  1800. <title>LCM</title></a>
  1801. <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
  1802. E"></p>
  1803. <b><a href=r38_idx.html>INDEX</a></b><p><p>
  1804. <b>LCM</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>switch</b><P>
  1805. <P>
  1806. <P>
  1807. <P>
  1808. The <em>lcm</em> switch instructs REDUCE to compute the least common multiple
  1809. of denominators whenever rational expressions occur. Default is <em>on</em>.
  1810. <P>
  1811. <P>
  1812. <P> <H3>
  1813. examples: </H3>
  1814. <p><pre><tt>
  1815. off lcm;
  1816. z := 1/(x**2 - y**2) + 1/(x-y)**2;
  1817. 2*X*(X - Y)
  1818. Z := -------------------------
  1819. 4 3 3 4
  1820. X - 2*X *Y + 2*X*Y - Y
  1821. on lcm;
  1822. z;
  1823. 2*X*(X - Y)
  1824. -------------------------
  1825. 4 3 3 4
  1826. X - 2*X *Y + 2*X*Y - Y
  1827. zz := 1/(x**2 - y**2) + 1/(x-y)**2;
  1828. 2*X
  1829. ZZ := ---------------------
  1830. 3 2 2 3
  1831. X - X *Y - X*Y + Y
  1832. on gcd;
  1833. z;
  1834. 2*X
  1835. ----------------------
  1836. 3 2 2 3
  1837. X - X *Y - X*Y + Y
  1838. </tt></pre><p>Note that <em>lcm</em> has effect only when rational expressions a
  1839. re first
  1840. combined. It does not examine existing structures for simplifications on
  1841. display. That is shown above when z is entered with
  1842. <em>lcm</em> off. It remains unsimplified even after <em>lcm</em> is turned
  1843. back on. However, a new variable containing the same expression is
  1844. simplified on entry. The switch
  1845. <a href=r38_0050.html#r38_0086>gcd</a> does examine existing
  1846. structures, as shown in the last example line above.
  1847. <P>
  1848. <P>
  1849. Full greatest common divisor calculations become expensive if work with
  1850. large rational expressions is required. A considerable savings of time
  1851. can be had if a full gcd check is made only when denominators are combined,
  1852. and only a partial check for numerators. This is the effect of the <em>lcm</em>
  1853. switch.
  1854. <P>
  1855. <P>
  1856. <P>