12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080 |
- <a name=r38_0200>
- <title>LINEAR</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>LINEAR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- An operator can be declared linear in its first argument over powers of
- its second argument by the declaration <em>linear.</em>
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>linear</em><operator>{<em>,</em><operator>}*
- <P>
- <P>
- <P>
- <operator> must have been declared to be an operator. Be careful not
- to use a system operator name, because this command may change its definition.
- The operator being declared must have at least two arguments, and the
- second one must be a
- <a href=r38_0001.html#r38_0002>kernel</a>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- operator f;
- linear f;
- f(0,x);
- 0
- f(-y,x);
- - F(1,X)*Y
- f(y+z,x);
- F(1,X)*(Y + Z)
- f(y*z,x);
- F(1,X)*Y*Z
- depend z,x;
- f(y*z,x);
- F(Z,X)*Y
- f(y/z,x);
- 1
- F(-,X)*Y
- Z
- depend y,x;
- f(y/z,x);
- Y
- F(-,X)
- Z
- nodepend z,x;
- f(y/z,x);
- F(Y,X)
- ------
- Z
- f(2*e**sin(x),x);
- SIN(X)
- 2*F(E ,X)
- </tt></pre><p>Even when the operator has not had its functionality attached, it
- exhibits
- linear properties as shown in the examples. Notice the difference when
- dependencies are added. Dependencies are also in effect when the operator's
- first argument contains its second, as in the last line above.
- <P>
- <P>
- For a fully-developed example of the use of linear operators, refer to the
- article in the <Journal of Computational Physics>, Vol. 14 (1974), pp.
- 301-317, ``Analytic Computation of Some Integrals in Fourth Order Quantum
- Electrodynamics," by J.A. Fox and A.C. Hearn. The article includes the
- complete listing of REDUCE procedures used for this work.
- <P>
- <P>
- <P>
- <a name=r38_0201>
- <title>LINELENGTH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>LINELENGTH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>linelength</em> declaration sets the length of the output line. Default
- is 80.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>linelength</em><expression>
- <P>
- <P>
- <P>
- To change the linelength,
- <expression> must evaluate to a positive integer less than 128
- (although this varies from system to system), and should not be less than
- 20 or so for proper operation.
- <P>
- <P>
- <em>linelength</em>returns the previous linelength. If you want the current
- linelength value, but not change it, say <em>linelength nil</em>.
- <P>
- <P>
- <P>
- <a name=r38_0202>
- <title>LISP</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>LISP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- The <em>lisp</em> command changes REDUCE's mode of operation to symbolic. When
- <em>lisp</em> is followed by an expression, that expression is evaluated in
- symbolic mode, but REDUCE's mode is not changed. This command is
- equivalent to
- <a href=r38_0200.html#r38_0221>symbolic</a>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- lisp;
- NIL
- car '(a b c d e);
- A
- algebraic;
- c := (lisp car '(first second))**2;
-
- 2
- C := FIRST
- </tt></pre><p>
- <a name=r38_0203>
- <title>LISTARGP</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>LISTARGP</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>listargp</em><operator>{<em>,</em><operator>}*
- <P>
- <P>
- <P>
- If an operator other than those specifically defined for lists is given a
- single argument that is a
- <a href=r38_0050.html#r38_0053>list</a>, then the result of this
- operation will be a list in which that operator is applied to each element
- of the list.
- This process can be inhibited for a specific operator, or list of operators,
- by using the declaration <em>listargp</em>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- log {a,b,c};
- LOG(A),LOG(B),LOG(C)
- listargp log;
- log {a,b,c};
- LOG(A,B,C)
- </tt></pre><p>It is possible to inhibit such distribution globally by turning on
- the
- switch
- <a href=r38_0300.html#r38_0303>listargs</a>. In addition, if an operator has mor
- e than one
- argument, no such distribution occurs, so <em>listargp</em> has no effect.
- <P>
- <P>
- <P>
- <a name=r38_0204>
- <title>NODEPEND</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>NODEPEND</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>nodepend</em> declaration removes the dependency declared with
- <a href=r38_0150.html#r38_0192>depend</a>.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>nodepend</em><dep-kernel>{,<kernel>}+
- <P>
- <P>
- <P>
- <P>
- <dep-kernel> must be a kernel that has had a dependency declared upon the
- one or more other kernels that are its other arguments.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- depend y,x,z;
- df(sin y,x);
- COS(Y)*DF(Y,X)
- df(sin y,x,z);
- COS(Y)*DF(Y,X,Z) - DF(Y,X)*DF(Y,Z)*SIN(Y)
- nodepend y,z;
- df(sin y,x);
- COS(Y)*DF(Y,X)
- df(sin y,x,z);
- 0
- </tt></pre><p>A warning message is printed if the dependency had not been declar
- ed by
- <em>depend</em>.
- <P>
- <P>
- <P>
- <a name=r38_0205>
- <title>MATCH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>MATCH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>match</em> command is similar to the
- <a href=r38_0150.html#r38_0199>let</a> command, except
- that it matches only explicit powers in substitution.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>match</em><expr> <em>=</em> <expression>{,<expr>
- <em>=</em><expression>}*
- <P>
- <P>
- <P>
- <expr> is generally a term involving powers, and is limited by
- the rules for the
- <a href=r38_0150.html#r38_0199>let</a> command. <expression> may be
- any valid REDUCE scalar expression.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- match c**2*a**2 = d;
- (a+c)**4;
- 4 3 3 4
- A + 4*A *C + 4*A*C + C + 6*D
- match a+b = c;
- a + 2*b;
- B + C
- (a + b + c)**2;
- 2 2 2
- A - B + 2*B*C + 3*C
- clear a+b;
- (a + b + c)**2;
- 2 2 2
- A + 2*A*B + 2*A*C + B + 2*B*C + C
- let p*r = s;
- match p*q = ss;
- (a + p*r)**2;
- 2 2
- A + 2*A*S + S
- (a + p*q)**2;
- 2 2 2
- A + 2*A*SS + P *Q
- </tt></pre><p>Note in the last example that <em>a + b</em> has been explicitly m
- atched
- after the squaring was done, replacing each single power of <em>a</em> by
- <em>c - b</em>. This kind of substitution, although following the rules, is
- confusing and could lead to unrecognizable results. It is better to use
- <em>match</em> with explicit powers or products only. <em>match</em> should
- not be used inside procedures for the same reasons that <em>let</em> should
- not be.
- <P>
- <P>
- Unlike
- <a href=r38_0150.html#r38_0199>let</a> substitutions, <em>match</em> substitutio
- ns are executed
- after all other operations are complete. The last example shows the
- difference. <em>match</em> commands can be cleared by using
- <a href=r38_0150.html#r38_0189>clear</a>,
- with exactly the expression that the original <em>match</em> took.
- <em>match</em> commands can also be done more generally with <em>for all</em>
- or
- <a href=r38_0150.html#r38_0195>forall</a>...<em>such that</em> commands.
- <P>
- <P>
- <P>
- <a name=r38_0206>
- <title>NONCOM</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>NONCOM</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <em>noncom</em>declares that already-declared operators are noncommutative
- under multiplication.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>noncom</em><operator>{,<operator>}*
- <P>
- <P>
- <P>
- <operator> must have been declared an
- <a href=r38_0200.html#r38_0211>operator</a>, or a warning
- message is given.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- operator f,h;
- noncom f;
- f(a)*f(b) - f(b)*f(a);
- F(A)*F(B) - F(B)*F(A)
- h(a)*h(b) - h(b)*h(a);
- 0
- operator comm;
- for all x,y such that x neq y and ordp(x,y)
- let f(x)*f(y) = f(y)*f(x) + comm(x,y);
- f(1)*f(2);
- F(1)*F(2)
- f(2)*f(1);
- COMM(2,1) + F(1)*F(2)
- </tt></pre><p>The last example introduces the commutator of f(x) and f(y)
- for all x and y. The equality check is to prevent an infinite loop. The
- operator f can have other functionality attached to it if desired, or it
- can remain an indeterminate operator.
- <P>
- <P>
- <P>
- <a name=r38_0207>
- <title>NONZERO</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>NONZERO</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>nonzero</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- If an
- <a href=r38_0200.html#r38_0211>operator</a> <em>f</em> is declared
- <a href=r38_0200.html#r38_0208>odd</a>, then <em>f(0)</em>
- is replaced by zero unless <em>f</em> is also declared non zero by the
- declaration <em>nonzero</em>.
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- odd f;
- f(0)
- 0
- nonzero f;
- f(0)
- F(0)
- </tt></pre><p><P>
- <P>
- <a name=r38_0208>
- <title>ODD</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ODD</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>odd</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- This declaration is used to declare an operator odd in its first
- argument. Expressions involving an operator declared in this manner are
- transformed if the first argument contains a minus sign. Any other
- arguments are not affected.
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- odd f;
- f(-a)
- -F(A)
- f(-a,-b)
- -F(A,-B)
- f(a,-b)
- F(A,-B)
- </tt></pre><p><P>
- <P>
- If say <em>f</em> is declared odd, then <em>f(0)</em> is replaced by zero
- unless <em>f</em> is also declared non zero by the declaration
- <a href=r38_0200.html#r38_0207>nonzero</a>.
- <P>
- <P>
- <P>
- <a name=r38_0209>
- <title>OFF</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>OFF</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>off</em> command is used to turn switches off.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>off</em><switch>{,<switch>}*
- <P>
- <P>
- <P>
- <switch> can be any <em>switch</em> name. There is no problem if the
- switch is already off. If the switch name is mistyped, an error message is
- given.
- <P>
- <P>
- <a name=r38_0210>
- <title>ON</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ON</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>on</em> command is used to turn switches on.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>on</em><switch>{,<switch>}*
- <P>
- <P>
- <P>
- <switch> can be any <em>switch</em> name. There is no problem if the
- switch is already on. If the switch name is mistyped, an error message is
- given.
- <P>
- <P>
- <a name=r38_0211>
- <title>OPERATOR</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>OPERATOR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- Use the <em>operator</em> declaration to declare your own operators.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>operator</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <identifier> can be any valid REDUCE identifier, which is not the name
- of a
- <a href=r38_0300.html#r38_0345>matrix</a>,
- <a href=r38_0150.html#r38_0188>array</a>, scalar variable or previously-defined
- operator.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- operator dis,fac;
- let dis(~x,~y) = sqrt(x^2 + y^2);
- dis(1,2);
- SQRT(5)
- dis(a,10);
- 2
- SQRT(A + 100)
- on rounded;
- dis(1.5,7.2);
- 7.35459040329
- let fac(~n) = if n=0 then 1
- else if not(fixp n and n>0)
- then rederr "choose non-negative integer"
- else for i := 1:n product i;
-
- fac(5);
- 120
- fac(-2);
- ***** choose non-negative integer
- </tt></pre><p>The first operator is the Euclidean distance metric, the distance
- of point
- (x,y) from the origin. The second operator is the factorial.
- <P>
- <P>
- Operators can have various properties assigned to them; they can be
- declared
- <a href=r38_0150.html#r38_0196>infix</a>,
- <a href=r38_0200.html#r38_0200>linear</a>,
- <a href=r38_0200.html#r38_0222>symmetric</a>,
- <a href=r38_0150.html#r38_0187>antisymmetric</a>, or
- <a href=r38_0200.html#r38_0206>noncom</a><em>mutative</em>.
- The default operator is prefix, nonlinear, and commutative.
- Precedence can also be assigned to operators using the declaration
- <a href=r38_0200.html#r38_0213>precedence</a>.
- <P>
- <P>
- Functionality is assigned to an operator by a
- <a href=r38_0150.html#r38_0199>let</a> statement or
- a
- <a href=r38_0150.html#r38_0195>forall</a>...<em>let</em> statement,
- (or possibly by a procedure with the name
- of the operator). Be careful not to redefine a system operator by
- accident. REDUCE permits you to redefine system operators, giving you a
- warning message that the operator was already defined. This flexibility
- allows you to add mathematical rules that do what you want them to do, but
- can produce odd or erroneous behavior if you are not careful.
- <P>
- <P>
- You can declare operators from inside
- <a href=r38_0050.html#r38_0055>procedure</a>s, as long as they
- are not local variables. Operators defined inside procedures are global.
- A formal parameter may be declared as an operator, and has the effect of
- declaring the calling variable as the operator.
- <P>
- <P>
- <P>
- <a name=r38_0212>
- <title>ORDER</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ORDER</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>order</em> declaration changes the order of precedence of kernels for
- display purposes only.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>order</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <kernel> must be a valid
- <a href=r38_0001.html#r38_0002>kernel</a> or
- <a href=r38_0200.html#r38_0211>operator</a> name
- complete with argument or a
- <a href=r38_0050.html#r38_0053>list</a> of such objects.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- x + y + z + cos(a);
- COS(A) + X + Y + Z
- order z,y,x,cos(a);
- x + y + z + cos(a);
- Z + Y + X + COS(A)
- (x + y)**2;
- 2 2
- Y + 2*Y*X + X
- order nil;
- (z + cos(z))**2;
- 2 2
- COS(Z) + 2*COS(Z)*Z + Z
- </tt></pre><p><em>order</em>affects the printing order of the identifiers only;
- internal
- order is unchanged. Change internal order of evaluation with the
- declaration
- <a href=r38_0150.html#r38_0198>korder</a>. You can use <em>order</em> to feature
- variables
- or functions you are particularly interested in.
- <P>
- <P>
- Declarations made with <em>order</em> are cumulative: kernels in new order
- declarations are ordered behind those in previous declarations, and
- previous declarations retain their relative order. Of course, specific
- kernels named in new declarations are removed from previous ones and given
- the new priority. Return to the standard canonical printing order with the
- statement <em>order nil</em>.
- <P>
- <P>
- The print order specified by <em>order</em> commands is not in effect if the
- switch
- <a href=r38_0300.html#r38_0319>pri</a> is off.
- <P>
- <P>
- <P>
- <a name=r38_0213>
- <title>PRECEDENCE</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>PRECEDENCE</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>precedence</em> declaration attaches a precedence to an infix operator.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>precedence</em><operator>,<known\_operator>
- <P>
- <P>
- <P>
- <operator> should have been declared an operator but may be a REDUCE
- identifier that is not already an operator, array, or matrix.
- <known\_operator> must be a system infix operator or have had its
- precedence already declared.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- operator f,h;
- precedence f,+;
- precedence h,*;
- a + f(1,2)*c;
- (1 F 2)*C + A
- a + h(1,2)*c;
- 1 H 2*C + A
- a*1 f 2*c;
- A F 2*C
- a*1 h 2*c;
- 1 H 2*A*C
- </tt></pre><p>The operator whose precedence is being declared is inserted into t
- he infix
- operator precedence list at the next higher place than <known\_operator>.
- <P>
- <P>
- Attaching a precedence to an operator has the side effect of declaring the
- operator to be infix. If the identifier argument for <em>precedence</em> has
- not been declared to be an operator, an attempt to use it causes an error
- message. After declaring it to be an operator, it becomes an infix operator
- with the precedence previously given. Infix operators may be used in prefix
- form; if they are used in infix form, a space must be left on each side of
- the operator to avoid ambiguity. Declared infix operators are always binary.
- <P>
- <P>
- To see the infix operator precedence list, enter symbolic mode and type
- <em>preclis!*;</em>. The lowest precedence operator is listed first.
- <P>
- <P>
- All prefix operators have precedence higher than infix operators.
- <P>
- <P>
- <P>
- <a name=r38_0214>
- <title>PRECISION</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>PRECISION</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>precision</em> declaration sets the number of decimal places used when
- <a href=r38_0300.html#r38_0330>rounded</a> is on. Default is system dependent, a
- nd normally about 12.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>precision</em>(<integer>) or <em>precision</em> <integer>
- <P>
- <P>
- <P>
- <integer> must be a positive integer. When <integer> is 0, the
- current precision is displayed, but not changed. There is no upper limit,
- but precision of greater than several hundred causes unpleasantly slow
- operation on numeric calculations.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- on rounded;
- 7/9;
- 0.777777777778
- precision 20;
- 20
- 7/9;
- 0.77777777777777777778
- sin(pi/4);
- 0.7071067811865475244
- </tt></pre><p>Trailing zeroes are dropped, so sometimes fewer than 20 decimal pl
- aces are
- printed as in the last example. Turn on the switch
- <a href=r38_0250.html#r38_0291>fullprec</a> if
- you want to print all significant digits. The
- <a href=r38_0300.html#r38_0330>rounded</a> mode
- carries calculations to two more places than given by <em>precision</em>, and
- rounds off.
- <P>
- <P>
- <P>
- <a name=r38_0215>
- <title>PRINT_PRECISION</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>PRINT\_PRECISION</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>print_precision</em>(<integer>)
- or <em>print_precision</em> <integer>
- <P>
- <P>
- <P>
- In
- <a href=r38_0300.html#r38_0330>rounded</a> mode, numbers are normally printed to
- the specified
- precision. If the user wishes to print such numbers with less precision,
- the printing precision can be set by the declaration <em>print_precision</em>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- on rounded;
- 1/3;
- 0.333333333333
- print_precision 5;
- 1/3
- 0.33333
- </tt></pre><p>
- <a name=r38_0216>
- <title>REAL</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>REAL</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- The <em>real</em> declaration must be made immediately after a
- <a href=r38_0001.html#r38_0040>begin</a> (or other variable declaration such as
- <a href=r38_0150.html#r38_0197>integer</a>
- and
- <a href=r38_0200.html#r38_0218>scalar</a>) and declares local integer variables.
- They are
- initialized to zero.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>real</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <identifier> may be any valid REDUCE identifier, except
- <em>t</em> or <em>nil</em>.
- <P>
- <P>
- Real variables remain local, and do not share values with variables of the
- same name outside the
- <a href=r38_0001.html#r38_0040>begin</a>...<em>end</em> block. When the
- block is finished, the variables are removed. You may use the words
- <a href=r38_0150.html#r38_0197>integer</a> or
- <a href=r38_0200.html#r38_0218>scalar</a> in the place of <em>real</em>.
- <em>real</em> does not indicate typechecking by the current REDUCE; it is
- only for your own information. Declaration statements must immediately
- follow the <em>begin</em>, without a semicolon between <em>begin</em> and the
- first variable declaration.
- <P>
- <P>
- Any variables used inside a <em>begin</em>...<em>end</em>
- <a href=r38_0001.html#r38_0041>block</a>
- that were not declared <em>scalar</em>, <em>real</em> or <em>integer</em> are
- global, and any change made to them inside the block affects their global
- value. Any
- <a href=r38_0150.html#r38_0188>array</a> or
- <a href=r38_0300.html#r38_0345>matrix</a> declared inside a block is always
- global.
- <P>
- <P>
- <P>
- <a name=r38_0217>
- <title>REMFAC</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>REMFAC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>remfac</em> declaration removes the special factoring treatment of its
- arguments that was declared with
- <a href=r38_0250.html#r38_0287>factor</a>.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>remfac</em><kernel>{,<kernel>}+
- <P>
- <P>
- <P>
- <kernel> must be a
- <a href=r38_0001.html#r38_0002>kernel</a> or
- <a href=r38_0200.html#r38_0211>operator</a> name that
- was declared as special with the
- <a href=r38_0250.html#r38_0287>factor</a> declaration.
- <P>
- <P>
- <a name=r38_0218>
- <title>SCALAR</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SCALAR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- The <em>scalar</em> declaration must be made immediately after a
- <a href=r38_0001.html#r38_0040>begin</a> (or other variable declaration such as
- <a href=r38_0150.html#r38_0197>integer</a>
- and
- <a href=r38_0200.html#r38_0216>real</a>) and declares local scalar variables. Th
- ey are
- initialized to 0.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>scalar</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <identifier> may be any valid REDUCE identifier, except <em>t</em> or
- <em>nil</em>.
- <P>
- <P>
- Scalar variables remain local, and do not share values with variables of
- the same name outside the
- <a href=r38_0001.html#r38_0040>begin</a>...<em>end</em>
- <a href=r38_0001.html#r38_0041>block</a>.
- When the block is finished, the variables are removed. You may use the
- words
- <a href=r38_0200.html#r38_0216>real</a> or
- <a href=r38_0150.html#r38_0197>integer</a> in the place of <em>scalar</em>.
- <em>real</em> and <em>integer</em> do not indicate typechecking by the current
- REDUCE; they are only for your own information. Declaration statements
- must immediately follow the <em>begin</em>, without a semicolon between
- <em>begin</em> and the first variable declaration.
- <P>
- <P>
- Any variables used inside <em>begin</em>...<em>end</em> blocks that were not
- declared <em>scalar</em>, <em>real</em> or <em>integer</em> are global, and any
- change made to them inside the block affects their global value. Arrays
- declared inside a block are always global.
- <P>
- <P>
- <P>
- <a name=r38_0219>
- <title>SCIENTIFIC_NOTATION</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SCIENTIFIC\_NOTATION</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>scientific_notation</em>(<m>) or
- <em>scientific_notation</em>({<m>,<n>})
- <P>
- <P>
- <P>
- <m> and <n> are positive integers.
- <em>scientific_notation</em> controls the output format of floating point
- numbers. At the default settings, any number with five or less digits
- before the decimal point is printed in a fixed-point notation, e.g.,
- 12345.6. Numbers with more than five digits are printed in scientific
- notation, e.g., 1.234567E+5. Similarly, by default, any number with
- eleven or more zeros after the decimal point is printed in scientific
- notation.
- <P>
- <P>
- When <em>scientific_notation</em> is called with the numerical argument
- m a number with more than m digits before the decimal point,
- or m or more zeros after the decimal point, is printed in scientific
- notation. When <em>scientific_notation</em> is called with a list
- {<m>,<n>}, a number with more than m digits before the
- decimal point, or n or more zeros after the decimal point is
- printed in scientific notation.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- on rounded;
- 12345.6;
- 12345.6
- 123456.5;
- 1.234565e+5
- 0.00000000000000012;
- 1.2e-16
- scientific_notation 20;
- 5,11
- 5: 123456.7;
- 123456.7
- 0.00000000000000012;
- 0.00000000000000012
- </tt></pre><p>
- <a name=r38_0220>
- <title>SHARE</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SHARE</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- The <em>share</em> declaration allows access to its arguments by both
- algebraic and symbolic modes.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>share</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <identifier> can be any valid REDUCE identifier.
- <P>
- <P>
- Programming in
- <a href=r38_0200.html#r38_0221>symbolic</a> as well as algebraic mode allows
- you a wider range
- of techniques than just algebraic mode alone. Expressions do not cross the
- boundary since they have different representations, unless the <em>share</em>
- declaration is used. For more information on using symbolic mode, see
- the <REDUCE User's Manual>, and the <Standard Lisp Report>.
- <P>
- <P>
- You should be aware that a previously-declared array is destroyed by the
- <em>share</em> declaration. Scalar variables retain their values. You can
- share a declared
- <a href=r38_0300.html#r38_0345>matrix</a> that has not yet
- been dimensioned so that it can be
- used by both modes. Values that are later put into the matrix are
- accessible from symbolic mode too, but not by the usual matrix reference
- mechanism. In symbolic mode, a matrix is stored as a list whose first
- element is
- <a href=r38_0300.html#r38_0343>MAT</a>, and whose next elements are the rows of
- the matrix
- stored as lists of the individual elements. Access in symbolic mode is by
- the operators
- <a href=r38_0001.html#r38_0046>first</a>,
- <a href=r38_0050.html#r38_0063>second</a>,
- <a href=r38_0050.html#r38_0066>third</a> and
- <a href=r38_0050.html#r38_0057>rest</a>.
- <P>
- <P>
- <P>
- <a name=r38_0221>
- <title>SYMBOLIC</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SYMBOLIC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- The <em>symbolic</em> command changes REDUCE's mode of operation to symbolic.
- When <em>symbolic</em> is followed by an expression, that expression is
- evaluated in symbolic mode, but REDUCE's mode is not changed. It is
- equivalent to the
- <a href=r38_0200.html#r38_0202>lisp</a> command.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- symbolic;
- NIL
- cdr '(a b c);
- (B C)
- algebraic;
- x + symbolic car '(y z);
- X + Y
- </tt></pre><p>
- <a name=r38_0222>
- <title>SYMMETRIC</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SYMMETRIC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- When an operator is declared <em>symmetric</em>, its arguments are reordered
- to conform to the internal ordering of the system.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>symmetric</em><identifier>{,<identifier>}*
- <P>
- <P>
- <P>
- <identifier> is an identifier that has been declared an operator.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- operator m,n;
- symmetric m,n;
- m(y,a,sin(x));
- M(SIN(X),A,Y)
- n(z,m(b,a,q));
- N(M(A,B,Q),Z)
- </tt></pre><p>If <identifier> has not been declared to be an operator, the
- flag
- <em>symmetric</em> is still attached to it. When <identifier> is
- subsequently used as an operator, the message <em>Declare</em><identifier>
-
- <em>operator ? (Y or N)</em> is printed. If the user replies <em>y</em>, the
- symmetric property of the operator is used.
- <P>
- <P>
- <P>
- <a name=r38_0223>
- <title>TR</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>TR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>tr</em> declaration is used to trace system or user-written procedures.
- It is only useful to those with a good knowledge of both Lisp and the
- internal formats used by REDUCE.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>tr</em><name>{,<name>}*
- <P>
- <P>
- <P>
- <name> is the name of a REDUCE system procedure or one of your own
- procedures.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt></tt></pre><p>The system procedure <em>prepsq</em> is traced,
- which prepares REDUCE standard
- forms for printing by converting them to a Lisp prefix form.<p><pre><tt>
- tr prepsq;
- (PREPSQ)
- x**2 + y;
- PREPSQ entry:
- Arg 1: (((((X . 2) . 1) ((Y . 1) . 1)) . 1)
- PREPSQ return value = (PLUS (EXPT X 2) Y)
- PREPSQ entry:
- Arg 1: (1 . 1)
- PREPSQ return value = 1
- 2
- X + Y
- untr prepsq;
- (PREPSQ)
- </tt></pre><p>
- <P>
- <P>
- This example is for a PSL-based system; the above format will vary if
- other Lisp systems are used.
- <P>
- <P>
- When a procedure is traced, the first lines show entry to the procedure and
- the arguments it is given. The value returned by the procedure is printed
- upon exit. If you are tracing several procedures, with a call to one of
- them inside the other, the inner trace will be indented showing procedure
- nesting. There are no trace options. However, the format of the trace
- depends on the underlying Lisp system used. The trace can be removed with
- the command
- <a href=r38_0200.html#r38_0224>untr</a>. Note that <em>trace</em>, below, is a m
- atrix
- operator, while <em>tr</em> does procedure tracing.
- <P>
- <P>
- <P>
- <a name=r38_0224>
- <title>UNTR</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>UNTR</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- <P>
- <P>
- The <em>untr</em> declaration is used to remove a trace from system or
- user-written procedures declared with
- <a href=r38_0200.html#r38_0223>tr</a>. It is only useful to
- those with a good knowledge of both Lisp and the internal formats used by
- REDUCE.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>untr</em><name>{,<name>}*
- <P>
- <P>
- <P>
- <name> is the name of a REDUCE system procedure or one of your own
- procedures that has previously been the argument of a <em>tr</em>
- declaration.
- <P>
- <P>
- <a name=r38_0225>
- <title>VARNAME</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>VARNAME</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>declaration</b><P>
- <P>
-
- The declaration <em>varname</em> instructs REDUCE to use its argument as the
- default Fortran (when
- <a href=r38_0250.html#r38_0289>fort</a> is on) or
- <a href=r38_0150.html#r38_0181>structr</a> identifier
- and identifier stem, rather than using <em>ANS</em>.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>varname</em><identifier>
- <P>
- <P>
- <P>
- <identifier> can be any combination of one or more alphanumeric
- characters. Try to avoid REDUCE reserved words.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- varname ident;
- IDENT
- on fort;
- x**2 + 1;
- IDENT=X**2+1.
- off fort,exp;
- structr(((x+y)**2 + z)**3);
- 3
- IDENT2
- where
- 2
- IDENT2 := IDENT1 + Z
- IDENT1 := X + Y
- </tt></pre><p>
- <a href=r38_0250.html#r38_0284>exp</a>was turned off so that
- <a href=r38_0150.html#r38_0181>structr</a> could show the
- structure. If <em>exp</em> had been on, the expression would have been
- expanded into a polynomial.
- <P>
- <P>
- <P>
- <a name=r38_0226>
- <title>WEIGHT</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>WEIGHT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- The <em>weight</em> command is used to attach weights to kernels for asymptotic
- constraints.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>weight</em><kernel> <em>=</em><number>
- <P>
- <P>
- <P>
- <kernel> must be a REDUCE
- <a href=r38_0001.html#r38_0002>kernel</a>, <number> must be a
- positive integer, not 0.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- a := (x+y)**4;
- 4 3 2 2 3 4
- A := X + 4*X *Y + 6*X *Y + 4*X*Y + Y
- weight x=2,y=3;
- wtlevel 8;
- a;
- 4
- X
- wtlevel 10;
- a;
- 2 2 2
- X *(6*Y + 4*X*Y + X )
- int(x**2,x);
- ***** X invalid as KERNEL
- </tt></pre><p>Weights and
- <a href=r38_0200.html#r38_0229>wtlevel</a> are used for asymptotic constraints,
- where
- higher-order terms are considered insignificant.
- <P>
- <P>
- Weights are originally equivalent to 0 until set by a <em>weight</em>
- command. To remove a weight from a kernel, use the
- <a href=r38_0150.html#r38_0189>clear</a>
- command. Weights once assigned cannot be changed without clearing the
- identifier. Once a weight is assigned to a kernel, it is no longer a
- kernel and cannot be used in any REDUCE commands or operators that require
- kernels, until the weight is cleared. Note that terms are ordered by
- greatest weight.
- <P>
- <P>
- The weight level of the system is set by
- <a href=r38_0200.html#r38_0229>wtlevel</a>, initially at
- 2. Since no kernels have weights, no effect from <em>wtlevel</em> can be
- seen. Once you assign weights to kernels, you must set <em>wtlevel</em>
- correctly for the desired operation. When weighted variables appear in a
- term, their weights are summed for the total weight of the term (powers of
- variables multiply their weights). When a term exceeds the weight level
- of the system, it is discarded from the result expression.
- <P>
- <P>
- <P>
- <a name=r38_0227>
- <title>WHERE</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>WHERE</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>where</em> operator provides an infix notation for one-time
- substitutions for kernels in expressions.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <expression> <em>where</em> <kernel>
- <em>=</em><expression>
- {,<kernel> <em>=</em><expression>}*
- <P>
- <P>
- <P>
- <expression> can be any REDUCE scalar expression, <kernel> must
- be a
- <a href=r38_0001.html#r38_0002>kernel</a>. Alternatively a
- <a href=r38_0050.html#r38_0060>rule</a> or a <em>rule list</em>
- can be a member of the right-hand part of a <em>where</em> expression.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- x**2 + 17*x*y + 4*y**2 where x=1,y=2;
- 51
- for i := 1:5 collect x**i*q where q= for j := 1:i product j;
-
- 2 3 4 5
- {X,2*X ,6*X ,24*X ,120*X }
- x**2 + y + z where z=y**3,y=3;
- 2 3
- X + Y + 3
- </tt></pre><p>Substitution inside a <em>where</em> expression has no effect upon
- the values
- of the kernels outside the expression. The <em>where</em> operator has the
- lowest precedence of all the infix operators, which are lower than prefix
- operators, so that the substitutions apply to the entire expression
- preceding the <em>where</em> operator. However, <em>where</em> is applied
- before command keywords such as <em>then</em>, <em>repeat</em>, or <em>do</em>.
- <P>
- <P>
- A
- <a href=r38_0050.html#r38_0060>rule</a> or a <em>rule set</em> in the right-hand
- part of the
- <em>where</em> expression act as if the rules were activated by
- <a href=r38_0150.html#r38_0199>let</a>
- immediately before the evaluation of the expression and deactivated
- by
- <a href=r38_0150.html#r38_0190>clearrules</a> immediately afterwards.
- <P>
- <P>
- <em>where</em>gives you a natural notation for auxiliary variables in
- expressions. As the second example shows, the substitute expression can be
- a command to be evaluated. The substitute assignments are made in
- parallel, rather than sequentially, as the last example shows. The
- expression resulting from the first round of substitutions is not
- reexamined to see if any further such substitutions can be made.
- <em>where</em> can also be used to define auxiliary variables in
- <a href=r38_0050.html#r38_0055>procedure</a> definitions.
- <P>
- <P>
- <P>
- <a name=r38_0228>
- <title>WHILE</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>WHILE</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>while</em> command causes a statement to be repeatedly executed until a
- given condition is true. If the condition is initially false, the statement
- is not executed at all.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>while</em><condition> <em>do</em> <statement>
- <P>
- <P>
- <P>
- <condition> is given by a logical operator, <statement> must be a
- single REDUCE statement, or a
- <a href=r38_0001.html#r38_0038>group</a> (<em><<</em>...<em>>></em>)
- or
- <a href=r38_0001.html#r38_0040>begin</a>...<em>end</em>
- <a href=r38_0001.html#r38_0041>block</a>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- a := 10;
- A := 10
- while a <= 12 do <<write a; a := a + 1>>;
-
- 10
- 11
- 12
- while a < 5 do <<write a; a := a + 1>>;
-
- nothing is printed
- </tt></pre><p>
- <a name=r38_0229>
- <title>WTLEVEL</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>WTLEVEL</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- In conjunction with
- <a href=r38_0200.html#r38_0226>weight</a>, <em>wtlevel</em> is used to implement
-
- asymptotic constraints. Its default value is 2.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>wtlevel</em><expression>
- <P>
- <P>
- <P>
- To change the weight level, <expression> must evaluate to a positive
- integer that is the greatest weight term to be retained in expressions
- involving kernels with weight assignments. <em>wtlevel</em> returns the
- new weight level. If you want the current weight level, but not
- change it, say <em>wtlevel nil</em>.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- (x+y)**4;
-
- 4 3 2 2 3 4
- X + 4*X *Y + 6*X *Y + 4*X*Y + Y
- weight x=2,y=3;
- wtlevel 8;
- (x+y)**4;
- 4
- X
- wtlevel 10;
- (x+y)**4;
- 2 2 2
- X *(6*Y + 4*X*Y + X )
- int(x**2,x);
- ***** X invalid as KERNEL
- </tt></pre><p><em>wtlevel</em>is used in conjunction with the command
- <a href=r38_0200.html#r38_0226>weight</a> to
- enable asymptotic constraints. Weight of a term is computed by multiplying
- the weights of each variable in it by the power to which it has been
- raised, and adding the resulting weights for each variable. If the weight
- of the term is greater than <em>wtlevel</em>, the term is dropped from the
- expression, and not used in any further computation involving the
- expression.
- <P>
- <P>
- Once a weight has been attached to a
- <a href=r38_0001.html#r38_0002>kernel</a>, it is no longer
- recognized by the system as a kernel, though still a variable. It cannot
- be used in REDUCE commands and operators that need kernels. The weight
- attachment can be undone with a
- <a href=r38_0150.html#r38_0189>clear</a> command. <em>wtlevel</em> can
- be changed as desired.
- <P>
- <P>
- <P>
- <a name=r38_0230>
- <title>Declarations</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>Declarations</b><menu>
- <li><a href=r38_0150.html#r38_0186>ALGEBRAIC command</a><P>
- <li><a href=r38_0150.html#r38_0187>ANTISYMMETRIC declaration</a><P>
- <li><a href=r38_0150.html#r38_0188>ARRAY declaration</a><P>
- <li><a href=r38_0150.html#r38_0189>CLEAR command</a><P>
- <li><a href=r38_0150.html#r38_0190>CLEARRULES command</a><P>
- <li><a href=r38_0150.html#r38_0191>DEFINE command</a><P>
- <li><a href=r38_0150.html#r38_0192>DEPEND declaration</a><P>
- <li><a href=r38_0150.html#r38_0193>EVEN declaration</a><P>
- <li><a href=r38_0150.html#r38_0194>FACTOR declaration</a><P>
- <li><a href=r38_0150.html#r38_0195>FORALL command</a><P>
- <li><a href=r38_0150.html#r38_0196>INFIX declaration</a><P>
- <li><a href=r38_0150.html#r38_0197>INTEGER declaration</a><P>
- <li><a href=r38_0150.html#r38_0198>KORDER declaration</a><P>
- <li><a href=r38_0150.html#r38_0199>LET command</a><P>
- <li><a href=r38_0200.html#r38_0200>LINEAR declaration</a><P>
- <li><a href=r38_0200.html#r38_0201>LINELENGTH declaration</a><P>
- <li><a href=r38_0200.html#r38_0202>LISP command</a><P>
- <li><a href=r38_0200.html#r38_0203>LISTARGP declaration</a><P>
- <li><a href=r38_0200.html#r38_0204>NODEPEND declaration</a><P>
- <li><a href=r38_0200.html#r38_0205>MATCH command</a><P>
- <li><a href=r38_0200.html#r38_0206>NONCOM declaration</a><P>
- <li><a href=r38_0200.html#r38_0207>NONZERO declaration</a><P>
- <li><a href=r38_0200.html#r38_0208>ODD declaration</a><P>
- <li><a href=r38_0200.html#r38_0209>OFF command</a><P>
- <li><a href=r38_0200.html#r38_0210>ON command</a><P>
- <li><a href=r38_0200.html#r38_0211>OPERATOR declaration</a><P>
- <li><a href=r38_0200.html#r38_0212>ORDER declaration</a><P>
- <li><a href=r38_0200.html#r38_0213>PRECEDENCE declaration</a><P>
- <li><a href=r38_0200.html#r38_0214>PRECISION declaration</a><P>
- <li><a href=r38_0200.html#r38_0215>PRINT\_PRECISION declaration</a><P>
- <li><a href=r38_0200.html#r38_0216>REAL declaration</a><P>
- <li><a href=r38_0200.html#r38_0217>REMFAC declaration</a><P>
- <li><a href=r38_0200.html#r38_0218>SCALAR declaration</a><P>
- <li><a href=r38_0200.html#r38_0219>SCIENTIFIC\_NOTATION declaration</a><P>
- <li><a href=r38_0200.html#r38_0220>SHARE declaration</a><P>
- <li><a href=r38_0200.html#r38_0221>SYMBOLIC command</a><P>
- <li><a href=r38_0200.html#r38_0222>SYMMETRIC declaration</a><P>
- <li><a href=r38_0200.html#r38_0223>TR declaration</a><P>
- <li><a href=r38_0200.html#r38_0224>UNTR declaration</a><P>
- <li><a href=r38_0200.html#r38_0225>VARNAME declaration</a><P>
- <li><a href=r38_0200.html#r38_0226>WEIGHT command</a><P>
- <li><a href=r38_0200.html#r38_0227>WHERE operator</a><P>
- <li><a href=r38_0200.html#r38_0228>WHILE command</a><P>
- <li><a href=r38_0200.html#r38_0229>WTLEVEL command</a><P>
- </menu>
- <a name=r38_0231>
- <title>IN</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>IN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>in</em> command takes a list of file names and inputs each file into
- the system.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>in</em><filename>{,<filename>}*
- <P>
- <P>
- <P>
- <filename> must be in the current directory, or be a valid pathname.
- If the file name is not an identifier, double quote marks (<em>"</em>) are
- needed around the file name.
- <P>
- <P>
- A message is given if the file cannot be found, or has a mistake
- in it.
- <P>
- <P>
- Ending the command with a semicolon causes the file to be echoed to the
- screen; ending it with a dollar sign does not echo the file. If you want
- some but not all of a file echoed, turn the switch
- <a href=r38_0250.html#r38_0281>echo</a> on or off
- in the file.
- <P>
- <P>
- An efficient way to develop procedures in REDUCE is to write them into a file
- using a system editor of your choice, and then input the
- files into an active REDUCE session. REDUCE reparses the procedure as
- it takes information from the file, overwriting the previous procedure
- definition. When it accepts the procedure, it echoes its name to the screen.
- Data can also be input to the system from files.
- <P>
- <P>
- Files to be read in should always end in
- <a href=r38_0001.html#r38_0044>end</a><em>;</em> to avoid
- end-of-file problems. Note that this is an additional <em>end;</em> to any
- ending procedures in the file.
- <P>
- <P>
- <P>
- <a name=r38_0232>
- <title>INPUT</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>INPUT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>input</em> command returns the input expression to the REDUCE numbered
- prompt that is its argument.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>input</em>(<number>) or <em>input</em> <number>
- <P>
- <P>
- <P>
- <P>
- <number> must be between 1 and the current REDUCE prompt number.
- <P>
- <P>
- An expression brought back by <em>input</em> can be reexecuted with new
- values or switch settings, or used as an argument in another expression.
- The command
- <a href=r38_0150.html#r38_0184>ws</a> brings back the results of a numbered REDU
- CE
- statement. Two lists contain every input and every output statement since
- the beginning of the session. If your session is very long, storage space
- begins to fill up with these expressions, so it is a good idea to end the
- session once in a while, saving needed expressions to files with the
- <a href=r38_0100.html#r38_0133>saveas</a> and
- <a href=r38_0200.html#r38_0233>out</a> commands.
- <P>
- <P>
- Switch settings and
- <a href=r38_0150.html#r38_0199>let</a> statements can also be reexecuted by usin
- g
- <em>input</em>.
- <P>
- <P>
- An error message is given if a number is called for that has not yet been used.
- <P>
- <P>
- <P>
- <a name=r38_0233>
- <title>OUT</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>OUT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>out</em> command directs output to the filename that is its argument,
- until another <em>out</em> changes the output file, or
- <a href=r38_0200.html#r38_0234>shut</a> closes it.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>out</em><filename> or <em>out "</em><pathname> <em>"
- </em> or <em>out t</em>
- <P>
- <P>
- <P>
- <filename> must be in the current directory, or be a valid complete
- file description for your system. If the file name is not
- in the current directory, quote marks are needed around the file name.
- If the file already exists, a message is printed allowing you to decide
- whether to supersede the contents of the file with new material.
- <P>
- <P>
- To restore output to the terminal, type <em>out t</em>, or
- <a href=r38_0200.html#r38_0234>shut</a> the
- file. When you use <em>out t</em>, the file remains available, and if you
- open it again (with another <em>out</em>), new material is appended rather
- than overwriting.
- <P>
- <P>
- To write a file using <em>out</em> that can be input at a later time, the
- switch
- <a href=r38_0300.html#r38_0308>nat</a> must be turned off, so that the standard
- linear form
- is saved that can be read in by
- <a href=r38_0200.html#r38_0231>in</a>. If <em>nat</em> is on, exponents
- are printed on the line above the expression, which causes trouble
- when REDUCE tries to read the file.
- <P>
- <P>
- There is a slight complication if you are using the <em>out</em> command from
- inside a file to create another file. The
- <a href=r38_0250.html#r38_0281>echo</a> switch is normally
- off at the top-level and on while reading files (so you can see what is
- being read in). If you create a file using <em>out</em> at the top-level,
- the result lines are printed into the file as you want them. But if you
- create such a file from inside a file, the <em>echo</em> switch is on, and
- every line is echoed, first as you typed it, then as REDUCE parsed it, and
- then once more for the file. Therefore, when you create a file from
- a file, you need to turn <em>echo</em> off explicitly before the <em>out</em>
- command, and turn it back on when you <em>shut</em> the created file, so your
- executing file echoes as it should. This behavior also means that as you
- watch the file execute, you cannot see the lines that are being put into
- the <em>out</em> file. As soon as you turn <em>echo</em> on, you can see
- output again.
- <P>
- <P>
- <P>
- <a name=r38_0234>
- <title>SHUT</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>SHUT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>command</b><P>
- <P>
-
- <P>
- <P>
- The <em>shut</em> command closes output files.
- <P> <H3>
- syntax: </H3>
- <P>
- <P>
- <em>shut</em><filename>{,<filename>}*
- <P>
- <P>
- <P>
- <filename> must have been a file opened by
- <a href=r38_0200.html#r38_0233>out</a>.
- <P>
- <P>
- A file that has been opened by
- <a href=r38_0200.html#r38_0233>out</a> must be <em>shut</em> before it is
- brought in by
- <a href=r38_0200.html#r38_0231>in</a>. Files that have been opened by <em>out
- </em> should
- always be <em>shut</em> before the end of the REDUCE session, to avoid either
- loss of information or the printing of extraneous information into the file.
- In most systems, terminating a session by
- <a href=r38_0100.html#r38_0124>bye</a> closes all open
- output files.
- <P>
- <P>
- <P>
- <a name=r38_0235>
- <title>Input and Output</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>Input and Output</b><menu>
- <li><a href=r38_0200.html#r38_0231>IN command</a><P>
- <li><a href=r38_0200.html#r38_0232>INPUT command</a><P>
- <li><a href=r38_0200.html#r38_0233>OUT command</a><P>
- <li><a href=r38_0200.html#r38_0234>SHUT command</a><P>
- </menu>
- <a name=r38_0236>
- <title>ACOS</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACOS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>acos</em> operator returns the arccosine of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acos</em>(<expression>) or <em>acos</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- acos(ab);
- ACOS(AB)
- acos 15;
- ACOS(15)
- df(acos(x*y),x);
- 2 2
- SQRT( - X *Y + 1)*Y
- --------------------
- 2 2
- X *Y - 1
- on rounded;
- res := acos(sqrt(2)/2);
- RES := 0.785398163397
- res-pi/4;
- 0
- </tt></pre><p>An explicit numeric value is not given unless the switch
- <a href=r38_0300.html#r38_0330>rounded</a> is
- on and the argument has an absolute numeric value less than or equal to 1.
- <P>
- <P>
- <P>
- <a name=r38_0237>
- <title>ACOSH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACOSH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- <em>acosh</em>represents the hyperbolic arccosine of its argument. It takes
- an arbitrary scalar expression as its argument. The derivative of
- <em>acosh</em> is known to the system. Numerical values may also be found by
- turning on the switch
- <a href=r38_0300.html#r38_0330>rounded</a>.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acosh</em>(<expression>) or <em>acosh</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- acosh a;
- ACOSH(A)
- acosh(0);
- ACOSH(0)
- df(acosh(a**2),a);
- 4
- 2*SQRT(A - 1)*A
- ----------------
- 4
- A - 1
- int(acosh(x),x);
- INT(ACOSH(X),X)
- </tt></pre><p>You may attach functionality by defining <em>acosh</em> to be the
- inverse of
- <em>cosh</em>. This is done by the commands
- <p><pre><tt>
- put('cosh,'inverse,'acosh);
- put('acosh,'inverse,'cosh);
- </tt></pre><p><P>
- <P>
- You can write a procedure to attach integrals or other
- functions to <em>acosh</em>. You may wish to add a check to see that its
- argument is properly restricted.
- <P>
- <P>
- <P>
- <a name=r38_0238>
- <title>ACOT</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACOT</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- <em>acot</em>represents the arccotangent of its argument. It takes
- an arbitrary scalar expression as its argument. The derivative of
- <em>acot</em> is known to the system. Numerical values may also be found by
- turning on the switch
- <a href=r38_0300.html#r38_0330>rounded</a>.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acot</em>(<expression>) or <em>acot</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- You can add functionality yourself with <em>let</em> and procedures.
- <P>
- <P>
- <a name=r38_0239>
- <title>ACOTH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACOTH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- <em>acoth</em>represents the inverse hyperbolic cotangent of its argument.
- It takes an arbitrary scalar expression as its argument. The derivative
- of <em>acoth</em> is known to the system. Numerical values may also be found
- by turning on the switch
- <a href=r38_0300.html#r38_0330>rounded</a>.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acoth</em>(<expression>) or <em>acoth</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array,
- matrix or vector expression. <simple\_expression> must be a single
- identifier or begin with a prefix operator name. You can add
- functionality yourself with <em>let</em> and procedures.
- <P>
- <P>
- <a name=r38_0240>
- <title>ACSC</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACSC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>acsc</em> operator returns the arccosecant of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acsc</em>(<expression>) or <em>acsc</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- acsc(ab);
- ACSC(AB)
- acsc 15;
- ACSC(15)
- df(acsc(x*y),x);
- 2 2
- -SQRT(X *Y - 1)
- ----------------
- 2 2
- X*(X *Y - 1)
- on rounded;
- res := acsc(2/sqrt(3));
- RES := 1.0471975512
- res-pi/3;
- 0
- </tt></pre><p>An explicit numeric value is not given unless the switch <em>round
- ed</em> is
- on and the argument has an absolute numeric value less than or equal to 1.
- <P>
- <P>
- <P>
- <a name=r38_0241>
- <title>ACSCH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ACSCH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>acsch</em> operator returns the hyperbolic arccosecant of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>acsch</em>(<expression>) or <em>acsch</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- acsch(ab);
- ACSCH(AB)
- acsch 15;
- ACSCH(15)
- df(acsch(x*y),x);
- 2 2
- -SQRT(X *Y + 1)
- ----------------
- 2 2
- X*(X *Y + 1)
- on rounded;
- res := acsch(3);
- RES := 0.327450150237
- </tt></pre><p>An explicit numeric value is not given unless the switch <em>round
- ed</em> is
- on and the argument has an absolute numeric value less than or equal to 1.
- <P>
- <P>
- <P>
- <a name=r38_0242>
- <title>ASEC</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ASEC</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>asec</em> operator returns the arccosecant of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>asec</em>(<expression>) or <em>asec</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- asec(ab);
- ASEC(AB)
- asec 15;
- ASEC(15)
- df(asec(x*y),x);
- 2 2
- SQRT(X *Y - 1)
- ---------------
- 2 2
- X*(X *Y - 1)
- on rounded;
- res := asec sqrt(2);
- RES := 0.785398163397
- res-pi/4;
- 0
- </tt></pre><p>An explicit numeric value is not given unless the switch <em>round
- ed</em> is
- on and the argument has an absolute numeric value greater or equal to 1.
- <P>
- <P>
- <P>
- <a name=r38_0243>
- <title>ASECH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ASECH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- <em>asech</em>represents the hyperbolic arccosecant of its argument. It takes
- an arbitrary scalar expression as its argument. The derivative of
- <em>asech</em> is known to the system. Numerical values may also be found by
- turning on the switch
- <a href=r38_0300.html#r38_0330>rounded</a>.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>asech</em>(<expression>) or <em>asech</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- asech a;
- ASECH(A)
- asech(1);
- 0
- df(acosh(a**2),a);
- 4
- 2*SQRT(- A + 1)
- ----------------
- 4
- A*(A - 1)
- int(asech(x),x);
- INT(ASECH(X),X)
- </tt></pre><p>You may attach functionality by defining <em>asech</em> to be the
- inverse of
- <em>sech</em>. This is done by the commands
- <p><pre><tt>
- put('sech,'inverse,'asech);
- put('asech,'inverse,'sech);
- </tt></pre><p><P>
- <P>
- You can write a procedure to attach integrals or other
- functions to <em>asech</em>. You may wish to add a check to see that its
- argument is properly restricted.
- <P>
- <P>
- <P>
- <a name=r38_0244>
- <title>ASIN</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ASIN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>asin</em> operator returns the arcsine of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>asin</em>(<expression>) or <em>asin</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- asin(givenangle);
- ASIN(GIVENANGLE)
- asin(5);
- ASIN(5)
- df(asin(2*x),x);
- 2
- 2*SQRT( - 4*X + 1))
- - --------------------
- 2
- 4*X - 1
- on rounded;
- asin .5;
- 0.523598775598
- asin(sqrt(3));
- ASIN(1.73205080757)
- asin(sqrt(3)/2);
- 1.04719755120
- </tt></pre><p>A numeric value is not returned by <em>asin</em> unless the switch
-
- <em>rounded</em> is on and its argument has an absolute value less than or
- equal to 1.
- <P>
- <P>
- <P>
- <a name=r38_0245>
- <title>ASINH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ASINH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>asinh</em> operator returns the hyperbolic arcsine of its argument.
- The derivative of <em>asinh</em> and some simple transformations are known
- to the system.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>asinh</em>(<expression>) or <em>asinh</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- asinh d;
- ASINH(D)
- asinh(1);
- ASINH(1)
- df(asinh(2*x),x);
- 2
- 2*SQRT(4*X + 1))
- -----------------
- 2
- 4*X + 1
- </tt></pre><p>You may attach further functionality by defining <em>asinh</em> to
- be the
- inverse of <em>sinh</em>. This is done by the commands
- <p><pre><tt>
- put('sinh,'inverse,'asinh);
- put('asinh,'inverse,'sinh);
- </tt></pre><p><P>
- <P>
- A numeric value is not returned by <em>asinh</em> unless the switch
- <em>rounded</em> is on and its argument evaluates to a number.
- <P>
- <P>
- <P>
- <a name=r38_0246>
- <title>ATAN</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ATAN</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>atan</em> operator returns the arctangent of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>atan</em>(<expression>) or <em>atan</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- atan(middle);
- ATAN(MIDDLE)
- on rounded;
- atan 45;
- 1.54857776147
- off rounded;
- int(atan(x),x);
- 2
- 2*ATAN(X)*X - LOG(X + 1)
- -------------------------
- 2
- df(atan(y**2),y);
- 2*Y
- -------
- 4
- Y + 1
- </tt></pre><p>A numeric value is not returned by <em>atan</em> unless the switch
-
- <a href=r38_0300.html#r38_0330>rounded</a> is on and its argument evaluates to a
- number.
- <P>
- <P>
- <P>
- <a name=r38_0247>
- <title>ATANH</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ATANH</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- The <em>atanh</em> operator returns the hyperbolic arctangent of its argument.
- The derivative of <em>asinh</em> and some simple transformations are known
- to the system.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>atanh</em>(<expression>) or <em>atanh</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> may be any scalar REDUCE expression, not an array, matrix or
- vector expression. <simple\_expression> must be a single identifier or
- begin with a prefix operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- atanh aa;
- ATANH(AA)
- atanh(1);
- ATANH(1)
- df(atanh(x*y),y);
- - X
- ----------
- 2 2
- X *Y - 1
- </tt></pre><p>A numeric value is not returned by <em>asinh</em> unless the switc
- h
- <em>rounded</em> is on and its argument evaluates to a number.
- You may attach additional functionality by defining <em>atanh</em> to be the
- inverse of <em>tanh</em>. This is done by the commands
- <P>
- <P>
- <p><pre><tt>
- put('tanh,'inverse,'atanh);
- put('atanh,'inverse,'tanh);
- </tt></pre><p><P>
- <P>
- <a name=r38_0248>
- <title>ATAN2</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>ATAN2</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>atan2</em>(<expression>,<expression>)
- <P>
- <P>
- <P>
- <expression> is any valid scalar REDUCE expression. In
- <a href=r38_0300.html#r38_0330>rounded</a> mode, if a numerical value exists,
- <em>atan2</em> returns
- the principal value of the arc tangent of the second argument divided by
- the first in the range [-pi,+pi] radians, using the signs of both
- arguments to determine the quadrant of the return value. An expression in
- terms of <em>atan2</em> is returned in other cases.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- atan2(3,2);
- ATAN2(3,2);
- on rounded;
- atan2(3,2);
- 0.982793723247
- atan2(a,b);
- ATAN2(A,B);
- atan2(1,0);
- 1.57079632679
- </tt></pre><p><em>atan2</em>returns a numeric value only if
- <a href=r38_0300.html#r38_0330>rounded</a> is on. Then
- <em>atan2</em> is calculated to the current degree of floating point precision.
- <P>
- <P>
- <P>
- <P>
- <a name=r38_0249>
- <title>COS</title></a>
- <p align="centre"><img src="redlogo.gif" width=621 height=60 border=0 alt="REDUC
- E"></p>
- <b><a href=r38_idx.html>INDEX</a></b><p><p>
- <b>COS</b> _ _ _ _ _ _ _ _ _ _ _ _ <b>operator</b><P>
- <P>
-
- The <em>cos</em> operator returns the cosine of its argument.
- <P>
- <P>
- <P> <H3>
- syntax: </H3>
- <em>cos</em>(<expression>) or <em>cos</em> <simple\_expression>
- <P>
- <P>
- <P>
- <expression> is any valid scalar REDUCE expression,
- <simple\_expression> is a single identifier or begins with a prefix
- operator name.
- <P>
- <P>
- <P> <H3>
- examples: </H3>
- <p><pre><tt>
- cos abc;
- COS(ABC)
- cos(pi);
- -1
- cos 4;
- COS(4)
- on rounded;
- cos(4);
- - 0.653643620864
- cos log 5;
- - 0.0386319699339
- </tt></pre><p><em>cos</em>returns a numeric value only if
- <a href=r38_0300.html#r38_0330>rounded</a> is on. Then the
- cosine is calculated to the current degree of floating point precision.
- <P>
- <P>
- <P>
- <P>
|