<TeXmacs|1.0.2>

<style|<tuple|generic|axiom>>

<\body>
  <\expand|make-title>
    <with|font size|2|<title|<strong|<with|font
    shape|long|ax<underline|i>om>>>>

    <author|>

    <address|>

    \;

    <author|Richard D. Jenks and Robert S. Sutor>

    <\address>
      <with|font|helvetica|<with|font size|1.19|The Scientific Computation
      System>>

      \;

      \;

      Numerical Algorithms Group Limited, 1992
    </address>
  </expand>

  <\with|paragraph mode|center>
    With Contributions From

    <expand|block*|<tformat|<twith|table valign|t>|<cwith|4|4|3|3|cell
    rborder|0>|<cwith|4|4|3|3|cell bborder|0>|<cwith|4|4|3|3|cell
    tborder|0>|<cwith|1|1|1|1|cell rborder|0>|<cwith|1|1|1|1|cell
    bborder|0>|<cwith|1|1|1|1|cell tborder|0>|<cwith|4|4|2|2|cell
    rborder|0>|<cwith|4|4|2|2|cell bborder|0>|<cwith|4|4|2|2|cell
    tborder|0>|<twith|table halign|L>|<cwith|1|4|1|3|cell
    lborder|0>|<cwith|3|3|1|1|cell lborder|0>|<cwith|3|3|1|1|cell
    rborder|0>|<cwith|3|3|1|1|cell bborder|0>|<cwith|3|3|1|1|cell
    tborder|0>|<cwith|2|2|3|3|cell lborder|0>|<cwith|2|2|3|3|cell
    rborder|0>|<cwith|2|2|3|3|cell bborder|0>|<cwith|2|2|3|3|cell
    tborder|0>|<cwith|1|1|3|3|cell lborder|0>|<cwith|1|1|3|3|cell
    rborder|0>|<cwith|1|1|3|3|cell bborder|0>|<cwith|1|1|3|3|cell
    tborder|0>|<cwith|1|1|2|2|cell lborder|0>|<cwith|1|1|2|2|cell
    rborder|0>|<cwith|1|1|2|2|cell bborder|0>|<cwith|1|1|2|2|cell
    tborder|0>|<cwith|2|2|1|1|cell lborder|0>|<cwith|2|2|1|1|cell
    rborder|0>|<cwith|2|2|1|1|cell bborder|0>|<cwith|2|2|1|1|cell
    tborder|0>|<cwith|3|3|2|2|cell lborder|0>|<cwith|3|3|2|2|cell
    rborder|0>|<cwith|3|3|2|2|cell bborder|0>|<cwith|3|3|2|2|cell
    tborder|0>|<cwith|2|2|2|2|cell lborder|0>|<cwith|2|2|2|2|cell
    rborder|0>|<cwith|2|2|2|2|cell bborder|0>|<cwith|2|2|2|2|cell
    tborder|0>|<cwith|3|3|3|3|cell lborder|0>|<cwith|3|3|3|3|cell
    rborder|0>|<cwith|3|3|3|3|cell bborder|0>|<cwith|3|3|3|3|cell
    tborder|0>|<cwith|4|4|1|1|cell lborder|0>|<cwith|4|4|1|1|cell
    rborder|0>|<cwith|4|4|1|1|cell bborder|0>|<cwith|4|4|1|1|cell
    tborder|0>|<cwith|1|4|1|1|cell halign|l>|<cwith|1|4|2|2|cell
    halign|l>|<cwith|1|4|3|3|cell halign|l>|<table|<row|<cell|Scott C.
    Morrison>|<cell|Manuel Bronstein>|<cell|Patrizia
    Gianni>>|<row|<cell|Jonathoon M. Steinbach>|<cell|William H.
    Burge>|<cell|Johannes Grabmeier>>|<row|<cell|Barry Trager>|<cell|Timothy
    P. Daly>|<cell|William Sit>>|<row|<cell|Stephen M. Watt>|<cell|Michael
    Dewar>|<cell|Clifton J. Williamson>>>>>
  </with>

  <format|page break>

  <\expand|table-of-contents|toc>
    Introduction to AXIOM<value|toc-dots><pageref|toc-1>

    <with|left margin|1.5fn|Symbolic Computation<value|toc-dots><pageref|toc-2>>

    <with|left margin|1.5fn|Numeric Computation<value|toc-dots><pageref|toc-3>>

    <with|left margin|1.5fn|Interactive Programming<value|toc-dots><pageref|toc-4>>

    <with|left margin|1.5fn|Data Structures<value|toc-dots><pageref|toc-5>>

    <with|left margin|1.5fn|Mathematical Structures<value|toc-dots><pageref|toc-6>>

    <with|left margin|1.5fn|Pattern Matching<value|toc-dots><pageref|toc-7>>

    <with|left margin|1.5fn|Polymorphic Algorthms<value|toc-dots><pageref|toc-8>>

    <with|left margin|1.5fn|Extensibility<value|toc-dots><pageref|toc-9>>
  </expand>

  <format|page break>

  <section|Introduction to AXIOM>

  Welcome to the world of AXIOM. We call AXIOM a scientific computation
  system: a self-contained toolbox designed to meet your scientific
  programming needs, from symbolics, to numerics, to graphics.

  \;

  This introduction is a quick overview of what AXIOM offers.

  <underline|<subsection|Symbolic Computation>>

  AXIOM provides a wide range of simple commands for symbolic mathematical
  problem solving. Do you need to solve an equation, to expand a series, or
  to obtain an integral? If so, just ask AXIOM to do it.

  <\verse>
    <\with|font size|0.84>
      Integrate <with|mode|math|<frac|1|(x<rsup|3>(a+bx)<rsup|1/3)>>> with
      respect to <with|mode|math|x>.
    </with>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      integrate(1/(x**3 * (a+b*x)**(1/3)),x)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<frac|<left|(><expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|-2b<rsup|2>x<rsup|2><sqrt|3>log
        <left|(><sqrt|a|3><sqrt|b*x+a|3><rsup|2>+<sqrt|a|3><rsup|2><sqrt|b*x+a|3>+a<right|)>+>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|4b<rsup|2>x<rsup|2><sqrt|3>log
        <left|(><sqrt|a|3><rsup|2><sqrt|b*x+a|3>-a<right|)>+>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|12b<rsup|2>x<rsup|2>arctan
        <left|(><frac|2<sqrt|3><sqrt|a|3><rsup|2><sqrt|b*x+a|3>+a<sqrt|3>|3a><right|)>+<format|new
        line>>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<left|(>12b*x-9a<right|)><sqrt|3><sqrt|a|3><sqrt|b*x+a|3><rsup|2>>>>>>><right|)>|18a<rsup|2>x<rsup|2><sqrt|3><sqrt|a|3>><apply|leqno>(1)>
      </with>

      <apply|axiomtype|Union(Expression Integer,...) >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>

    <\output>
      \;
    </output>
  </session>>

  Axiom provides state-of-the art algebraic machinery to handle your most
  advanced symbolic problems. For example, AXIOM's integrator gives you the
  answer when an answer exists. If one does not, it provides a proof that
  there is no answer. Integration is just one of a multitude of symbolic
  operations that AXIOM provides.

  <underline|<subsection|Numeric Computation>>

  AXIOM has a numerical library that includes operations for linear algebra,
  solutions of equations, and special functions. For many of these
  operations, you can select any number of floating point digits to be
  carried out in the computation.

  <with|font size|0.84|<\verse>
    Solve <with|mode|math|x<rsup|49>-49x<rsup|4>+9> to 49 digits of accuracy.
  </verse>>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      solve(x**49-49*x**4+9 = 0, 1.e-49)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|<left|[>x=-0.65465367069042711367,<space|0.5spc>x=1.0869213956538595085,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<left|.>x=0.65465367072552717397<right|]>>>>>>><apply|leqno>(1)>
      </with>

      <apply|axiomtype|List Equation Polynomial Float >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  \;

  The output of a computation can be converted to FORTRAN to be used in a
  later numerical computation. Besides floating point numbers, AXIOM provides
  literally dozens of kinds of numbers to compute with. These range from
  various kinds of integers, to fractions, complex numbers, quaternions,
  continued fractions, and to numbers represented with an arbitrary base.

  <\verse>
    <with|font size|0.84|What is <with|mode|math|10> to the
    <with|mode|math|100<rsup|th>> power in base 32?>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      radix(10**100,32)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|4#<apply|I>9#<apply|L>#<apply|K>#<apply|I>#<apply|P>9#<apply|G>#<apply|R>#<apply|S>#<apply|T>#<apply|C>5#<apply|I>#<apply|F>164#<apply|P>#<apply|O>5#<apply|V>72#<apply|M>#<apply|E>827226#<apply|J>#<apply|S>#<apply|L>#<apply|A>#<apply|P>462585#<apply|Q>7#<apply|H|0>0000000000000000000<apply|leqno>(3)>
      </with>

      <apply|axiomtype|RadixExpansion 32 >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <underline|<subsection|Interactive Programming>>

  AXIOMS's interactive programming language lets you define your own
  functions. A simple example of a user-defined function is one that computes
  the successive Legendre polynomials. AXIOM lets you define these
  polynomicals in a piece-wise way.

  <\verse>
    <with|font size|0.84|The first Legendre polynomial>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      p(0) == 1
    </input>

    <\output>
      <apply|axiomtype|Void >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <\verse>
    <with|font size|0.84|The second Legendre polynomial>
  </verse>

  <\with|prog language|axiom|this session|default>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      p(1) == x
    </input>

    <\output>
      <apply|axiomtype|Void >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </with>

  <\verse>
    <with|font size|0.84|The <with|mode|math|n<rsup|th>> Legendre polynomial
    for <with|mode|math|(n\<gtr\>1)>.>
  </verse>

  <\with|prog language|axiom|this session|default>
    <with|prog language|axiom|this session|default|<\session>
      <\input|<\with|color|red>
        <with|mode|math|\<rightarrow\>>\ 
      </with>>
        p(n) == ((2*n-1)*x*p(n-1) - (n-1) * p(n-2))/n
      </input>

      <\output>
        <apply|axiomtype|Void >
      </output>

      <\input|<\with|color|red>
        <with|mode|math|\<rightarrow\>>\ 
      </with>>
        \;
      </input>
    </session>>

    \;
  </with>

  In addition to letting you define simple functions like this, the
  interactive language can be used to create entire application packages. All
  the graphs in the AXIOM Images section in the center of the book, for
  example, were created by programs written in the interactive language.

  The above definitions for p do no computation -- they simply tell AXIOM how
  to compute <with|mode|math|p(k)> for some positive integer
  <with|mode|math|k>. To actually get a value of a Legendre polynomial, you
  ask for it.

  <\verse>
    <with|font size|0.84|What is the tenth Legendre polynomial?>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      p(10)
    </input>

    <\output>
      \ \ \ Compiling function p with type Integer -\<gtr\> Polynomial
      Fraction\ 

      \ \ \ \ \ \ Integer\ 

      \ \ \ Compiling function p as a recurrence relation.

      <\with|mode|math>
        <with|formula style|true|<frac|46189|256>x<rsup|10>-<frac|109395|256>x<rsup|8>+<frac|45045|128>x<rsup|6>-<frac|15015|128>x<rsup|4>+<frac|3465|256>x<rsup|2>-<frac|63|256><apply|leqno>(4)>
      </with>

      <apply|axiomtype|Polynomial Fraction Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  AXIOM applies the above pieces for <with|mode|math|p> to obtain the value
  <with|mode|math|p(10)>. But it does more: it creates an optimized, compiled
  function <with|mode|math|p>. The function is formed by putting the pieces
  together into a single piece of code. By <em|compiled>, we mean that the
  function is translated into basic machine-code. By <em|optimized>, we mean
  that certain transformations are performed on that code to make it run
  faster. For <with|mode|math|p>, AXIOM actually translates the original
  definition that is recursive (one that calls itself) to one that is
  iterative (one that consists of a simple loop).

  <\verse>
    <\with|font size|0.84>
      What is the coefficient of <with|mode|math|x<rsup|90>> in
      <with|mode|math|p(90)?>
    </with>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      coefficient(p(90),x,90)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<frac|5688265542052017822223458237426581853561497449095175|77371252455336267181195264><apply|leqno>(8)>
      </with>

      <apply|axiomtype|Polynomial Fraction Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  In general, a user function is type-analyzed and compiled on first use.
  Later, if you use it with a different kind of object, the function is
  recompiled if necessary.

  <underline|<subsection|Data Structures>>

  A variety of data structures are available for interactive use. These
  include strings, lists, vectors, sets, multisets, and hash tables. A
  particularly useful structure for interactive use is the infinite stream:

  <\verse>
    <with|font size|0.84|Create tge infinit stream of derivatives of Legendre
    polynomials.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <with|prog language|axiom|this session|default|<\session>
      <\input|<\with|color|red>
        <with|mode|math|\<rightarrow\>>\ 
      </with>>
        [D(p(i),x) for i in 1..]
      </input>

      <\output>
        <\with|mode|math>
          <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
          style|true|<left|[>1,<space|0.5spc>3x,<space|0.5spc><frac|15|2>x<rsup|2>-<frac|3|2>,<space|0.5spc><frac|35|2>x<rsup|3>-<frac|15|2>x,<space|0.5spc><frac|315|8>x<rsup|4>-<frac|105|4>x<rsup|2>+<frac|15|8>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
          style|true|<left|.><frac|693|8>x<rsup|5>-<frac|315|4>x<rsup|3>+<frac|105|8>x,<space|0.5spc><frac|3003|16>x<rsup|6>-<frac|3465|16>x<rsup|4>+<frac|945|16>x<rsup|2>-<frac|35|16>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
          style|true|<left|.><frac|6435|16>x<rsup|7>-<frac|9009|16>x<rsup|5>+<frac|3465|16>x<rsup|3>-<frac|315|16>x,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
          style|true|<left|.><frac|109395|128>x<rsup|8>-<frac|45045|32>x<rsup|6>+<frac|45045|64>x<rsup|4>-<frac|3465|32>x<rsup|2>+<frac|315|128>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
          style|true|<left|.><frac|230945|128>x<rsup|9>-<frac|109395|32>x<rsup|7>+<frac|135135|64>x<rsup|5>-<frac|15015|32>x<rsup|3>+<frac|3465|128>x,<space|0.5spc>\<ldots\><right|]>>>>>>><apply|leqno>(9)>
        </with>

        <apply|axiomtype|Stream Polynomial Fraction Integer >
      </output>

      <\input|<\with|color|red>
        <with|mode|math|\<rightarrow\>>\ 
      </with>>
        \;
      </input>
    </session>>

    \;
  </session>>

  Streams display only for a few of their initial elements. Otherwise, they
  are "lazy": they only compute elements when you ask for them.

  Data structures are an important component for building application
  software. Advanced users can represent data for applications in optimal
  fashion. In all, AXIOM offers over forty kinds of aggregate data
  structures, ranging from mutable structures (such as cyclic lists and
  flexible arrays) to storage efficient structures (such as bit vectors). As
  an example, streams are used as the internal data structure structure for
  power series.

  <\verse>
    <with|font size|0.84|What is the series expansion of
    <with|mode|math|log(cot(x))> about <with|mode|math|x=\<pi\>/2>?>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      series(log(cot(x)),x = %pi/2)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|log <left|(><frac|-2x+\<pi\>|2><right|)>+<frac|1|3><left|(>x-<frac|\<pi\>|2><right|)><rsup|2>+<frac|7|90><left|(>x-<frac|\<pi\>|2><right|)><rsup|4>+<frac|62|2835><left|(>x-<frac|\<pi\>|2><right|)><rsup|6>+>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<frac|127|18900><left|(>x-<frac|\<pi\>|2><right|)><rsup|8>+<frac|146|66825><left|(>x-<frac|\<pi\>|2><right|)><rsup|10>+O<left|(><left|(>x-<frac|\<pi\>|2><right|)><rsup|11><right|)>>>>>>><apply|leqno>(10)>
      </with>

      <apply|axiomtype|GeneralUnivariatePowerSeries(Expression
      Integer,x,pi/2) >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  Series and streams make no attempt to compute <em|all> their elements!
  Rather, they stand ready to deliver elements on demand.

  <\verse>
    <with|font size|0.84|What is the coefficient of the
    <with|mode|math|50<rsup|th>> term of the series?>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      coefficient(%,50)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<frac|44590788901016030052447242300856550965644|7131469286438669111584090881309360354581359130859375><apply|leqno>(11)>
      </with>

      <apply|axiomtype|Expression Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <underline|<subsection|Mathematical Structures>>

  AXIOM also has many kinds of mathematical structures. These range from
  simple ones (like polynomials and matrices) to more esoteric ones (like
  ideals and Clifford algebras). Most structures allow the construction of
  arbitrarily complicated "types".

  <\verse>
    <with|font size|0.84|Even a simple input expression can result in a type
    with several levels.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      matrix [[x+%i,0], [1,-2]]
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<left|[><expand|tabular*|<tformat|<cwith|1|-1|1|1|cell
        halign|c>|<cwith|1|-1|2|2|cell halign|c>|<table|<row|<cell|x+i>|<cell|0>>|<row|<cell|1>|<cell|-2>>>>><right|]><apply|leqno>(12)>
      </with>

      <apply|axiomtype|Matrix Polynomial Complex Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <\input| >
    \;
  </input>

  The AXIOM interpreter builds types in response to user input. Often, the
  type of the result is changed in order to be applicable to an operation.

  <\verse>
    <with|font size|0.84|The inverse operation requires that elements of the
    above are fractions.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      inverse(%)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<left|[><expand|tabular*|<tformat|<cwith|1|-1|1|1|cell
        halign|c>|<cwith|1|-1|2|2|cell halign|c>|<table|<row|<cell|<frac|1|x+i>>|<cell|0>>|<row|<cell|<frac|1|2x+2i>>|<cell|-<frac|1|2>>>>>><right|]><apply|leqno>(13)>
      </with>

      <apply|axiomtype|Union(Matrix Fraction Polynomial Complex Integer,...)
      >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <underline|<subsection|Pattern Matching>>

  A convenient facility for symbolic computation is "pattern matching".
  Suppose you have a trigonometric expression and you want to transform it to
  some equivalent form. Use a <strong|rule> command to describe the
  transformation rules you need. Then give the rules a name and apply that
  name as a function to your trigonometric expressioin.

  <\verse>
    <with|font size|0.84|Introduce rewrite rules.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      sinCosExpandRules := rule (

      \ \ sin(x+y) == sin(x)*cos(y)+sin(y)*cos(x);

      \ \ cos(x+y) == cos(x)*cos(y) - sin(x)*sin(y);

      \ \ sin(2*x) == 2*sin(x)*cos(x);

      \ \ cos(2*x) == cos(x)**2 - sin(x)**2

      );
    </input>

    <\output>
      <apply|axiomtype|Ruleset(Integer,Integer,Expression Integer) >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <\verse>
    <with|font size|0.84|Apply the rules to a simple trigonometric
    expression.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      sinCosExpandRules(sin(a+2*b+c))
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|<left|(>-cos <left|(>a<right|)>sin
        <left|(>b<right|)><rsup|2>-2cos <left|(>b<right|)>sin
        <left|(>a<right|)>sin <left|(>b<right|)>+cos <left|(>a<right|)>cos
        <left|(>b<right|)><rsup|2><right|)>sin
        <left|(>c<right|)>->>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|cos <left|(>c<right|)>sin <left|(>a<right|)>sin
        <left|(>b<right|)><rsup|2>+2cos <left|(>a<right|)>cos
        <left|(>b<right|)>cos <left|(>c<right|)>sin
        <left|(>b<right|)>+>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|cos <left|(>b<right|)><rsup|2>cos <left|(>c<right|)>sin
        <left|(>a<right|)>>>>>>><apply|leqno>(15)>
      </with>

      <apply|axiomtype|Expression Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  Using input files, you can create your own library of transformation rules
  relevant to your applications, then selectively apply the rules you need.

  <underline|<subsection|Polymorphic Algorthms>>

  All componetns of the AXIOM algebra library are written in the AXIOM
  library language. This language is similar to the interactive language
  except for protocols that authors are obliged to follow. The library
  language permits you to write "polymorphic algorithms", algorithms defined
  to work in their most natural settings and over a variety of types.

  <\verse>
    <with|font size|0.84|Define a system of polynomial equations
    <with|mode|math|S>.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      S := [3*x**3 + y +1 = 0, y**2 = 4]
    </input>

    \;
  </session>>

  <\verse>
    <with|font size|0.84|Solve the system <with|mode|math|S> using rational
    number arithmetic and 30 digits of accuracy.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      solve (S,1/10**30)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|<left|[><left|[>y=-2,<space|0.5spc>x=<frac|1757879671211184245283070414507|2535301200456458802993406410752><right|]>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<left|.><left|[>y=2,<space|0.5spc>x=-1<right|]><right|]>>>>>>><apply|leqno>(17)>
      </with>

      <apply|axiomtype|List List Equation Polynomial Fraction Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  <\verse>
    <with|font size|0.84|Solve <with|mode|math|S> with the solution expressed
    in radicals.>
  </verse>

  <with|prog language|axiom|this session|default|<\session>
    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      radicalSolve(S)
    </input>

    <\output>
      <\with|mode|math>
        <with|formula style|true|<expand|tabular*|<tformat|<table|<row|<cell|<with|formula
        style|true|<left|[><left|[>y=2,<space|0.5spc>x=-1<right|]>,<space|0.5spc><left|[>y=2,<space|0.5spc>x=<frac|-<sqrt|-3>+1|2><right|]>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<left|.><left|[>y=2,<space|0.5spc>x=<frac|<sqrt|-3>+1|2><right|]>,<space|0.5spc><left|[>y=-2,<space|0.5spc>x=<frac|1|<sqrt|3|3>><right|]>,<space|0.5spc><right|.>>>>|<row|<cell|>>|<row|<cell|<with|formula
        style|true|<left|.><left|[>y=-2,<space|0.5spc>x=<frac|<sqrt|-1><sqrt|3>-1|2<sqrt|3|3>><right|]>,<space|0.5spc><left|[>y=-2,<space|0.5spc>x=<frac|-<sqrt|-1><sqrt|3>-1|2<sqrt|3|3>><right|]><right|]>>>>>>><apply|leqno>(18)>
      </with>

      <apply|axiomtype|List List Equation Expression Integer >
    </output>

    <\input|<\with|color|red>
      <with|mode|math|\<rightarrow\>>\ 
    </with>>
      \;
    </input>
  </session>>

  While these solutions look very different, the results were produced by the
  same internal algorithm! The internal algorithm actually works with
  equations over any "field". Examples of fields are the rational numbers,
  floating point numbers, rational fractions, power series, and general
  expressions involving radicals.

  <underline|<subsection|Extensibility>>

  Users and system developers alike can augment the AXIOM library, all using
  one common language. Library code, like interpreter code, is compiled into
  machine binary code for run-time efficiency.

  Using this language, you can create new compuational types and new
  algorithmic packages. All library code is polymorphic, described in terms
  of a database of algebraic properties. By following the language protocols,
  there is an automatic, guaranteed interaction between your code and that of
  colleagues and system implementers.
</body>

<\initial>
  <\collection>
    <associate|paragraph width|150mm>
    <associate|odd page margin|30mm>
    <associate|page medium|paper>
    <associate|page right margin|30mm>
    <associate|page top margin|30mm>
    <associate|reduction page right margin|25mm>
    <associate|page type|a4>
    <associate|reduction page bottom margin|15mm>
    <associate|even page margin|30mm>
    <associate|reduction page left margin|25mm>
    <associate|page bottom margin|30mm>
    <associate|reduction page top margin|15mm>
    <associate|language|english>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|toc-10|<tuple|<uninit>|?>>
    <associate|toc-1|<tuple|<uninit>|3>>
    <associate|gly-1|<tuple|1|?>>
    <associate|toc-2|<tuple|<uninit>|3>>
    <associate|toc-3|<tuple|<uninit>|3>>
    <associate|toc-4|<tuple|<uninit>|4>>
    <associate|toc-5|<tuple|<uninit>|5>>
    <associate|toc-6|<tuple|<uninit>|6>>
    <associate|toc-7|<tuple|<uninit>|7>>
    <associate|toc-8|<tuple|<uninit>|7>>
    <associate|toc-9|<tuple|<uninit>|8>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|toc>
      Introduction to AXIOM<value|toc-dots><pageref|toc-1>

      <with|left margin|<quote|1.5fn>|Symbolic
      Computation<value|toc-dots><pageref|toc-2>>

      <with|left margin|<quote|1.5fn>|Numeric
      Computation<value|toc-dots><pageref|toc-3>>

      <with|left margin|<quote|1.5fn>|Interactive
      Programming<value|toc-dots><pageref|toc-4>>

      <with|left margin|<quote|1.5fn>|Data
      Structures<value|toc-dots><pageref|toc-5>>

      <with|left margin|<quote|1.5fn>|Mathematical
      Structures<value|toc-dots><pageref|toc-6>>

      <with|left margin|<quote|1.5fn>|Pattern
      Matching<value|toc-dots><pageref|toc-7>>

      <with|left margin|<quote|1.5fn>|Polymorphic
      Algorthms<value|toc-dots><pageref|toc-8>>

      <with|left margin|<quote|1.5fn>|Extensibility<value|toc-dots><pageref|toc-9>>
    </associate>
  </collection>
</auxiliary>
