Sindbad~EG File Manager

Current Path : /usr/home/beeson/MathXpert/automode/
Upload File :
Current File : /usr/home/beeson/MathXpert/automode/opdef.c

#include <stdlib.h>
#include "globals.h"
#include "mtext.h"  /* for MAXMENUS */
#include "ops.h"   /* prototypes of MATHPERT operators */
#include "trig.h"
#include "calc.h"
#include "series.h"
#include "operator.h"  /* automode_only */
#include "optable.h"

 actualop optable[MAXMENUS][16] =
{
   {                      /* numerical_calculation           */
     arithmetic,          /* arithmetic                      */
     devalop,             /* decimal calculation             */
     computeroot,         /* calculate decimal sqrt or ^nsqrt       */
     computepower,        /* decimal value of x^n             */
     computefunction,     /* decimal value of function       */
     factorinteger,       /* factor integer                  */
     evalatpoint,         /* evaluate numerically at a point */
     evalpi,              /* decimal value of pi             */
     evaleulere,          /* decimal value of e              */
     evalfunction,        /* compute function value          */
     factornumerically,    /* factor polynomial numerically    */
     evaluatebernoulli,    /* evaluate Bernoulli number exactly */
     evaluateeulernumber   /* evaluate Euler number exactly   */

   },
   {                      /* numerical_calculation2           */
     decimaltofraction,   /* convert decimal to fraction     */
     writenumberassquare, /* express as square               */
     writenumberascube,   /* express as cube                 */
     writenumberaspower,  /* express as ?-th power           */
     writenumberaspowerof,/* express as power of ?           */
     writeintegeraspower, /* write integer as a^n            */
     writeassum           /* x = ? + (x-?)                   */
   },
   {                     /* complex_arithmetic */
     defnofi,        /* i^2 = -1  */
     powersofi0,     /* i^(4n) = 1           */
     powersofi1,     /* i^(4n+1) = i;        */
     powersofi2,     /*  i^(4n+2) = -1       */
     powersofi3,     /*  i^(4n+3) = -i;      */
     weakcomplexarithmetic,  /* complex arithmetic, not powers */
     complexpowers,      /* power of complex number         */
     complexarithmetic,  /* complex arithmetic and powers   */
     cevalop,            /* complex decimal arithmetic      */
     factorinteger,      /* integer factors of integer      */
     complexfactorsofinteger,  /* complex factors of integer */
     factorcomplexinteger, /* factor n+mi (n not zero)      */
     computeroot,        /* calculate decimal sqrt or ^nsqrt       */
     computepower,       /* decimal value of x^n             */
     computefunction,    /* decimal value of function       */
     evalatpoint         /* evaluate numerically at a point */
   },
   {                      /* simplify_sums                  */
     doubleminus,         /* cancel double minus -(-a)=a    */
     pushminusin,         /* push minus in -(a+b) = -a-b    */
     pullminusout,        /* -a-b = -(a+b)                  */
     arithmetic,          /* arithmetic                     */
     regroupterms,        /* regroup terms                  */
     orderterms,          /* put terms in order             */
     dropzero,            /* drop zero terms x+0 = x        */
     additivecancel,      /* cancel \pm  terms                 */
     collectterms,        /* collect \pm  terms (once)         */
     collectall,          /* collect all \pm  terms in a sum   */
     additivecommute,     /* a+b = b+a                      */
     pullminusout2,       /* a(b-c) = -a(c-b)               */
     minusintoproduct1,   /*-ab = a(-b)                     */
     minusintoproduct2,   /* -abc = ab(-c)                  */
     minusintoproduct3    /* a(-b)c = ab(-c)                */
   },
   {                      /* simplify_products              */
     multbyzero,          /* x\cdot 0 = 0                        */
     multbyone,           /* x\cdot 1 = x                        */
     bringminusout,       /* a(-b) = -ab                    */
     bringminusout2,      /* a(-b-c) = -a(b+c)              */
     bringminusout3,      /* (-a-b)c = -(a+b)c              */
     regroupfactors,      /* regroup factors                */
     collectnumbers,      /* collect numbers                */
     orderfactors,        /* order factors                  */
     collectpowers,       /* collect powers                 */
     distriblaw,          /* a(b+c)=ab+ac                   */
     difofsquares,        /* (a-b)(a+b) = a^2-b^2             */
     squareofsum,         /* (a + b)^2 = a^2 + 2ab + b^2       */
     squareofdif,         /* (a - b)^2 = a^2 - 2ab + b^2       */
     makedifofcubes,      /* (a-b)(a^2+ab+b^2)=a^3-b^3        */
     makesumofcubes,      /* (a+b)(a^2-ab+b^2)=a^3+b^3        */
     multcommute          /* ab = ba                        */
   },
   {                      /* expand_menu */
     multiplyout,         /* multiply out product of sums   */
     expandnumerator,     /* multiply out numerator         */
     expanddenominator,   /* multiply out denominator       */
     multdef              /* na = (a+...+a)                 */
   },
   {                      /* fractions */
     zeronum,            /* 0/a = 0    */
     unitdenom,          /* a/1 = a    */
     recip,              /* a(1/a) = 1 */
     multiplyfractions,   /* (a/b)(c/d) = ac/(bd); don't multiply out (3/5) x if (ringflag & RATRING) */
     multiplyfractions2,  /* a(b/c) = ab/c ; do also multiply out (3/5) x; used only in menu mode */
     cancelop,              /* ab/ac = b/c           */
     addfractions,          /* a/c \pm b/c=(a \pm b)/c     */
     apart,                 /* (a \pm b)/c = a/c \pm b/c */
     apartandcancel,        /* (ac+b)/c = a+b/c      */
     polydivop,
     cancelbypolydiv,
     pulloutrational,       /* au/bv=(a/b)(u/v) (integers a,b)  */
     pulloutdenom,          /* a/b = (1/b) a         */
     pulloutreal,           /* au/b = (a/b) u  (real numbers a,b) */
     breakfraction,         /* ab/cd = (a/c)(b/d)    */
     breakfraction2         /* ab/c = (a/c)b         */
   },
   {                        /* signed_fractions */
     cancelminusinquotient, /* (-a)/(-b) = a/b       */
     minusintonum,          /* -(a/b) = (-a)/b       */
     minusintodenom,        /* -(a/b) = a/(-b)       */
     minusoutfromnum,       /* (-a)/b = -a/b         */
     minusoutfromdenom,     /* a/(-b) = -a/b         */
     minusoutfromnum2,      /* (-a-b)/c = -(a+b)/c   */
     minusoutfromdenom2,    /* a/(-b-c) = -a/(b+c)   */
     minusoutfromdenom3,    /* a/(b-c) = -a/(c-b)    */
     minusoutfromdenom22,   /* -a/(-b-c) = a/(b+c)   */
     minusoutfromdenom33,   /* -a/(b-c) = a/(c-b)    */
     minusoutfromnum22,     /* -(-a-b)/c = (a+b)/c   */
     negatenumdenom,        /* (a-b)/(c-d) = (b-a)/(d-c) */
     breakfraction1,        /* ab/c = a(b/c)         */
     breakfraction3         /* a/(bc) = (1/b) (a/c)  */
   },
   {                   /* compound_fractions */
     compoundfractions1,  /* (a/c)/(b/c) = a/b */
     invertandmultiply,   /* a/(b/c)=ac/b     */
     invertandmultiply2,  /* 1/(a/b) = b/a    */
     compoundfractions2,  /* (a/b)/c = a/(bc)  */
     compoundfractions3,  /* a/b = a(1/b) ; only for menu mode */
     compoundfractions4,  /* (a/b)c/d = ac/bd  */
     factordenominator,
     commondenominfraction   /* commondenom in num or denom */
   },
   {                  /* common_denominators */
     factordenominator,
     findcommondenom,
     findcommondenom2,
     multiplyfractions,
     multiplyfractions,
     orderfactors,
     addfractions,
     commondenom,
     commondenom2,
     commondenomandsimp,
     commondenomandsimp2,
     multnumanddenom
   },
   {         /* exponents */
     zeroexponent,       /* a^0 = 1  (a not zero) */
     unitexponent,       /* a^1 = a               */
     zerobase,           /* 0^b = 0  if b > 0     */
     unitbase,           /* 1^b = 1               */
     intpowerofminusone, /* (-1)^n = \pm 1 (n even or odd) */
     powertopower,       /* (a^b)^c = a^(bc) if a>0 or c \in Z */
     minustopower,       /* (-a)^n = (-1)^na^n       */
     quotienttopower,    /* (a/b)^n = a^n/b^n        */
     producttopower,     /* (ab)^n = a^nb^n          */
     squareofsum,        /* (a+b)^2 = a^2+2ab+b^2    */
     plainbinomialtheorem,  /* expand by binomial theorem */
     collectpowers,      /* a^(b+c) =(a^b)(a^c)   */
     reversecollectpowers,   /* a^(b+c) = a^b a^c */
     poweroutoffraction, /* a^n/b^n = (a/b)^n        */
     powerstonum,        /* a^n/a^m = a^(n-m)     */
     powerstodenom       /* ab^n/b^m = a/b^(m-n)  */
    },
    {                    /* expand_powers */
     expandsquare,       /* a^2 = aa */
     expandcube,         /* a^3 = aaa */
     expandpower,        /* a^n = aaa...(n times) */
     breakpower,         /* a^n = a^?a^(n-?)      */
     squareofsum,        /* (a \pm  b)^2 = a^2 \pm  2ab + b^2 */
     cubeofsum,          /* (a + b)^3 = a^3 + 3a^2b + 3ab^2 + b^3 */
     cubeofdif,          /* (a - b)^3 = a^3 - 3a^2b + 3ab^2 - b^3 */
     reversepowertopower1, /* a^(bc) = (a^b)^c  if a>0 or c \in Z */
     reversepowertopower2, /* a^(bc) = (a^c)^b  if a>0 or c \in Z */
     reversepowertopower3, /* a^(b?) = (a^b)^?  (available with products of 3 or more terms in the exponent) */
     poweroutofrecip     /* 1/a^n = (1/a)^n       */
    },
    {                       /* negative_exponents */
     eliminateconstnegexp,  /* a^(-n) = 1/a^n (n constant) */
     eliminateconstnegexpnum,  /* a^(-n)/b = 1/(a^nb) (n constant) */
     eliminatenegexp1, /* a^-1 = 1/a    */
     eliminatenegexp,  /* a^(-n) = 1/a^n */
     eliminatenegexpnum,  /* a^(-n)/b = 1/(a^nb) */
     eliminatenegexpdenom,  /*  a/b^(-n) = ab^n */
     introducenegexp,      /* a/b^n = ab^(-n)  */
     introducenegexp1,     /*  a/b = ab^(-1)  */
     negexpofquotient,     /*  "(a/b)^(-n) = (b/a)^n" */
     powerstonum,        /* a^n/a^m = a^(n-m)     */
     powerstodenom,      /* ab^n/b^m = a/b^(m-n)  */
     reversecollectpowers2  /* a^(b-c) = a^b/a^c  */
    },
    {          /* square_roots */
      productofsqrts,   /* sqrt x sqrt y  = sqrt(xy)   */
      sqrtofproduct,    /* sqrt(xy) = sqrt x sqrt y    */
      sqrtsimp,         /* sqrt(x^2y) = x sqrt y    */
      sqrtofsquare,     /* sqrt(x^2)=x if x>=0 */
      sqrttoabs,        /* sqrt(x^2)= |x| or sqrt(x^(2n))=|x|^n */
      factorundersqrt,  /* factor integer x in sqrt x     */
      sqrtofquotient,   /* sqrt(x/y) = sqrt x /sqrt y  */
      sqrtofquotient2,  /* sqrt(x/y) = sqrt|x|/sqrt|y| */
      quotientofsqrts,  /* sqrt x /sqrt y  = sqrt(x/y) */
      cancelsqrt,       /* x/sqrt x  = sqrt x       */
      cancelsqrt2,      /* sqrt x /x = 1/sqrt x     */
      powerofsqrt,      /* (sqrt x )^(2n) = x^n if x>=0 */
      powerofsqrt2,     /* (sqrt x )^(2n+1) = x^n sqrt x   */
      evaltorational,
      computesqrt,
      weakarithmetic
     },
     {                               /* advanced_square_roots */
      cancelsqrtgcd,    /* show common factor in sqrt u/sqrt v   */
      factorpolyundersqrt,  /* factor polynomial under sqrt */
      rationalizedenom,     /* rationalize denominator   */
      rationalizenum,       /* rationalize numerator     */
      sqrttoabs,            /* sqrt(x^2)= |x| or sqrt(x^(2n))=|x|^n */
      cancelsqrt3,          /* cancel sqrt:  sqrt(xy)/sqrt y  = sqrt x   */
      multiplyoutundersqrt, /* multiply out under sqrt      */
      lauringson,           /* a^2-b = (a-sqrt b)(a+sqrt b)       */
      roottosqrt,           /* root(2,x) = sqrt(x)       */
      sqrttoroot,           /* sqrt(x) = root(2n,x^n)    */
      sqrttoroot2,          /* sqrt(x) = root(2n,x)^n    */
      sqrtofpower,          /* sqrt(x^(2n)) = x^n    */
      sqrtofpower2,         /* sqrt(x^(2n+1)) = x^n sqrt x    */
      pushundersqrt,        /* asqrt b = sqrt(a^2b) if a>=0   */
      ratdenomandsimp       /* rationalize denom and simplify */
     },
     {                    /* fractional_exponents */
      exponenttosqrt,   /* a ^ (1/2) = sqrt a          */
      exponenttosqrt,   /* a^(n/2) = sqrt(a^n)     */
      exponenttoroot,   /* a^(b/n) = root(n,a^b)   */
      sqrtexp,          /* sqrt a = a ^ (1/2)          */
      rootexp,          /* root(n,a) = a^(1/n)       */
      rootpowerexp,     /* root(n,a^m) = a^(m/n)   */
      powerrootexp,     /* (root(n,a))^m = a^(m/n)   */
      powersqrtexp,     /* (sqrt a)^m = a^(m/2)    */
      sqrtexpdenom,     /* 1/sqrt a = a^(-(1/2))       */
      rootexpdenom,     /* 1/root(n,a) = a^(-1/n)    */
      powerofminusone,  /* evaluate (-1)^(p/q) */
      factorbase,       /* factor integer a in a^(p/q) */
      fractexpdenom,    /* a/b^(p/q) = (a^q/b^p)^(1/q) */
      fractexpnum,      /* a^(p/q)/b = (a^p/b^q)^(1/q)  */
      exponenttosqrtpower,  /* $a^(n/2) = (\\sqrt a)^n$" */
      exponenttorootpower  /* $a^(m/n) = (^n\\root a)^m$ */
     },
     {             /*nth_roots */
      productofroots,   /* ^nsqrt x ^nsqrt y  = root(n,xy)    */
      rootofproduct,    /* root(n,xy) = ^nsqrt x  ^nsqrt y "  */
      rootofpower5,     /* ^nsqrt x ^m = (^nsqrt x )^m"   */
      rootsimp,         /* root(n,x^ny) = x root(n,y)  or |x|root(n,y) */
      rootofpower,      /* root(n,x^n) = x if x>=0 or n odd */
      rootofpower3,     /* root(n,x^(nm)) = x^m if x>=0 or n odd */
      rootofpower2,     /*  root(2n,x^n) = sqrt x   */
      rootofpower4,     /* root(mn,a^n) = root(m,a) */
      powerofroot,      /*  (^nsqrt x )^n = x          */
      powerofroot2,     /*  (root(n,a))^m = root(n,a^m)) */
      powerofroot3,     /* (root(n,a))^(qn+r) = a^q root(n,a^r)  */
      factorunderroot,  /*  factor x in ^nsqrt x      */
      rootofminus,      /* root(n,-a) = -root(n,a), n odd */
      evaltorational,   /* evaluate to rational */
      factorpolyunderroot, /* factor polynomial under ^nsqrt */
      multiplyoutunderroot  /* multiply out under ^nsqrt */
     },
     {                  /* roots_of_roots */
      sqrtofsqrt,       /* sqrt(sqrt(x)) = root(4,x)    */
      sqrtofroot,       /* sqrt(root(n,x)) = root(2n,x) */
      rootofsqrt,
      rootofroot
     },
     {            /* roots_and_fractions  */
      rootofquotient,   /* root(n,x/y) = ^nsqrt x /^nsqrt y         */
      quotientofroots,  /* ^nsqrt x /^nsqrt y  = root(n,x/y)        */
      cancelroot,       /* x/^nsqrt x  = (^nsqrt x )^(n-1)      */
      cancelroot2,      /* ^nsqrt x /x = 1/(^nsqrt x )^(n-1)    */
      cancelroot3,      /* cancel under ^nsqrt: root(n,ab)/root(n,bc)=root(n,a)/root(n,b) */
      cancelroot3,      /* cancel ^nsqrt:  root(n,xy)/^nsqrt y  = ^nsqrt x   */
      cancelrootgcd,    /* show common factor in root(n,u)/root(n,v) */
      pushunderoddroot, /*  a(root(n,b)) = root(n,a^nb) if n odd */
      pushunderevenroot, /*  a(root(n,b)) = root(n,a^nb) if a>=0 */
      pushminusunderroot, /* -root(n,a) = root(n,-a) if n odd  */
      rootdenom,         /* a/root(n,b) = root(n,a^n/b) (n odd or a>=0) */
      rootnum,           /* root(n,a)/b = root(n,a/b^n) (n odd or b>0) */
      sqrtnum,           /* sqrt a/b = sqrt(a/b^2) if b>0    */
      sqrtdenom,         /* a/sqrt b = sqrt(a^2/b) if a>=0    */
      powerofroot4,      /*  root(mn,a)^n = root(m,a) */
      powerofroot5     /*   root(2n,a)^n = sqrt a */
     },
     {                /* complex_numbers */
      recipofi,       /*  1/i = -i       */
      recipofi2,      /*  a/i = -ai      */
      recipofi3,      /*  a/bi = -ai/b   */
      sqrtofminus1,   /* sqrt(-1) = i       */
      sqrtofneg,      /*  sqrt(-a) = isqrt a if a>=0 */
      cleardenomofi,  /*  clear denominator of i */
      multiplycomplexconjugates,   /* (a-bi)(a+bi) = a^2+b^2 */
      sumofsquares,    /* a^2+b^2 = (a-bi)(a+bi)      */
      squareofabs,         /* |u + vi|^2 = u^2 + v^2 */
      complexabs,      /* |u + vi| = sqrt(u^2 + v^2) */
      complexapart,    /* (u+vi)/w = u/w + (v/w)i */
      complexform,     /* write in form x+yi */
      sqrtofi,         /* sqrt(bi) = (sqrt(b/2) + sqrt(b/2) i) if b >= 0 */
      sqrtofminusi,    /* sqrt(-bi) = sqrt(b/2) - sqrt(b/2) i) if b >= 0 */
      sqrtofaplusbi,   /* sqrt(a+bi) = (sqrt((c+a)/2) + sqrt((c-a)/2) i) if b >= 0, where c^2 = a^2+b^2 */
      sqrtofaminusbi   /* sqrt(a-bi) = (sqrt((c+a)/2) - sqrt((c-a)/2) i) if b >= 0, where c^2 = a^2+b^2 */
     },
     {                          /* factoring                    */
      factoroutnumber,          /* factor out number            */
      cleardenoms,              /* clear numerical denominators */
      contentfactor,            /* ab + ac = a(b+c)             */
      contentfactor,            /* factor out highest power     */
      factorsquareofsum,        /* a^2+2ab+b^2 = (a+b)^2           */
      factorsquareofdif,        /* a^2-2ab+b^2 = (a-b)^2"          */
      differenceofsquares,      /* a^2-b^2 = (a-b)(a+b)           */
      factorquadratic,          /* factor quadratic trinomial   */
      quadraticformula,         /* use quadratic formula        */
      writeassquare,            /* a^(2n) = (a^n)^2                  */
      prodofpowers,             /* a^nb^n = (ab)^n                 */
      factorcoefficients,       /* factor integer coefficients  */
      factorinteger,            /* factor integer               */
      makesubstitution,
      unwinddefinition,
      regardvarasconst,
     },
     {                            /* advanced_factoring */
      invisiblesub,         /* write it as a function of ?          */
      makesubstitution2,    /* write it as a function of ? and ?    */
      writeascube,          /* a^(3n) = (a^n)^3                     */
      writeaspower,         /* a^(?n) = (a^n)^?                     */
      differenceofcubes,    /* a^3 - b^3 = (a-b)(a^2+ab+b^2)          */
      sumofcubes,            /* a^3 + b^3 = (a+b)(a^2-ab+b^2)         */
      differenceofnthpowers, /* a^n-b^n = (a-b)(a^(n-1)+...+b^(n-1))  */
      differenceofnth2,      /* a^n-b^n = (a+b)(a^(n-1)-...-b^(n-1)) (n even)  */
      sumofnthpowers,        /* a^n+b^n = (a+b)(a^(n-1)-...+b^(n-1)) (n odd) */
      sumoffourthpowers, /* x^4+a^4=(x^2-sqrt2ax+a^2)(x^2+sqrt2ax+a^2)        */
      factorquartic,     /* x^4+(2p-q^2)x^2+p^2=(x^2-qx+p)(x^2+qx+p)     */
      autosubstitution,  /* computer makes substitution             */
      guessfactor,       /* guess a factor                          */
      factorbypolydiv,   /* search for linear factor                */
      factorbygrouping,  /* factor by grouping                      */
      writeaspoly       /* write it as a polynomial in ?           */
     },
     {                   /* solve_equations */
      switchsides,       /* switch sides                */
      changesigns,       /* change signs of both sides  */
      addeqn,            /* add to both sides           */
      subeqn,            /* subtract from both sides    */
      transfer1,         /* transfer term left to right */
      transfer2,         /* transfer term right to left */
      muleqn,            /* multiply both sides         */
      diveqn,            /* divide both sides           */
      squareeqn,         /* square both sides           */
      cancelterm,        /* cancel \pm  term from both sides */
      cancelfactor,      /* cancel common factor of sides */
      alltoleft,         /* subtract to put in form u=0  */
      trueeqn,           /* equation is identically true */
      pseudosquare,      /* a=-b becomes a^2=-b^2 if a,b>=0 */
      pseudosquare2,     /* a=-b becomes a=0 if a,b>=0    */
      pseudosquare3      /* a=-b becomes b=0 if a,b>=0    */
     },
     {                   /* quadratic_equations  */
      spliteqn,          /* if ab = 0 then a=0 or b=0    */
      quadraticformula,
      quadraticformula,    /* no mistake, it's there twice */
      completethesquare,
      sqrteqn,
      crossmultiply,
      negativediscriminant,
      introduceabs,       /* [u^2=a, u^2=-a] iff u^2 = |a| */
      arithmetic
     },
     {                          /* numerical_equations*/
      evalatpoint,
      solvenumerically
     },
     {                          /* advanced_equations*/
      crossmultiply,            /* cross multiply (a/b=c/d=>ad=bc) */
      powereqn,                 /* if u=v then u^n=v^n               */
      sqrteqn,                  /* take sqrt of both sides            */
      rooteqn,                  /* take root(n,  of both sides          */
      functioneqn,              /* apply function to both sides    */
      commondenom,              /* common denominator              */
      spliteqn,                 /* if ab=0 then a=0 or b=0         */
      spliteqn2,                /* if ab=ac then a=0 or b=c        */
      selecteqn,                /* select one equation             */
      showalleqns,
      collectmultiplesolns,
      makesubstitution,
      unwinddefinition,
      rejecteqn,                /* reject unsolvable equation      */
      checkroot,                /* check root(s) in original eqn   */
      solvelinear               /* solve linear equation at once   */
     },
     {                                  /* cubic_equations       */
      eliminatequadraticterm,
      computediscriminant,
      showcallingcubic,       /* if number changes adjust autosimp.c */
      viete,
      realcardan,
      cardan2,
      cardan,
      reversesub,
      unwinddefinition,
      translatevar,
      arithmetic,
      devalop,
      polyvalop
     },
     {                                  /* logarithmic_equations  */
      powereqn2,                       /* if u=v then a^u = a^v  */
      powereqn3,                       /* if ln u = v then u = e^v */
      powereqn4,                       /* if log u = v then u = 10^v */
      powereqn5,                       /* if log(b,u) = v then u = b^v */
      logbeqn,                         /* if a^u = a^v then u=v  */
      logeqn,                          /* take log of both sides */
      lneqn,                           /* take ln of both sides  */
      rejecteqn                        /* reject eqn--impossible log or ln */
     },
     {                                  /* cramers_rule */
      cramersrule,
      evaluatedeterminant
     },
     {                                  /* several_linear_equations */
      varsleft,
      eqnscollectall,
      lineupvars,        /* if this is changed, change in_loop in top.c */
      addtwoeqns,
      subtwoeqns,
      muleqns,
      diveqns,
      addmuleqns,
      submuleqns,
      swapeqns,
      ordereqns,
      dropeqn,           /* drop identity */
      regardvarasconst,  /* regard variable as constant */
      impossibleeqns
     },
     {                                 /* selection_mode_only           */
      multabs,                         /* a|b| = |ab| if 0 <=a          */
      divabs,                          /* |b|/c = |b/c| if 0 < c        */
      divabs2,                         /* a|b|/c = |ab/c| if 0 < a/ c   */
      solvelinearfor
     },
     {                                 /* linear_equations_by_selection   */
                                       /* if these change you must change */
                                       /* execute in execute.c as well as */
                                       /* needs_two_args in needsarg.c    */
      addselectedeqn,
      subselectedeqn,
      mulselectedeqn,
      divselectedeqn,
      addmulselectedeqn,
      submulselectedeqn,
      swapselectedeqn,
      solveselectedeqn,
      addselectedrow,
      subselectedrow,
      mulselectedrow,
      divselectedrow,
      addmulselectedrow,
      submulselectedrow,
      swapselectedrow,
      multbymatrixidentity
     },
     {                                 /* linear_equations_by_substitution */
      eqnscollectall,          /* collect like terms      */
      solveone,                /* solve equation ? for ?  */
      polyvalop,               /* simplify equations      */
      eqnscancelterm,          /* cancel term from both sides */
      eqnsaddterm,             /* add ? to both sides of equation ? */
      eqnssubterm,             /* subtract ? from both sides of equation ? */
      diveqns,                 /* divide equation ? by ?  */
      substforvar,             /* substitute for variable in all equations */
      impossibleeqns
     },
     {                                 /* matrix_methods */
      matrixform,
      multbyidentity,
      swaprows,
      addrows,
      subrows,
      mulrows,
      divrows,
      addmulrows,
      submulrows,
      multiplymatrices,
      dropzerocolumn,
      dropzerorow,
      dropduplicaterow,
      impossibleeqns,
      convertmatrixeqn
     },
     {                                /* advanced matrix methods */
      multiplymatrices,
      dividebymatrix,
      twobytwoinverse,
      exactmatrixinverse,
      decimalmatrixinverse
     },
     {                                  /* absolute_value */
                            /* change needs_index_arg if these change */
      abspos,               /* |u| = u  if u>=0            */
      absposandassume,      /* Assume u>=0 and set |u| = u */
      absneg,               /* |u| = -u if u<=0            */
      abslinear,            /* |cu| = c|u| if c>=0         */
      abslinearquo,         /* |u/c| = |u|/c if c>0       */
      multiplyabsval,       /* |u||v| = |uv|              */
      absofproduct,         /* |uv| = |u||v|              */
      absoffraction,        /* |u/v| = |u| / |v|          */
      fractionofabs,        /* |u| / |v| = |u/v|          */
      absevenpower,         /* |u|^(2n)=u^(2n) if u is real  */
      abspower,             /* |u^n|=|u|^n if n is real   */
      abssqrt,              /* |sqrt u| = sqrt|u|         */
      absroot,              /* |root(n,u)| = root(n,|u|)  */
      cancelabs3,           /* |ab|/|ac| = |b|/|c|        */
      cancelabs3,           /* |ab|/|a| = |b|             */
      cancelabsgcd          /* show common factor in |u|/|v| */
     },
     {              /* absolute_value_ineq1 */
      abseqn,       /* |u|=c iff u=c or u = -c    */
      abseqn2,      /* |u|/u=c iff c=\pm 1 */
      abslessthan,  /* |u|<v iff -v < u < v */
      absle,       /* |u|<=v iff -v <=u <=v */
      lessthanabs, /* u<|v| iff u<-v or u<v */
      leabs,       /* u<=|v| iff u<=-v or u<=v */
      abseqntoineq1, /* |u| = u iff 0 <=u   */
      abseqntoineq2, /* |u| = -u iff u <=0  */
      absineqtrue,  /* 0 <=|u| is true */
      absineqtrue2,  /* -c <=|u| is true (c>=0) */
      absineqtrue3,  /* -c < |u| is true (c>0) */
      absineqfalse,  /* |u| < 0 is false */
      abslessthanneg,    /* |u| < -c is false (c>=0) */
      absleneg,   /* |u| <=-c is false (c>0) */
      absleneg2,     /* |u| <=-c iff u=0 assuming c=0 */
      abseqnneg      /* |u| = -c iff u=0 assuming c=0 */
     },
     {               /* absolute_value_ineq2 */
      absgreaterthan,  /* v > |u| iff -v < u < v */
      absge,          /* v >=|u| iff -v <=u <=v */
      greaterthanabs, /* |v|> u iff v < -u or v > u */
      geabs,          /* |v|>=u iff v <=-u or v>=u */
      absineqtrueg,   /* |u| >= 0 is true */
      absineqfalseg,  /* 0 > |u| is false */
      absgreaterthanneg, /* -c > |u| is false (c>=0) */
      absgeneg,       /* -c >= |u| is false (c>0) */
      absgeneg2,      /* -c >= |u| iff u=0 assuming c=0 */
      absineqtrue3g,  /* |u| > -c is true (c>0) */
      absineqtrue2g,  /* |u| >= -c is true (c>=0) */
      intervaltoabs1, /* -a <= u <= a iff |u| <= a */
      intervaltoabs2, /* -a < u < a iff |u < a */
      absevenpowerrev, /* u^(2n) = |u|^(2n) if u is real */
      abspowerrev     /*|u|^n =  |u^n| if n is real     */
     },
     {                                /* less_than */
      reverselessthan,     /* change u < v to v > u */
      addeqn1,           /* add ? to both sides       */
      subeqn1,           /* subtract ? from both sides */
      changesigns1,      /* change  -u < -v to v < u    */
      changesignsandsense1, /*  change -u < -v to u > v */
      mulineq,           /* multiply both sides by ? */
      mulineqsq,         /* multiply both sides by ?^2 */
      divineq,           /* divide both sides by ?    */
      numericalineq,     /* evaluate numerical inequality */
      evenpowerineq1,    /*  a < x^2n true if a < 0    */
      evenpowerineq3,    /*  x^2n < a false if a <= 0  */
      squareineq1,       /* square both sides          */
      squareineq3,       /* u < v iff u^2 < v^2 or u <=0 provided v > 0 */
      lessthantole,      /* u < v or u = v becomes u <=v */
      combineintervals,  /* combine intervals    */
      explicitdomain     /* use assumptions      */
     },
     {                              /* greater_than */
      reversegreaterthan,   /* change x > y to y < x      */
      changesignsandsense3, /*  change -u > -v to u < v   */
      changesigns1g,        /* change  -u > -v to v > u   */
      evenpowerineq1,    /*  x^2n > a is true if a < 0    */
      evenpowerineq3g,   /*  a > x^2n is false if a <= 0  */
      squareineq3g,      /* v > u  iff v^2 > u^2 or u < 0 provided 0 <=v */
      greaterthantoge    /* u > v or u = v iff u >= v */
     },
     {                              /* less_than_or_equal */
      reversele,         /* change x <=y to y >= x            */
      addeqn2,           /* add ? to both sides    */
      subeqn2,           /* subtract ? from both sides */
      changesigns2,      /* change u <=-v to v <=u */
      changesignsandsense2, /* change -u <=-v to u >= v */
      mulineq,           /* multiply both sides by ? */
      mulineqsq,         /* multiply both sides by ?^2 */
      divineq,           /* divide both sides by ?    */
      numericalineq,     /* evaluate numerical inequality */
      evenpowerineq2,    /* a <= x^2n true if a <= 0  */
      evenpowerineq4,    /*  x^2n <= a false if a < 0  */
      squareineq2,       /* square both sides          */
      squareineq4,       /* u <=v => u^2 <=v^2 or u <=0 */
      combineintervals,  /* combine intervals         */
      explicitdomain     /* use assumptions           */
     },
     {                            /* greater_than_or_equal */
      reversege,         /* change x >= y to y <=x */
      changesignsandsense4, /* change -u >= -v to u <=v */
      changesigns2g,     /* change -u >= -v to v >= u */
      evenpowerineq2g,   /* x^(2n) >= a is true if a <=0 */
      evenpowerineq4g,   /* a >= x^(2n) is false if a < 0 */
      squareineq4g       /* v >= u iff v^2 >= u^2 or u <=0 provided 0 <=v */
     },
     {                            /* square_ineq1 */
      sqrtineq11,   /* u^2 < a iff |u| < sqrt a         */
      sqrtineq14,   /* u^2 < a iff -sqrt a < u < sqrt a       */
      sqrtineq12,   /* 0 <=a < v^2 iff sqrt a < |v|     */
      sqrtineq15,   /* a < u^2 iff u < -sqrt a or sqrt a < u */
      sqrtinterval1,/* a<u^2<b iff -sqrt b<u<-sqrt a or sqrt a<u<sqrt b */
      sqrtinterval3,/* -a<u^2<b iff u^2 < b provided 0<a */
      sqrtinterval5,/* -a<u^2<=b iff u^2 <=b provided 0<a */
      powerineq11,  /* sqrt u < v iff u < v^2               */
      squareineq1,  /* 0 <=asqrt u < v iff 0 <=a^2u < v^2    */
      powerineq12,  /* a < sqrt v iff a^2 < v provided 0<=a  */
      sqrtineq13,   /* 0 <=u < v iff sqrt u < sqrt v           */
      squaretrue1,  /* a < x^2  is true if a < 0       */
      squarefalse1, /* x^2 < a is false if a <= 0      */
      sqsqrtineq1   /* -a < sqrt u  iff 0 <=u provided a>0 */
     },
     {                            /* square_ineq2 */
      sqrtineq21,   /* u^2 <=a iff |u| <=sqrt a             */
      sqrtineq24,   /* u^2 <=a iff -sqrt a <=u <=sqrt a         */
      sqrtineq22,   /* a <=v^2 iff sqrt a <=|v| provided 0<=a*/
      sqrtineq25,   /* a <=u^2 iff u <=-sqrt a or sqrt a <=u    */
      sqrtinterval2,/* a<=u^2<=b iff -sqrt b<=u<=-sqrt a or sqrt a<=u<=sqrt b */
      sqrtinterval4,/* -a<=u^2<=b iff u^2 <=b provided 0<=a */
      sqrtinterval6,/* -a<=u^2<b iff u^2 < b provided 0<=a */
      powerineq21,  /* sqrt u <=v iff 0 <=u <=v^2           */
      squareineq2,  /* 0 <=asqrt u <=v iff 0 <=a^2u <=v^2    */
      powerineq22,  /* a <=sqrt v iff a^2 <=v provided 0<=a  */
      sqrtineq23,   /* 0 <=u <=v iff sqrt u <=sqrt v",         */
      squaretrue2,  /* a <= x^2 is true if a < 0       */
      squarefalse2, /* x^2 <= a is false if a <= 0     */
      sqsqrtineq2   /* -a <=sqrt u iff 0 <=u provided a>=0  */
     },
     {                             /* recip_ineq1 */
      recipineq11,  /* 1/x < a iff x<0 or 1/a < x provided a > 0 */
      recipineq21,  /* a < 1/x iff 0 < x < 1/a provided a > 0 */
      recipineq31,  /* 1/x < -a iff -1/a < x < 0 provided a > 0 */
      recipineq41,  /* -a < 1/x iff x < -1/a or 0 < x provided a > 0 */
      recipinterval11,  /* a < 1/x < b iff 1/b < x < 1/a provided a,b > 0 */
      recipinterval21,  /* a < 1/x <=b iff 1/b <=x < 1/a provided a,b > 0 */
      recipinterval31,  /* -a < 1/x < -b iff -1/b < x < -1/a provided a,b > 0 */
      recipinterval41,  /* -a < 1/x <=-b iff -1/b <=x < -1/a provided a,b > 0 */
      recipinterval51,   /* -a < 1/x < b iff x < - 1/a or 1/b < x (a,b > 0) */
      recipinterval61   /* -a < 1/x <=b iff x < -1/a or 1/b <=x (a,b > 0) */
     },
     {                             /* recip_ineq2 */
      recipineq12,  /* 1/x <=a iff x<0 or 1/a <=x provided a > 0 */
      recipineq22,  /* a <=1/x iff 0 < x <=1/a provided a > 0 */
      recipineq32,  /* 1/x <=-a iff -1/a <=x < 0 provided a > 0 */
      recipineq42,  /* -a <=1/x iff x <=-1/a or 0 < x provided a > 0 */
      recipinterval12,  /* a <=1/x < b iff 1/b < x <=1/a provided a,b > 0 */
      recipinterval22,  /* a <=1/x <=b iff 1/b <=x < 1/a provided a,b > 0 */
      recipinterval32,  /* -a <=1/x < -b iff -1/b < x <=-1/a provided a,b > 0 */
      recipinterval42,  /* -a <=1/x <=-b iff -1/b <=x <=-1/a provided a,b > 0 */
      recipinterval52,   /* -a <=1/x < b iff x <=- 1/a or 1/b < x (a,b > 0) */
      recipinterval62   /* -a <=1/x <=b iff x <=-1/a or 1/b <=x (a,b > 0) */
     },
     {                             /* root_ineq1 */
      oddrootineq,  /* u < v iff root(n, u) < root(n, v) (n odd) */
      rootineq11,   /* u^(2n) < a iff |u| < root(2n, a)      */
      rootineq13,   /* u^(2n) < a iff -root(2n,a) < u < root(2n,a)      */
      rootineq12,   /* 0 <=a < v^(2n) iff root(2n,a) < |v|  */
      rootineq15,   /* a < u^(2n) iff u < -root(2n,a)  or root(2n,a) < u  */
      rootinterval1,/* a<u^(2n)<b iff -root(2n,b)<u<-root(2n,a) or root(2n,a)<u<root(2n,b) */
      powerineq14even,  /* ^(2n)sqrt u < v iff 0 <=u < v^(2n) */
      powerineq14odd, /* root(n, u) < v iff u < v^n (n odd or u>=0)  */
      powerineq13,  /* a root(n, u) < v iff a^n u < v^n provided 0 <=a root(n, u) */
      powerineq15,  /* u < root(n, v) iff u^n < v  provided 0 <=u */
      powerineq16,  /* u < v iff u^n < v^n (n odd, n>0) */
      powerineq17,  /* u < v iff u^n < v^n (n > 0 and 0 <=u) */
      powerrootineq1 /* a < ^(2n)sqrt u iff 0 <=u   provided a < 0 */
     },
     {                                    /* root_ineq2 */
      oddrootineq2,  /* u <=v iff root(n, u) <=root(n,v) (n odd) */
      rootineq21,   /* u^(2n) <=a iff |u| <=root(2n,a) */
      rootineq23,   /* u^(2n) <=a iff -root(2n,a) <=u <=root(2n,a)      */
      rootineq22,   /* a <=v^(2n) iff root(2n,a) <=|v| provided a>=0 */
      rootineq25,   /* a <=u^(2n) iff u iff -root(2n,a)  or root(2n,a) <=u  */
      rootinterval2,/* a<=u^(2n)<=b iff -root(2n,b)<=u<=-root(2n,a) or root(2n,a)<=u<=root(2n,b) */
      powerineq24even,/* ^(2n)sqrt u <=v iff 0 <=u <=v^(2n)  */
      powerineq24odd, /* root(n,u) <=v iff u <=v^n (n odd or u>=0)   */
      powerineq23,  /* a(root(n,u)) <=v iff a^nu <=v^n provided 0 <=a(root(n,u)) */
      powerineq25,  /* u <=root(n,v) iff u^n <=v provided 0 <=u */
      powerineq26,  /* u <=v iff u^n <=v^n (n odd, n >= 0) */
      powerineq27,  /* u <=v iff u^n <=v^n (n > 0 and 0 <=u) */
      powerrootineq2 /* a <=^(2n)sqrt u iff 0 <=u   provided a <=0 */
     },
     {                                 /* zero_ineq1 */
      droppositive1,     /* drop positive factors */
      posnum1,          /* 0 < a/v iff 0 < v provided a > 0 */
      mulineqsqrt1,      /* 0 < u/sqrt v => 0 < uv  */
      mulineqbysquare1,   /* 0 < u/v iff 0 < uv */
      mulineqsqrt2,       /* u/sqrt v < 0 => uv < 0 */
      mulineqbysquare2,    /* u/v < 0 iff uv < 0  */
      normalizelinear1,   /* ax \pm  b < 0 iff a(x\pm b/a) < 0 */
      reverselessthan,     /* change u < v to v > u  */
      intervalsneg1,     /* (x-a)(x-b)... < 0 iff a<x<b...(where a<b) */
      intervalspos1      /* 0 < (x-a)(x-b)... iff x<a or b<x...(where a<b) */
     },
     {                                 /* zero_ineq2 */
      droppositive2,      /* drop positive factors */
      posnum2,            /* 0 <=u/v => 0 <=v if u >= 0 */
      mulineqsqrt3,       /* 0 <=u/sqrt v => 0 <=uv   */
      mulineqbysquare3,   /* 0 <=u/v => 0 < uv or u = 0 */
      mulineqsqrt4,        /* u/sqrt v <=0 => uv <=0   */
      mulineqbysquare4,    /* u/v <=0 iff uv < 0 or u=0 */
      normalizelinear2,    /* ax \pm  b <=0 iff a(x\pm b/a) <=0 */
      reversele,        /* change u <=v to v >= u  */
      intervalsneg2,    /* (x-a)(x-b)...<=0 => a<=x<=b...(where a<=b) */
      intervalspos2     /* 0<=(x-a)(x-b)...iff x<=a or b<=x...(where a<=b) */
     },
     {                            /* square_ineq3 */
      sqrtineq11g,          /* a > u^2 iff sqrt a > |u|               */
      sqrtineq14g,          /* a > u^2 iff -sqrt a < u < sqrt a           */
      sqrtineq12g,           /* v^2 > a iff |v| > sqrt a provided a>=0 */
      sqrtineq15g,           /* u^2 > a iff u < -sqrt a  or u > sqrt a    */
      powerineq11g,          /* v > sqrt u iff 0 <=u < v^2            */
      squareineq1g,          /* v>asqrt u iff 0<=a^2u<v^2 provided 0<=a  */
      powerineq12g,          /* sqrt v > a iff v > a^2 provided 0<=a   */
      sqrtineq13g,           /* v > u  iff sqrt v > sqrt u provided u>=0  */
      squaretrue1g,          /* x^2 > a is true if a < 0         */
      squarefalse1g,         /* a > x^2 is false if a <= 0       */
      sqsqrtineq1rev         /* sqrt u > -a  iff u >= 0 provided a>0  */
     },
     {                            /* square_ineq4 */
      sqrtineq21g,          /* a >= u^2 iff sqrt a >= |u|             */
      sqrtineq24g,          /* a >= u^2 iff -sqrt a <=u <=sqrt a         */
      sqrtineq22g,          /* v^2 >= a iff |v| >= sqrt a provided 0<=a */
      sqrtineq25g,          /* u^2 >= a iff u <=-sqrt a or sqrt a <=u    */
      powerineq21g,         /* v >= sqrt u iff 0 <=u <=v^2           */
      squareineq2g,         /* v >= asqrt u iff 0<=a^2u<=v^2 provided 0<=a */
      powerineq22g,         /* sqrt v >= a iff v >= a^2 provided 0<=a  */
      sqrtineq23g,          /* v >= u iff sqrt v >= sqrt u provided u>=0  */
      squaretrue2g,         /* x^2 >= a is true if a <=0        */
      squarefalse2g,        /* a >= x^2 is false if a < 0       */
      sqsqrtineq2rev        /* sqrt u >= -a  iff u >= 0 provided a>=0 */
     },
     {                           /* recip_ineq3 */
      recipineq11g,  /* a > 1/x  iff x<0 or x > 1/a provided a > 0 */
      recipineq21g,  /* 1/x > a iff 0 < x < 1/a provided a > 0 */
      recipineq31g,  /* -a > 1/x iff -1/a < x < 0 provided a > 0 */
      recipineq41g  /* 1/x > -a  iff x < -1/a or x > 0 provided a > 0 */
     },
     {                           /* recip_ineq4 */
      recipineq12g,  /* a >= 1/x  iff x<0 or x >= 1/a provided a > 0 */
      recipineq22g,  /* 1/x >= a iff 0 < x <=1/a provided a > 0 */
      recipineq32g,  /* -a <=1/x iff -1/a <=x < 0 provided a > 0 */
      recipineq42g  /* 1/x >= -a  iff x <=-1/a or x > 0 provided a > 0 */
     },
     {                             /* root_ineq3 */
      oddrootineqg,  /* u > v iff root(n,u) > root(n,v) (n odd)          */
      rootineq11g,   /* a > u^(2n) iff root(2n,a) > |u|               */
      rootineq13g,   /* a > u^(2n) iff -root(2n,a) < u < root(2n,a)         */
      rootineq12g,   /* u^(2n) > a iff |u| > root(2n,a)  provided a>=0 */
      rootineq15g,   /* u^(2n) > a iff u < -root(2n,a)  or u > root(2n,a)   */
      powerineq14eveng,  /* v > ^(2n)sqrt u  iff 0 <=u < v^(2n)            */
      powerineq14oddg, /* v > root(n,u) iff v^n> u (n odd or u>=0)  */
      powerineq13g,  /* v > a(root(n,u)) iff v^n > a^nu provided 0 <=a(root(n,u)) */
      powerineq15g,  /* root(n,v) > a iff v > a^n provided a>=0      */
      powerineq16g,  /* u > v iff u^n > v^n (n odd, n>0)       */
      powerineq17g,  /* u > v iff u^n > v^n (n > 0 and 0 <=u)  */
      powerrootineq1rev /* ^(2n)sqrt u > a iff u >= 0 provided a < 0 */
     },
     {                                    /* root_ineq4 */
      oddrootineq2g,  /* u >= v iff root(n,u) >= root(n,v) (n odd)          */
      rootineq21g,   /* a >= u^(2n) iff root(2n,a) >= |u|                */
      rootineq23g,   /* a >= u^(2n) iff -root(2n,a) <=u <=root(2n,a)          */
      rootineq22g,   /* u^(2n) > a iff |u| > root(2n,a)  provided a>=0  */
      rootineq25g,   /* u^(2n) >= a iff u <=-root(2n,a)  or u >= root(2n,a)    */
      powerineq24eveng,  /* v >= ^(2n)sqrt u iff 0 <=u <=v^(2n)              */
      powerineq24oddg,  /* v >= root(n,u) iff v^n >= u (n odd or u>=0)  */
      powerineq23g,  /* v >= a(root(n,u)) iff v^n >= a^nu provided 0 <=a(root(n,u)) */
      powerineq25g,  /* root(n,v) >= a iff a^n <=v provided a >= 0     */
      powerineq26g,  /* u >= v iff u^n >= v^n (n odd, n >= 0)      */
      powerineq27g,  /* u >= v iff u^n >= v^n (n > 0 and 0 <=u)   */
      powerrootineq2rev /* ^(2n)sqrt u >= a iff u >= 0 provided a <=0 */
     },
     {                                 /* zero_ineq3 */
      posnum1g,            /* u/v > 0 iff v > 0 provided u > 0 */
      mulineqsqrt1g,       /* change u/sqrt v > 0 to uv > 0        */
      mulineqbysquare1g,   /* u/v > 0 iff uv > 0               */
      mulineqsqrt2g,       /* change 0 > u/sqrt v to 0 > uv        */
      mulineqbysquare2g,   /* 0 > u/v iff 0 > uv               */
      normalizelinear1g,   /* 0 > ax \pm  b iff 0 > a(x\pm b/a)      */
      intervalsneg1g,      /* 0 > (x-a)(x-b) iff a<x<b  (where a<b) */
      intervalspos1g       /* (x-a)(x-b) > 0 iff x<a or x>b (where a<b) */
     },
     {                                 /* zero_ineq4 */
      posnum2g,            /* u/v >= 0 iff v >= 0 provided u >= 0  */
      mulineqsqrt3g,       /* u/sqrt v >= 0 iff uv >= 0               */
      mulineqbysquare3g,   /* u/v >= 0 iff uv > 0 or u = 0       */
      mulineqsqrt4g,       /* 0 >= u/sqrt v iff 0 >= uv               */
      mulineqbysquare4g,   /* 0 >= u/v iff 0 > uv or u = 0       */
      normalizelinear2g,   /* 0 >= ax \pm  b iff 0 >= a(x\pm b/a)       */
      intervalsneg2g,      /* 0 >= (x-a)(x-b) iff a<=x<=b (where a<=b) */
      intervalspos2g       /* (x-a)(x-b)>=0 iff x<=a or b<=x (where a<=b) */
     },
     {                            /* binomial_theorem */
      plainbinomialtheorem,       /* expand by binomial theorem  */
      binomialtheorem,
      binomialcoeftofactorials,    /*  (n k) = n!/((n-k)!k!) */
      defnoffactorial,             /* n! = n(n-1)(n-2)...1 */
      evaluatefactorial,
      arithmetic,
      evaluatebinomialcoef,
      sigmatosum,                  /* expand sum  notation */
      evaluatesigmatorational,
      factorialrecursion,          /* n! = n (n-1)!  */
      cancelfactorial1,            /* n!/n = (n-1)! */
      cancelfactorial2,            /* n!/(n-1)! = n  */
      cancelfactorial3,            /* n!/k! = n(n-1)...(n-k+1) */
      cancelfactorial1b,           /* n/n! = 1/(n-1)! */
      cancelfactorial2b,           /* (n-1)!/n! = 1/n  */
      cancelfactorial3b            /* k!/n! =1/(n(n-1)...(n-k+1)) */
     },
     {                            /* factor_expansion */
      factorcubeofsum,
      factorcubeofdif,
      factor4thofsum,
      factor4thofdif,
      factornthofsum,    /* a^n+na^(n-1)b+...b^n = (a+b)^n */
      factornthofdif,
      factorquadraticwithdisplay  /* like factorquadratic, but uses display_progress */
     },
     {                              /* sigma_notation */
      sigmaconstant,          /* sum  1=number of terms */
      minusoutofsigma,        /* sum  -u = -sum  u  */
      constantoutofsigma,     /* sum  cu = csum  u (c const) */
      sigmasum,               /*  sum (u+v) = sum u + sum v  */
      sigmasum,               /* sum (u-v) = sum u - sum v */
      sigmatosum,             /* expand sum  using + */
      sumofi,                 /* 1+2+..+n = n(n+1)/2 */
      sumofisquared,          /* 1^2+..+n^2 = (2n+1)(n+1)n/6 */
      sumofallpowers,         /* 1+x+..+x^n=(1-x^(n+1))/(1-x) */
      showfirstterms,         /* show first few terms */
      evaluatesigmatorational,/* evaluate sum for specified value of free var */
      evaluatesigmatodecimal, /* evaluate sum for specified value of free var */
      evalpuresigmatorational,/* evaluate sum with no free variables */
      evalpuresigmatodecimal, /* evaluate sum with no free variables */
      sigmapoly,              /* express summand as polynomial      */
      telescopingsum
     },
     {                      /* advanced_sigma_notation */
      shiftindex,
      renameindexvariable,
      productofsigmas,        /* (sum u)(sum v) = sum  sum  uv */
      splitofflastterm,
      sumoficubed,
      sumofitothefourth,
      difsigma,            /* d/dx sum u = sum  du/dx */
      reversedifsigma,     /* sum  du/dx = d/dx sum u */
      intsigma,            /* sum  integral u dx = integral  sum u dx */
      reverseintsigma,     /* sum  integral u dx = integral  sum u dx */
      constantintosigma,     /*csum  u = sum  cu(c const) */
      sumtodifofsums0,      /* sigma(t,i,a,b)=sigma(t,i,0,b)-sigma(t,i,0,a-1)$$ */
      sumtodifofsums,       /* sigma(t,i,a,b)=sigma(t,i,c,b)-sigma(t,i,c,a-1)$$ */
     },
     {                           /* prove by induction */
      selectinductionvariable,
      basiscase,
      inductionstep,
      useinductionhyp,
      thereforeasdesired
     },
     {                      /* trig_ineq */
       abssinineq,   /* |sin u| <=1 */
       abscosineq,   /* |cos u| <=1 */
       sinineq,      /* sin u <=u  if u>=0 */
       coslowerbound,   /* 1 - u^2/2 <=cos u */
       absarctanineq,   /* |arctan u| <= pi /2  */
       arctanineq,      /* arctan u <=u if u>=0 */
       tanineq          /* tan u >= u if u>=0 */
     },
     {                      /* log_ineq1  */
       lnineq1,      /* u < v iff ln u < ln v provided u>0   */
       logineq1,     /* u < v iff log u < log v provided u>0 */
       lnrightineq1, /* u < ln v iff e^u < v                 */
       lnleftineq1,  /* ln u < v iff u < e^v                 */
       logrightineq1,/* u < log v iff 10^u < v               */
       logleftineq1, /* log u < v iff u < 10^v               */
       expineq1     /* u < v iff a^u < a^v  if a > 0, takes arg in menu mode */
     },
     {                      /* log_ineq2  */
       lnineq2,     /* u <=v => ln u <=ln v provided u>0   */
       logineq2,    /* u <=v => log u <=log v provided u>0 */
       lnrightineq2, /* u <=ln v iff e^u <=v                 */
       lnleftineq2,  /* ln u <=v iff u <=e^v                 */
       logrightineq2,/* u <=log v iff 10^u <=v               */
       logleftineq2, /* log u <=v iff u <=10^v               */
       expineq2     /* u <=v iff a^u <=a^v  if a > 0, takes arg in menu mode */
     },
     {                      /* log_ineq3  */
       lnineq1g,      /* u > v iff ln u > ln v provided v>0   */
       logineq1g,     /* u > v iff log u > log v provided v>0 */
       lnrightineq1g, /* ln u > v iff u > e^v                 */
       lnleftineq1g,  /* u > ln v iff e^u > v                 */
       logrightineq1g,/* log u > v iff  u > 10^v               */
       logleftineq1g, /* u > log v iff 10^u > v               */
       expineq1g     /* u > v iff a^u > a^v  if a > 0, takes arg in menu mode */
     },
     {                      /* log_ineq4  */
       lnineq2g,     /* u >= v iff ln u >= ln v provided u>0   */
       logineq2g,     /* u >= v => log u >= log v provided u>0  */
       lnrightineq2g, /* ln u >= v iff u >= e^v                 */
       lnleftineq2g,  /* u >= ln v iff e^u >= v                 */
       logrightineq2g,/* log u >= v iff u >= 10^v               */
       logleftineq2g, /* u >= log v iff 10^u >= v               */
       expineq2g,     /* u <=v iff a^u <=a^v  if a > 0, takes arg in menu mode */
       polylessexp,   /* exponentials eventually dominate polynomials */
       logratbound     /* algebraic functions dominate logarithms  */
     },
     {                   /*logarithms_base10 */
      loginexponent,     /* 10^log a = a     */
      logofpowerof10,    /* log 10^n = n      */
      logofone,          /* log 1 = 0        */
      logoften,          /* log 10 = 1       */
      logtoln,           /*  log a = (ln a) / log e  */
      introduceloginexponent,  /* u^v = 10^(v log u) */
      factornumberinlog,
      factoroutbase10,   /* factor out powers of 10  */
      loginexponent2,    /* 10^(n log a) = a^n */
      logrecip,          /* log(a/b) = -log(b/a)  */
      logbrecip          /* log(b,a/c) = -log(b,c/a)  */
     },
     {                 /* logarithms */
      logofpower,         /* log a^n = n log a */
      logofproduct,       /* log(ab) = log a + log b */
      logofreciprocal,    /* log(1/a) = - log a */
      logofquotient,      /* log(a/b) = log a - log b */
      collectlogs,        /* log a + log b = log ab */
      collectlogs2,       /* log a - log b = log a/b */
      collectlogs2,       /* log a + log b - log c =log ab/c */
      attractlogs,        /* n log a = log a^n */
      logsqrt,            /* log sqrt a = (1/2) log a */
      logroot,            /* log root(n,a) = (1/n) log a */
      logofone,           /* log 1 = 0        */
      factornumberinlog,
      factoroutbase,
      logofpowerreverse,   /* log u = (1/a) log u^a     */
      computelog,          /* evaluate logs numerically */
      logtoln
     },
     {                     /* logarithms_base_e  */
      lninexponent,           /* e^ln a = a      */
      lnofe,                  /* ln e = 1        */
      lnofone,                /* ln 1 = 0        */
      lnofpowerofe,           /* ln e^n = n       */
      introducelninexponent,  /* u^v = e^(v ln u) */
      lninexponent2           /* e^((ln c) a) = c^a  */
     },
     {                 /* natural_logarithms */    /* menu 70 */
      lnofpower,         /* ln a^n = n ln a       */
      lnofproduct,       /* ln ab = ln a + ln b  */
      lnofreciprocal,    /* ln 1/a = -ln a       */
      lnofquotient,      /* ln a/b = ln a - ln b */
      lnofone,           /* ln 1 = 0             */
      factornumberinlog, /* factor number completely */
      collectlns,        /* ln a + ln b = ln ab  */
      collectlns2,       /* ln a - ln b = ln a/b */
      collectlns2,       /* ln a + ln b - ln c = ln (ab/c) */
      attractlns,        /* n ln a = ln a^n       */
      lnsqrt,            /* ln sqrt a = (1/2) ln a       */
      lnroot,            /* ln root(n,a) = (1/n) ln a  */
      lnofpowerreverse,  /* ln u = (1/a) ln u^a  */
      computeln,         /* evaluate numerically */
      lnrecip            /* ln(a/b) = -ln(b/a)   */
     },
     {                        /* reverse_trig */
      sinsumrev,           /* sin u cos v + cos u sin v = sin(u+v)      */
      sindifrev,           /* sin u cos v - cos u sin v = sin(u-v)      */
      cossumrev,           /* cos u cos v - sin u sin v = cos(u+v)      */
      cosdifrev,           /* cos u cos v + sin u sin v = cos(u-v)      */
      tanhalf1rev,         /* (sin  theta )/(1+cos  theta ) = tan( theta /2)              */
      tanhalf2rev,         /* (1-cos  theta )/sin  theta  = tan( theta /2)                */
      cothalf1rev,         /* (1+cos  theta )/(sin  theta ) = cot( theta /2)              */
      cothalf2rev,         /* sin  theta /(1-cos  theta ) = cot( theta /2)                */
      tansumrev,           /* (tan u+tan v)/(1-tan u tan v) = tan(u+v)  */
      tandifrev,           /* (tan u-tan v)/(1+tan u tan v) = tan(u-v)  */
      cotsumrev,           /* (cot u cot v-1)/(cot u+cot v) = cot(u+v)  */
      cotdifrev,           /* (1+cot u cot v)/(cot v-cot u) = cot(u-v)  */
      reversesinsq         /* (1-cos  theta ) = 2 sin^2  theta /2                    */
     },
     {                     /* complex_polar_form */
      rectangulartopolar,  /* x + iy = r exp(i theta ) */
      polartorectangular,  /* r e^(i theta ) = r (cos  theta  + i sin  theta ) */
      absofpolar,          /* |e^(i theta )| = 1 */
      absofpolar,          /* |Re^(i theta )|=R if R>=0 */
      absofpolar,          /* |Re^(i theta )| = |R| */
      minustopolar,        /* -a = ae^(i pi)  */
      complexrootminus,    /* root(n,-a) = e^( pi  i/n) root(n,a) if a>=0 */
      complexexptonum,     /* a/(be^(ci)) = ae^(-ci)/b  */
      demoivre,            /* de Moivre's theorem */
      explicitparams,       /* substitute specific integers */
      factorbydemoivre,     /* x^n-c expressed as an indexed product */
     },
     {                        /* logs_to_any_base */
      logbinexponent,        /* b^(log(b,a)) = a       */
      logbinexponent2,       /* b^(n log(b,a)) = a^n   */
      logbofb,               /* log(b,b) = 1           */
      logbofpowerofb,        /* logb b^n = n            */
      logbofproduct,         /* log xy = log x + log y */
      logbofreciprocal,      /* log (1/x) = -log x     */
      logbofquotient,        /* log x/y = log x-log y  */
      logbofone,             /* log(b,1) = 0           */
      factorlogbase,         /* factor base: log(4,x)=log(2^2,x)  */
      logpowerofbofb,        /*  log(b^n,x) = 1/n log(b,x)*/
      logbofpower,           /* logb a^n = n logb a */
      factoroutbase,         /* factor out powers of base      */
      collectlogb,         /* log a + log b = log ab */
      collectlogb2,        /* log a - log b = log a/b */
      collectlogb2,        /* log x + log y - log z =log xy/z */
      attractlogb2        /* n log(b,x) = log(b,a^n) */
     },
     {                     /* change_base */
      logbtolns,           /* log(b,x) = ln x / ln b */
      logbtologs,          /* log(b,x) = log x/log b */
      changebase,          /* log(b,x) = log(a,x) / log(a,b)  (takes a as arg) */
      logpowerofbofb,      /* log(b^n,x) = (1/n) log (b,x) */
      logbtolog,           /* log(10,x) = log x*/
      logbtoln,            /* log(e,x) = ln x */
      logtoln,             /* log x = ln x / ln 10 */
      lntolog,             /* ln x = log x / log e */
      introducelogbinexponent /*  u^v = b^(v log(b,u)) */
     },
     {                    /* evaluate_trig_function        */
      sin0,               /* sin 0 = 0                     */
      cos0,               /* cos 0 = 1                     */
      tan0,               /* tan 0 = 0                     */
      zeroesofsin,        /* sin k pi  = 0                    */
      onesofcos,          /* cos 2k pi  = 1                   */
      zeroesoftan,        /* tan k pi  = 0                    */
      mod360,             /* find coterminal angle < 360\deg   */
      mod2pi,             /* find coterminal angle < 2 pi     */
      sin90,              /* angle is multiple of 90\deg       */
      sin30,              /* use 1-2-sqrt3 triangle           */
      sin45,              /* use 1-1-sqrt2 triangle           */
      radtodeg,           /* change radians to degrees     */
      degtorad,           /* change degrees to radians     */
      combine3045,        /* angle = a 30\deg  + b 45\deg  etc.    */
      computefunction     /* evaluate numerically          */
     },
     {                    /* basic_trig */
      tanrule,            /* tan u = sin u / cos u    */
      cottotan,           /* cot u = 1 / tan u        */
      cottosincos,        /* cot u = cos u / sin u    */
      secrule,            /* sec u = 1 / cos u        */
      cscrule,            /* csc u = 1 / sin u        */
      tanrule2,           /* sin u / cos u = tan u    */
      cotrule2,           /* cos u / sin u = cot u    */
      cottocscsec,        /* cot u = csc u /sec u     */
      cottocscsec         /* cot u = csc u /sec u     */
    },
    {                     /* trig_reciprocals         */
      cscrule2,           /* 1 / sin u = csc u        */
      secrule2,           /* 1 / cos u = sec u        */
      tanrecip,           /* 1 / tan u = cot u        */
      tanrecip2,          /* 1 / tan u = cos u / sin u */
      cotrecip,           /* 1 / cot u = tan u        */
      cotrecip2,          /* 1 / cot u = sin u / cos u */
      secrecip,           /* 1 / sec u = cos u        */
      cscrecip,           /* 1 / csc u = sin u        */
      sintocsc,           /* sin u = 1 / csc u        */
      costosec,           /* cos u = 1 / sec u        */
      tantodenom,         /* tan u = 1 / cot u        */
     },
     {                          /* trig_squares */
      sinsquare1,       /* sin^2 u + cos^2 u = 1 */
      sinsquare2,       /* 1 - sin^2 u = cos^2 u */
      sinsquare3,       /* 1 - cos^2 u = sin^2 u */
      sinsqtocossq,     /* sin^2 u = 1 - cos^2 u */
      cossqtosinsq,     /* cos^2 u = 1 - sin^2 u */
      secsqminustansq,  /* sec^2 u - tan^2 u = 1 */
      tansquare1,       /* tan^2 u + 1 = sec^2 u */
      tansquare2,       /* sec^2 u - 1 = tan^2 u */
      secsqtotansq,     /* sec^2 u = tan^2 u + 1 */
      tansqtosecsq,     /* tan^2 u = sec^2 u - 1 */
      sinoddpower,      /* sin^(2n+1) u = sin u (1-cos^2 u)^n */
      cosoddpower,      /* cos^(2n+1) u = cos u (1-sin^2 u)^n */
      tanoddpower,      /* tan^(2n+1) u = tan u (sec^2 u-1)^n */
      secoddpower,      /* sec^(2n+1) u = sec u (tan^2 u+1)^n */
      makesinpower,     /* (1-cos t)^n(1+cos t)^n = sin^(2n) t */
      makecospower,     /* (1-sin t)^n(1+sin t)^n = cos^(2n) t */
     },
     {                          /* csc_and_cot_identities */
      cscsqminuscotsq,  /* csc^2 u - cot^2 u = 1 */
      cotsquare1,       /* cot^2 u + 1 = csc^2 u */
      cotsquare2,       /* csc^2 u - 1 = cot^2 u */
      cscsqtocotsq,     /* csc^2 u = cot^2 u + 1 */
      cotsqtocscsq,     /* cot^2 u = csc^2 u - 1 */
      csccomplement,    /* csc( pi /2- theta ) = sec  theta   */
      cotcomplement,    /* cot( pi /2- theta ) = tan  theta   */
      cotoddpower,      /* cot^(2n+1) u = cot u (csc^2 u-1)^n */
      cscoddpower       /* csc^(2n+1) u = csc u (cot^2 u+1)^n */
     },
     {                          /* trig_sum */
      sinsum,              /* sin(u+v)= sin u cos v + cos u sin v    */
      sindif,              /* sin(u-v)= sin u cos v - cos u sin v    */
      cossum,              /* cos(u+v)= cos u cos v - sin u sin v    */
      cosdif,              /* cos(u-v)= cos u cos v + sin u sin v    */
      tansum,              /* tan(u+v)=(tan u+tan v)/(1-tan u tan v) */
      tandif,              /* tan(u-v)=(tan u-tan v)/(1+tan u tan v) */
      cotsum,              /* cot(u+v)=(cot u cot v-1)/(cot u+cot v) */
      cotdif              /* cot(u-v)=(1+cot u cot v)/(cot v-cot u) */
     },
     {                          /* double_angle */
      doublesin,           /* sin(2 theta ) = 2 sin  theta  cos  theta                 */
      doublecos1,          /* cos(2 theta ) = cos^2  theta  - sin^2  theta               */
      doublecos2,          /* cos(2 theta ) = 1 - 2 sin^2  theta                  */
      doublecos3,          /* cos(2 theta ) = 2 cos^2  theta  - 1                 */
      doublecos5,          /* cos 2 theta  + 1 = 2cos^2  theta                    */
      doublecos6,          /* cos 2 theta  - 1 = - 2 sin^2  theta                 */
      doubletan,           /* tan(2 theta ) = 2 tan  theta /(1 - tan^2  theta )         */
      doublecot,           /* cot(2 theta ) = (cot^2  theta  -1) / (2 cot  theta )      */
      reversedoublesin,    /* sin  theta  cos  theta  = (1/2) sin 2 theta                  */
      reversedoublesin2,   /* 2 sin theta  cos  theta  = sin 2 theta                   */
      reversedoublecos1,   /* cos^2  theta  - sin^2  theta  = cos(2 theta )              */
      reversedoublecos2,   /* 1 - 2 sin^2  theta  = cos(2 theta )                 */
      reversedoublecos3    /* 2 cos^2  theta  - 1 = cos(2 theta )                 */
     },
     {                     /* multiple_angles */
      decrementtrigarg,    /* n theta  = (n-1) theta  +  theta  */
      querytrigarg,        /* n theta  = ? theta +(n-?) theta   */
      triplesin,           /* sin 3 theta  = 3 sin  theta  - 4 sin^3  theta  */
      triplecos,           /* cos 3 theta  = -3 cos  theta  + 4 cos^3  theta  */
      expandsin,           /* expand sin n theta  in sin  theta , cos  theta  */
      expandcos            /* expand cos n theta  in sin  theta , cos  theta  */
     },
     {                           /* verify_identities */
      crossmultiply,
      switchsides,
      transfer1,
      transfer2,
      addeqn,
      subeqn,
      muleqn,
      cancelterm,
      powereqn,
      sqrteqn,
      rooteqn,
      functioneqn,
      arithmetic,
      checknumerically,
      makesubstitution
     },
     {                       /* solve_by_30_60_90 */
      solvesin30,          /* sin(u)=1/2 iff u= pi /6 or 5 pi /6+2n pi      */
      solvesin330,         /* sin(u)=-1/2 iff u=- pi /6 or -5 pi /6+2n pi   */
      solvesin60,          /* sin(u)=sqrt3/2 iff u= pi /3 or 2 pi /3+2n pi     */
      solvesin300,         /* sin(u)=-sqrt3/2 iff u=- pi /3 or -2 pi /3+2n pi  */
      solvecos30,          /* cos(u)=sqrt3/2 iff u=\pm  pi /6 + 2n pi          */
      solvecos150,         /* cos(u)=-sqrt3/2 iff u=\pm 5 pi /6 + 2n pi        */
      solvecos60,          /* cos(u)=1/2 iff u=\pm  pi /3+2n pi             */
      solvecos120,         /* cos(u)=-1/2 iff u=\pm  2 pi /3+2n pi          */
      solvetan30,          /* tan(u)=1/sqrt3 iff u =  pi /6 + n pi          */
      solvetan330,         /* tan(u)=-1/sqrt3 iff u = - pi /6 + n pi        */
      solvetan60,          /* tan(u)=sqrt3 iff u =  pi /3 + n pi            */
      solvetan120          /* tan(u)=-sqrt3 iff u = 2 pi /3 + n pi          */
     },
     {                       /* solve_by_45_45_90 */
      solvesin45,        /* sin u = 1/sqrt2 if u= pi /4 or 3 pi /4 + 2n pi  */
      solvesin315,       /* sin u=-1/sqrt2 if u=5 pi /4 or 7 pi /4 + 2n pi  */
      solvecos45,        /* cos u = 1/sqrt2 if u= pi /4 or 7 pi /4 + 2n pi  */
      solvecos135,       /* cos u=-1/sqrt2 if u=3 pi /4 or 5 pi /4 + 2n pi  */
      solvetan45,        /* tan u = 1   if u=  pi /4 or 5 pi /4 + 2n pi  */
      solvetan135        /* tan u = -1  if u=3 pi /4 or 7 pi /4 + 2n pi  */
     },
     {                       /* zeroes_of_trig_functions */
      solvesin0,       /* sin u = 0 iff u = n pi         */
      solvesin90,      /* sin u = 1 iff u =  pi /2+2n pi    */
      solvesin270,     /* sin u = -1 iff u = 3 pi /2+2n pi  */
      solvecos90,      /* cos u = 0 iff u = (2n+1) pi /2 */
      solvecos0,       /* cos u = 1 iff u = 2n pi        */
      solvecos180,     /* cos u = -1 iff u = (2n+1) pi   */
      solvetan0,       /* tan u = 0 iff sin u = 0     */
      solvecot90       /* cot u = 0 iff cos u = 0     */
     },
     {                      /* inverse_trig_functions */
      solvesin,        /* sin u=c iff u= (-1)^narcsin c+n pi    */
      solvesin2,       /* sin u=c iff u=arcsin(c)+2n pi  or -arcsin(c)+(2n+1) pi "  */  /* 1656 */
      solvecos,        /* cos u=c iff u=\pm arccos c+2n pi        */
      solvetan,        /* tan u=c iff u=arctan c+n pi  (c not \pm  i) */
      evalarcsin,      /* evaluate arcsin exactly           */
      evalarccos,      /* evaluate arccos exactly           */
      evalarctan,      /* evaluate arctan exactly           */
      evalarccot,      /* arccot x = arctan (1/x)           */
      evalarcsec,      /* arcsec x = arccos (1/x)           */
      evalarccsc,      /* arccsc x = arcsin (1/x)           */
      arcsinodd,       /* arcsin(-x) = -arcsin x            */
      arccosodd,       /* arccos(-x) =  pi -arccos x           */
      arctanodd,       /* arctan(-x) = -arctan x            */
      periodicform,    /* Put solutions in periodic form    */
      rejectimpossiblesin,  /* reject sin u = c if |c|>1  */
      rejectimpossiblecos   /* reject cos u = c if |c|>1  */
     },
     {                       /* invsimp */
      tanasin,            /* tan(arcsin x) = x/sqrt(1-x^2)  */
      tanacos,            /* tan(arccos x) = sqrt(1-x^2)/x  */
      tanatan,            /* tan(arctan x) = x          */
      sinasin,            /* sin(arcsin x) = x          */
      sinacos,            /* sin(arccos x) = sqrt(1-x^2)    */
      sinatan,            /* sin(arctan x) = x/sqrt(x^2+1)  */
      cosasin,            /* cos(arcsin x) = sqrt(1-x^2)    */
      cosacos,            /* cos(arccos x) = x          */
      cosatan,            /* cos(arctan x) = 1/sqrt(x^2+1)  */
      secasin,            /* sec(arcsin x) = 1/sqrt(1-x^2)  */
      secacos,            /* sec(arccos x) = 1/x        */
      secatan,            /* sec(arctan x) = sqrt(x^2+1)    */
      atantan,            /* arctan(tan  theta ) =  theta  if - pi /2<= theta <= pi /2  */
      asinsin,            /* arcsin(sin  theta ) =  theta  if - pi /2<= theta <= pi /2  */
      acoscos,            /* arccos(cos  theta ) =  theta  if 0<= theta <= pi    */
      atantan2            /* arctan(tan x) = x + c1       */
     },
     {                       /* adding_arctrig_functions   */
      sumofarcsin,           /* arcsin x + arccos x =  pi /2  */
      sumofarctan            /* arctan x + arctan 1/x =  pi x/2|x| */
     },
     {                       /* complementary_trig */
      sintocos,             /* sin( pi /2- theta ) = cos  theta  */
      costosin,             /* cos( pi /2- theta ) = sin  theta  */
      tantocot,             /* tan( pi /2- theta ) = cot  theta  */
      cotcomplement,        /* cot( pi /2- theta ) = tan  theta  */
      seccomplement,        /* sec( pi /2- theta ) = csc  theta  */
      csccomplement,        /* csc( pi /2- theta ) = sec  theta  */
      sintocos2,            /* sin  theta  = cos( pi /2- theta ) */
      costosin2,            /* cos  theta  = sin( pi /2- theta ) */
      tantocot2,            /* tan  theta  = cot( pi /2- theta ) */
      cottotan2,            /* cot  theta  = tan( pi /2- theta ) */
      sectocsc2,            /* sec  theta  = csc( pi /2- theta ) */
      csctosec2             /* csc  theta  = sec( pi /2- theta ) */
     },
     {                       /* complementary_degrees */
      sintocosdeg,             /* sin(90\deg - theta ) = cos  theta  */
      costosindeg,             /* cos(90\deg - theta ) = sin  theta  */
      tantocotdeg,             /* tan(90\deg - theta ) = cot  theta  */
      cotcomplementdeg,        /* cot(90\deg - theta ) = tan  theta  */
      seccomplementdeg,        /* sec(90\deg - theta ) = csc  theta  */
      csccomplementdeg,        /* csc(90\deg - theta ) = sec  theta  */
      sintocos2deg,            /* sin  theta  = cos(90\deg - theta ) */
      costosin2deg,            /* cos  theta  = sin(90\deg - theta ) */
      tantocot2deg,            /* tan  theta  = cot(90\deg - theta ) */
      cottotan2deg,            /* cot  theta  = tan(90\deg - theta ) */
      sectocsc2deg,            /* sec  theta  = csc(90\deg - theta ) */
      csctosec2deg,            /* csc  theta  = sec(90\deg - theta ) */
      adddegrees,              /* a\deg  + b\deg  = (a+b)\deg    */
      multdegrees,             /* ca\deg  = (ca)\deg         */
      divdegrees               /* a\deg /c = (a/c)\deg       */
     },
     {                      /* trig_odd_and_even  */
      sinodd,               /* sin(-u) = - sin u  */
      coseven,              /* cos(-u) = cos u    */
      tanodd,               /* tan(-u) = - tan u  */
      cotodd,               /* cot(-u) = - cot u  */
      seceven,              /* sec(-u) = sec u    */
      cscodd,               /* csc(-u) = - csc u  */
      sinsqeven,            /* sin^2(-u) = sin^2 u  */
      cossqeven,            /* cos^2(-u) = cos^2 u  */
      tansqeven,            /* tan^2(-u) = tan^2 u  */
      cotsqeven,            /* cot^2(-u) = cot^2 u  */
      secsqeven,            /* sec^2(-u) = sec^2 u  */
      cscsqeven             /* csc^2(-u) = csc^2 u  */
     },
     {                      /* trig_periodic      */
      sinperiodic,          /* sin(u+2 pi ) = sin u  */
      cosperiodic,          /* cos(u+2 pi ) = cos u  */
      tanperiodic,          /* tan(u+ pi ) = tan u   */
      secperiodic,          /* sec(u+2 pi ) = sec u  */
      cscperiodic,          /* csc(u+2 pi ) = csc u  */
      cotperiodic,          /* cot(u+ pi ) = cot u   */
      sinsqperiodic,        /* sin^2(u+ pi ) = sin^2 u */
      cossqperiodic,        /* cos^2(u+ pi ) = cos^2 u */
      secsqperiodic,        /* sec^2(u+ pi ) = sec^2 u */
      cscsqperiodic,        /* csc^2(u+ pi ) = csc^2 u */
      sinhalfperiod1,       /* sin u = -sin(u- pi )  */
      sinhalfperiod2,       /* sin u = sin( pi -u)   */
      coshalfperiod1,       /* cos u = -cos(u- pi )  */
      coshalfperiod2        /* cos u = -cos( pi -u)   */
     },
     {                      /* half_angle_identities   */
      sinsqhalf,            /* sin^2( theta /2) = (1-cos  theta )/2 */
      cossqhalf,            /* cos^2( theta /2) = (1+cos  theta )/2 */
      sinsqhalf2,           /* sin^2( theta ) = (1-cos 2 theta )/2  */
      cossqhalf2,           /* cos^2( theta ) = (1+cos 2 theta )/2  */
      sincossame,           /* sin  theta  cos  theta  = (1/2) sin 2 theta   */
      tanhalf1,             /* tan( theta /2) = (sin  theta )/(1+cos  theta ) */
      tanhalf2,             /* tan( theta /2) = (1-cos  theta )/sin  theta    */
      cothalf1,             /* cot( theta /2) = (1+cos  theta )/(sin  theta ) */
      cothalf2,             /* cot( theta /2) = sin  theta /(1-cos  theta )   */
      sinhalf1,             /* sin( theta /2) = sqrt((1-cos  theta )/2)    */
      sinhalf2,             /* sin( theta /2) = -sqrt((1-cos  theta )/2)   */
      coshalf1,             /* cos( theta /2) = sqrt((1+cos  theta )/2)    */
      coshalf2,             /* cos( theta /2) = -sqrt((1+cos  theta )/2)   */
      twicehalf             /*  theta  = 2( theta /2)              */
     },
     {                      /* product_and_factor_identities      */
      reversedoublesin,     /* sin x cos x = (1/2)sin 2x              */
      sincosop,               /* sin x cos y = (1/2)[sin(x+y)+sin(x-y)] */
      cossin,               /* cos x sin y = (1/2)[sin(x+y)-sin(x-y)] */
      sinsin,               /* sin x sin y = (1/2)[cos(x-y)-cos(x+y)] */
      coscos,               /* cos x cos y = (1/2)[cos(x+y)+cos(x-y)] */
      sumofsin,             /* sin x + sin y = 2 sin (1/2)(x+y) cos (1/2)(x-y) */
      difofsin,             /* sin x - sin y = 2 sin (1/2)(x-y) cos (1/2)(x+y) */
      sumofcos,             /* cos x + cos y = 2 cos (1/2)(x+y) cos (1/2)(x-y) */
      difofcos,             /* cos x - cos y = -2 sin (1/2)(x+y) sin (1/2)(x-y) */
      trigdoublesub         /* substitute u,v for expressions in trig functions */
     },
     {                     /* limits */
      testlimit,         /* experiment numerically  */
      limsum,            /* lim u+v = lim u + lim v */
      limdif,            /* lim u-v = lim u - lim v */
      limconst,          /* lim(t\toa,c) = c (c constant) */
      limident,          /* lim(t\toa,t) = a */
      limlinear,         /* lim cu=c lim u (c const)  */
      limminus,          /* lim -u = -lim u  */
      limprod,
      limpower,          /* lim u^n = (lim u)^n                  */
      limexponent2,      /* lim c^v=c^(lim v) (c constant > 0) */
      limexponent,       /* lim u^v=(lim u)^(lim v) */
      limsqrt,           /* lim sqrt u=sqrt(lim u) if lim u>0  */
      limoddroot,        /* lim root(n,u) = root(n,lim u) if n is odd  */
      limevenroot,       /* lim root(n,u) = root(n,lim u) if lim u > 0 */
      limpoly,
      limabs             /* lim |u| = |lim u|                */
     },
     {                                 /* limits_of_quotients */
      limlinear,            /* lim cu/v = c lim u/v (c const) */
      limrecip,             /* lim c/v  = c/lim v (c const)   */
      limquotient,          /* lim u/v = lim u/lim v          */
      factorunderlimit,     /* factor out (x-a)^n in limit as x\32a */
      limrationalfunction,  /* limit of rational function     */
      quotientofpowers,     /* a^n/b^n = (a/b)^n                 */
      rationalizefraction,
      pulloutnonzerolimit,
      factoroutconstant,
      multnumdenom,         /* mult num and denom by something   */
      divnumdenom2,         /* divide num and denom by something */
      divnumdenom,          /* lim u/v = lim (u/w) / lim (v/w)   */
      limapartandfactor     /* (ab+ac+d)/q = a(b+c)/q + d/q      */
                            /* example : (sin x cos h + cos x sin h - sin x)/h  */
     },
     {                               /* quotients_of_roots */
      limsqrt1,        /* sqrt a/b = sqrt(a/b^2)  if b>0          */
      limsqrt2,        /* sqrt a/b = -sqrt(a/b^2) if b<0          */
      limroot1,        /* root(n,a)/b = root(n,a/b^n) (b>0 or n odd) */
      limroot2,        /* root(n,a)/b = -root(n,a/b^n) (b<0, n even) */
      limsqrtdenom1,   /* a/sqrt b = sqrt(a^2/b)  if a>=0          */
      limsqrtdenom2,   /* a/sqrt b = -sqrt(a^2/b) if a<=0          */
      limrootdenom1,   /* a/root(n,b) = root(n,a^n/b) (a>=0 or n odd) */
      limrootdenom2    /* a/root(n,b) = -root(n,a^n/b) (a<=0, n even) */
     },
     {                              /* lhopitalmenu   */
      lhopital,
      derivop,
      isolateln,
      isolatelnpower,
      negexptodenom,
      exptodenom,
      trigtodenom,
      createcompoundfraction,
      commondenomandsimp
     },
     {                              /* special_limits */     /* menu 100 */
      limsin1,            /* (sin t)/t                      */
      limtan1,            /* (tan t)/t                      */
      limcos1,            /* (1-cos t)/t                    */
      limcos2,            /* (1-cos t)/t^2                   */
      defnofe,            /* (1+t)^(1/t)                    */
      limln1,             /* lim(x->0, ln(1\pm x)/x) = \pm 1      */
      limexp1,            /* lim(x->0, (e^x-1)/x = 1        */
      limexp2,            /* lim(x->0, (e^(-x)-1)/x = -1    */
      limpowertimeslnabs, /* lim(t->0,t^nln |t|)=0 (n > 0)   */
      limosccos,          /* lim(x->0, cos(1/x) = undefined */
      limoscsin,          /* lim(x->0, sin(1/x) = undefined */
      limosctan,          /* lim(x->0, tan(1/x) = undefined */
      liminfcos,          /* lim(x->\infinity , cos(x) = undefined   */
      liminfsin,          /* lim(x->\infinity , sin(x) = undefined   */
      liminftan           /* lim(x->\infinity , tan(x) = undefined   */
     },
     {                           /* hyper_limits */
      limsinh1,            /* (sinh t)/t                      */
      limtanh1,            /* (tanh t)/t                      */
      limcosh1,            /* (1-cosh t)/t                    */
      limcosh2,            /* (1-cosh t)/t^2                   */
     },
     {                              /* advanced_limits */
      limlogisloglim,   /* lim ln u=ln lim u (if lim u > 0) */
      limcontinuous,    /* lim f(u)=f(lim u), f continuous  */
      changelimitvariable, /* lim(t\toa,f(g(t)))=lim(u\32g(a),f(u)) */
      limvalop,         /* evaluate limit in one step       */
      limexptolog,      /* lim u^v = lim e^(v ln u)         */
      createcompoundfraction, /* lim uv = lim v/(1/u)       */
      limundefined,     /* limit undefined due to domain    */
      limlog,           /* lim u = e^(lim ln u)             */
      squeezetheorem,   /* squeeze theorem                  */
      rationalizesum,   /* lim sqrt u-v=lim (sqrt u-v)(sqrt u+v)/sqrt u+v)  */
      limleadingterms,  /* lim u/v = limit of leading terms */
      limleadingterm,   /* leading term: lim(u+a)=lim(u) if a->0 */
      sumleadingterm,   /* replace sum by leading term      */
      undefinedpart,    /* f(undefined) = undefined         */
      limthruexp,          /* lim(e^u) = e^(lim u)   */
      limthrulog          /* lim(ln u) = ln(lim u)  */
     },
     {                  /* logarithmic_limits */
      limtlnt,                /* lim(t\to 0,t ln t) = 0                */
      limtpowerlnt,           /* lim(t\to 0,t^n ln t) = 0$ if n>=1      */
      limtlntpower,           /* lim(t\to 0,t (ln t)^n = 0$ if n>=1     */
      limtpowerlntpower,     /* lim(t\to 0,t^k (ln t)^n = 0$ if k,n>=1 */
      limlntovert,            /* lim(t\to\infinity ,ln(t)/t = 0         */
      limlntpowerovert,       /* lim(t\to\infinity ,ln(t)^n/t = 0 if n>=1 */
      limlntovertpower,       /* lim(t\to\infinity ,ln(t)/t^n = 0 if n>=1 */
      limlntpowerovertpower, /* lim(t\to\infinity ,ln(t)^k/t^n = 0 if k,n>=1 */
      limtoverlnt,            /* lim(t\to\infinity ,t/ln(t) = \infinity */
      limtoverlntpower,       /* lim(t\to\infinity ,t/ln(t)^n = \infinity  if n>=1       */
      limtpoweroverlnt,       /* lim(t\to\infinity ,t^n/ln(t) = \infinity  if n>=1       */
      limtpoweroverlntpower   /* lim(t\to\infinity ,t^n/ln(t)^k = \infinity  if k,n>=1   */
     },
     {                             /* limits_at_infinity */
      inflimpower1,    /* 1/t^n */
      inflimpower2,    /* t^n   */
      limexpinf,       /* e^t   */
      limexpinf2,      /* e^t at minus infinity */
      limlnright,      /* ln    */
      limsqrtinf,
      limrootinf,
      limarctaninf,    /* arctan */
      limarccotinf,    /* arccot at infinity       */
      limarccotinf2,   /* arccot at minus infinity */
      limtanhinf,      /* tanh   */
      rationalizesum,
      limthrusin,          /* lim sin u = sin(lim u) */
      limthrucos,          /* lim cos u = cos(lim u) */
      invertlim,
      limleadingterms
     },
     {liminverseevenpower,         /* infinite_limits */
      liminverseoddpower,
      lim1inverseright,
      lim1inverseleft,
      limquoinfinite,
      limlnsing,
      limtansing,
      limcotsing,
      limsecsing,
      limcscsing,
      limprod2left,                /* lim(uv) = lim(u/?) lim(?v) */
      limprod2right                /* lim(uv) = lim(?u) lim(v/?) */
     },
     {                                      /* infinities */
       infinityovernonzero,        /* \pm \infinity /positive = \pm \infinity   */
       nonzerooverinfinity,        /* nonzero/\pm \infinity  = 0    */
       timesinfinity,              /* positive\cdot \pm \infinity  = \pm \infinity   */
       infinitytimesinfinity,      /* \pm \infinity \cdot \infinity  = \pm \infinity          */
       addinfinity,                /* \pm \infinity  + finite = \pm \infinity   */
       infinityplusinfinity,       /* \infinity  + \infinity  = \infinity          */
       toinfinity1,                /* u^\infinity  = \infinity  if u > 1  */
       toinfinity0,                /* u^\infinity  = 0 if 0 < u < 1 */
       tominusinfinity1,           /* u^(-\infinity ) = 0 if u > 1 */
       tominusinfinity0,           /* u^(-\infinity ) = \infinity  if 0 < u < 1 */
       powerofinfinity,            /* \infinity ^n = \infinity  if n > 0   */
       infinityminusinfinity       /* \infinity -\infinity  = undefined   */
     },
     {                          /* zero_denom */
       zerodenom,                 /* a/0+ = \infinity  if a>0      */
       zerodenom2,                /* a/0- = -\infinity  if a>0     */
       zerodenom3,                /* a/0 = undefined      */
       infinityoverzero,          /* \infinity /0+ = \infinity              */
       infinityoverzero2,         /* \infinity /0- = -\infinity             */
       infinityoverzero3,         /* \infinity /0 = undefined      */
       infinityoverzerosq,        /* \infinity /0^2 = \infinity              */
       infinityoverzero2n,        /* \infinity /0^(2n) = \infinity             */
       zerosqdenom,               /* a/0^2 = \infinity  if a > 0    */
       zerosqdenom2,              /* a/0^2 = -\infinity  if a < 0   */
       zero2ndenom,               /* a/0^(2n) = \infinity  if a > 0   */
       zero2ndenom2               /* a/0^(2n) = -\infinity  if a < 0  */
     },
     {                          /* more_infinities */
       lninfinity,
       sqrtinfinity,
       rootinfinity,
       ataninfinity,
       acotinfinity,
       acotminusinfinity,
       asecinfinity,
       acscinfinity,
       triginfinity,
       coshinfinity,
       sinhinfinity,
       tanhinfinity,
       lnzero
     },
     {                              /* polynomial_derivs */
      difconstant,
      difidentity,
      difsum,
      difminus,
      diflinear,
      difpower,
      difpoly,
      primerule
     },
     {                              /* derivatives */
      defnofderivative,
      difpoly,
      difsum,
      difminus,
      diflinear,
      diflinear2,
      difpower,
      difproduct,
      difrecip,
      difquotient,
      difsqrt,
      difroots,
      difinversepower,
      difabs,
      primerule
     },
     {                         /* diftrig */
      difsin,
      difcos,
      diftan,
      difsec,
      difcot,
      difcsc
     },
     {                                   /* dif_explog */
      difexp,               /* d/dx e^x = e^x */
      difatox,              /* d/dx c^x = (ln c) c^x, c const */
      difexponential,       /* d/dx u^v=  (d/dx) e^(v ln u)   */
      difln,                /* d/dx ln x = 1/x                */
      diflnabs,             /* d/dx ln |x| = 1/x              */
      logdif,               /* dy/dx = y (d/dx) ln y          */
      difexp2,
      difatox2,
      difln2,
      diflnabs2,
      diflncos,             /* d/dx ln(cos x) = -tan x        */
      diflnsin              /* d/dx ln(sin x) = cot x         */
     },
     {                                 /* dif_inversetrig */
      difatan,
      difasin,
      difacos,
      difacot,
      difasec,
      difacsc,
      difatan2,
      difasin2,
      difacos2,
      difacot2,
      difasec2,
      difacsc,
      difacsc2
     },
     {                               /* chain_rule */
      difpower2,
      difsqrt2,
      difsin2,
      difcos2,
      diftan2,
      difsec2,
      difcot2,
      difcsc2,
      difabs2,
      chainrule,  /* d/dx f(u) = f'(u) du/dx */
      makesubstitution,
      unwinddefinition
     },

     {                        /* minima_and maxima */
       /* Code in minmax.c depends heavily on exact numbers of these choices. */
       /* if you change them, change the file mpminmax.h to correspond. */
      minmaxexperiment,
      addcriticalpoints,
      addendpoints,
      addundefinedpoints,
      addlimits,
      rejectpoint,
      tabulate,
      tabulateexact,
      selectmax,
      selectmin,
      derivop,
      ssolveop,
      limvalop,
      eliminateparameter,
      functionisconstant
     },
     {                        /* implicit_diff */
      derivop,
      polyvalop,
      ssolveop
     },
     {                        /* related_rates */
      difeqn,              /* differentiate the equation      */
      derivop,             /* evaluate derivative in one step */
      eliminatederivative, /* eliminate derivative by substitution  */
      ssolveop             /* solve simple equation           */
     },
     {                        /* simplify */
      polyvalop,            /* simplify sums and products          */
      ratsimpop,            /*  eliminate compound fractions       */
      commondenomandsimp,   /* common denominator and simplify     */
      contentfactor,        /* factor out common term              */
      factorop,             /* factor out expression (not integer) */
      multiplyoutandsimp,   /* simpprod.c                          */
      cancelgcd,            /* show common factor in u/v           */
      ssolveop,             /* solve simple equation               */
      writeaspoly,          /* write as polynomial in ?            */
      univariatepoly,       /* express as polynomial               */
      monicpoly,            /* make the leading coefficient 1      */
      backtosqrts,          /* x^(1/2) = sqrt x                         */
      backtoroots,          /* change fractional exponents to roots */
      eliminatesqrts        /* change roots to fractional exponents */
     },
     {                      /* higher_derivatives              */
      difeqn,               /* u=v => du/dx = dv/dx            */
      difdif,               /* d^2u/dx^2 = (d/dx)(du/dx)         */
      difdifn,              /* d^nu/dx^n= d/dx d^(n-1)/dx^(n-1)  */
      secondderiv,          /* d/dx du/dx = d^2u/dx^2            */
      highderiv,            /* d/dx d^nu/dx^n = d^(n+1)/dx^(n+1) */
      derivop,              /* evaluate derivative in one step */
      evalatpoint           /* evaluate numerically at a point */
     },
     {                        /* basic_integration */
      int1,
      intconst,
      intident,
      intlinear,   /* if you change positions of these operators you must */
                   /* adjust integrationop  in execute.c */
      intminus,
      intsum,
      intdif,        /* integral u-v dt = integral u dt - integral v dt       */
      intlinearity,  /* integral au\pm bv dt = aintegral u dt \pm  bintegral v dt   */
      intpower,      /* integral t^n dt=t^(n+1)/(n+1) (n \\ne  -1) */
      intinversepower, /* integral 1/t^(n+1) dt= -1/(nt^n) (n # 0) */
      intpoly,       /* integrate polynomial          */
      intrecip,      /* integral (1/t) dt = ln |t|            */
      intrecip2,     /* integral 1/(t\pm a) dt = ln |t\pm a|        */
      multiplyoutintegrand, /* multiply out integrand */
      expandintegrand,  /* expand (a+b)^n in integrand */
      intabs         /* integral |t| dt = t|t|/2              */
     },
     {                                     /* trig_integration */
      intsin,
      intcos,
      inttan,
      intcot,
      intsec,
      intcsc,
      intsecsq,
      intcscsq,
      inttansq,
      intcotsq,
      inttosec,
      inttocsc
     },
     {                                     /* trig_integration2 */
      intsin2,
      intcos2,
      inttan2,
      intcot2,
      intsec2,
      intcsc2,
      intsecsq2,
      intcscsq2,
      inttansq2,
      intcotsq2,
      inttosec2,
      inttocsc2
     },
     {                            /* integrate_exp */
      intexp1,            /* integral e^t dt = e^t           */
      intexp2,            /* integral e^at dt =(1/a) e^(at)  */
      intexp3,            /* integral e^(-t)dt = -e^(-t)     */
      intexp4,            /* integral e^(-at)dt = -(1/a) e^(-at) */
      intexp5,            /* integral e^(t/a)dt = a e^(t/a)   */
      intexp6,            /* integral c^t dt = (1/ln c) c^t  */
      intexponential,     /* integral u^v dt = integral (e^(v ln u) dt --if position changes adjust integrationop in integral.c */
      intln,              /* integral ln t = t ln t - t      */
      inttoerf            /* integral e^(-t^2) dt = sqrt pi /2 Erf(t) */
     },
     {                         /*integrate_by_substitution */
      choosesubstitution,
      autochoosesubstitution,
      difsubstitution,
      derivop,                   /* evaluate derivative in one step */
      showcallingproblem,        /* if position changes, adjust at in_loop in top.c */
      trysubstitution,           /* integrand = f(u) \cdot  du/dx        */
      changeintegrationvariable, /* integral f(u) (du/dx) dx = integral f(u) du   */
      unwinddefinition,          /* eliminate defined variable      */
      intsub,
      autointsub,
      intsubwithdisplay          /* use display_progress to show trial subs */
     },
     {                               /*integrate_by_parts */
      integratebyparts,    /* this must remain the first choice, see equatetoproblem */
      autointegratebyparts,
      equatetoproblem,
      transferintegral,
      derivop,
      intsub,
      autointsub,
      simpleint
     },
     {                               /* fundamental_theorem */
      fundamentaltheorem,
      fundamentaltheorem2
     },
     {                               /* definite_integration */
      evalbar,             /* f(t) evaluated from a to b = f(b)-f(a) */
      evalbarln,           /* ln f(t) evaluated from a to b = ln(f(b)/f(a)) */
      switchlimits,        /* change upper and lower limit */
      additivity,          /*  combine two def integrals with same integrand */
      insertpoint,          /*  break an integral up into two integrals */
      breakabsint,         /* break integral |f(t)| dt at zeroes of f */
      integratenumerically,  /* parameters allowed, active line won't advance */
      pureintegratenumerically,  /* no parameters allowed */
      integrateemptyinterval,  /* integral(f(x),x,a,a) = 0.   */
     },
     {                       /* improper_integrals */
      integraltolimit,      /* creates a limit of an integral */
      integraltolimit2,     /* limit at minus infinity  */
      integraltolimit3,     /* limit at left endpoint */
      integraltolimit4,     /* limit at right endpoint */
      intdivtest1,          /* limit of integrand is not zero at infinity */
      intdivtest2           /* limit of integrand is not zero at -infinity */
     },
     {                      /* oddandeven */
      oddintegrand,
      evenintegrand
     },
     {                                /* trig_substitutions */
      trigsubsin,
      trigsubtan,
      trigsubsec,
      trigsubsinh,
      trigsubcosh,
      trigsubtanh,
      yourtrigsub,
      derivop,
      simpleint
     },
     {                                /* trigonometric_integrals */ /* menu 128 */
      intsinsq,    /*  sin^2 t = (1-cos 2t)/2 in integral  */
      intcossq,    /*   cos^2 t = (1+cos 2t)/2 in integral */
      intsubcos,   /*  u=cos x after using sin^2=1-cos^2    */
      intsubsin,   /*  u=sin x after using cos^2=1-sin^2    */
      intsubtan,   /* u=tan x after using sec^2=1+tan^2     */
      intsubcot,   /* u = cot x after using csc^2=1+cot^2   */
      intsubsec,   /* u=sec x after using tan^2=sec^2-1     */
      intsubcsc,   /* u=csc x after using cot^2=csc^2-1     */
      tantosecinint,  /* tan^2 x = sec^2 x - 1 in integrand */
      cottocscinint,  /* cot^2 x = csc^2 x - 1 in integrand */
      intsecpower, /* reduce integral sec^n x dx                   */
      intcscpower, /* reduce integral csc^n x dx                   */
      weierstrass  /* u = tan(x/2) (Weierstrass subst.)   */
     },
     {                                /* trigrationalize */
      trigrationalizedenom1, /* multiply num and denom by 1+cos x */
      trigrationalizedenom4, /* multiply num and denom by 1-cos x */
      trigrationalizedenom2, /* multiply num and denom by 1+sin x */
      trigrationalizedenom5, /* multiply num and denom by 1-sin x */
      trigrationalizedenom3, /* mult num and denom by cos x + sin x */
      trigrationalizedenom6  /* mult num and denom by cos x - sin x */
     },
     {                                /* integrate_rational */
       polydivop,               /* polynomial division           */
       factordenominator,
       cancelgcd,               /* show common factor in u/v         */
       squarefreefactors,       /* square-free factorization         */
       factornumerically,       /* factor polynomial numerically     */
       partialfractionsop,      /* expand in partial fractions       */
       completethesquare1,      /* only works in denom or sqrt inside integral or limit */
       intrecip3,               /* integral 1/(at\pm b) dt = (1/a) ln |at\pm b|    */
       intinversepower,         /* integral 1/(at\pm b)^(n+1) dt = -1/na(at\pm b)^n */
       inttoatan,               /* integral 1/(t^2+a^2)dt=(1/a)arctan(t/a)     */
       inttoacoth,              /* integral 1/(t^2-a^2)dt=(1/a)arccoth(t/a)    */
       inttolnratio1,           /* integral 1/(t^2-a^2)dt=(1/2a)ln|(t-a)/(t+a)|*/
       inttoatanh,              /* integral 1/(a^2-t^2)dt=(1/a)arctanh(t/a)    */
       inttolnratio2            /* integral 1/(a^2-t^2)dt=(1/2a)ln|(t+a)/(a-t)|*/
     },
     {                                /* integrate_sqrtdenom */
       completethesquare1,
       inttoasin,      /* CRC formula 19 */
       inttolnratio3,  /* CRC formula 20 */
       inttoacos,      /* CRC formula 21 */
       intsub
     },
     {                                /* integrate_arctrig */
       intasin,
       intacos,
       intatan,
       intacot,
       intacscplus,
       intacscminus,
       intasecplus,
       intasecminus
     },
     {                                /* simplify_calculus */
      polyvalop,    /* simplify sums and products */
      ratsimpop,    /*  eliminate compound fractions */
          /* for the time being polyvalop is put in both places; it */
          /* actually does even more, using content-factor and cancel */
      commondenomandsimp,   /* fractions and non-fractions     */
      contentfactor,
      factorop,
      multiplyoutandsimp,   /* simpprod.c                      */
      cancelgcd,            /* show common factor in u/v       */
      ssolveop,             /* solve simple equation           */
      derivop,              /* evaluate derivative in one step */
      limvalop,             /* evaluate limit in one step      */
      intsub,               /* change integral by substitution */
      simpleint,            /* simple integral in one step     */
      absorbconstant        /* absorb number in const of int   */
     },
     {                               /* integrate_hyperbolic */
      intsinh,
      intcosh,
      inttanh,
      intcoth,
      intcsch,
      intsech
     },
     {                               /* series_geom1 */
      oneminusxseries,           /* $$1/(1-x) = sum(x^n,n,0,infinity)$$ */
      oneminusxseries2,          /* $1/(1-x) = 1+x+x^2+...$              */
      oneminusxseries3,          /* $1/(1-x) = 1+x+x^2+...x^n...$        */
      oneplusxseries,            /* $$1/(1+x) = sum((-1)^n x^n,n,0,infinity)$$ */
      oneplusxseries2,           /* $1/(1+x) = 1-x+x^2+...$ */
      oneplusxseries3,           /* $1/(1+x) = 1-x+x^2+...(-1)^nx^n...$  */
      oneminusxseriesrev,        /* sum(x^n,n,0,infinity) = 1/(1-x) */
      oneminusxseries2rev,
      oneminusxseries3rev,
      oneplusxseriesrev,
      oneplusxseries2rev,
      oneplusxseries3rev
     },
     {                               /* series_geom2 */
      xoveroneminusxseries,
      xoveroneminusxseries2,
      xoveroneminusxseries3,
      xoveroneplusxseries,
      xoveroneplusxseries2,
      xoveroneplusxseries3,
      xoveroneminusxseriesrev,
      xoveroneminusxseries2rev,
      xoveroneminusxseries3rev,
      xoveroneplusxseriesrev,
      xoveroneplusxseries2rev,
      xoveroneplusxseries3rev
     },
     {                                 /* series_geom3 */
      oneoveroneminusxkseries,
      oneoveroneminusxkseries2,
      oneoveroneminusxkseries3,
      xmoveroneminusxkseries,
      xmoveroneminusxkseries2,
      xmoveroneminusxkseries3,
      oneoveroneminusxkseriesrev,
      oneoveroneminusxkseries2rev,
      oneoveroneminusxkseries3rev,
      xmoveroneminusxkseriesrev,
      xmoveroneminusxkseries2rev,
      xmoveroneminusxkseries3rev
     },

     {                                 /* series_geom4 */
      oneoveroneplusxkseries,
      oneoveroneplusxkseries2,
      oneoveroneplusxkseries3,
      xmoveroneplusxkseries,
      xmoveroneplusxkseries2,
      xmoveroneplusxkseries3,
      oneoveroneplusxkseriesrev,
      oneoveroneplusxkseries2rev,
      oneoveroneplusxkseries3rev,
      xmoveroneplusxkseriesrev,
      xmoveroneplusxkseries2rev,
      xmoveroneplusxkseries3rev
     },
     {                            /* series_geom5 */
      geometricseriesfromk,
      geometricseriesfromk2,
      geometricseriesfromk3,
      geometricseriesminusfromk,
      geometricseriesminusfromk2,
      geometricseriesminusfromk3,
      geometricseriesfromkrev,
      geometricseriesfromk2rev,
      geometricseriesfromk3rev,
      geometricseriesminusfromkrev,
      geometricseriesminusfromk2rev,
      geometricseriesminusfromk3rev
     },
     {                            /* series_ln */
      lnseries,
      lnseries2,
      lnseries3,
      lnseriesminus,
      lnseriesminus2,
      lnseriesminus3,
      lnseriesrev,
      lnseries2rev,
      lnseries3rev,
      lnseriesminusrev,
      lnseriesminus2rev,
      lnseriesminus3
     },
     {                                /* series_trig */
      sinseries,
      sinseries2,
      sinseries3,
      cosseries,
      cosseries2,
      cosseries3,
      sinseriesrev,
      sinseries2rev,
      sinseries3rev,
      cosseriesrev,
      cosseries2rev,
      cosseries3rev
     },
     {                /* series_exp */
      expseries,
      expseries2,
      expseries3,
      expseriesrev,
      expseries2rev,
      expseries3rev,
      negexpseries,
      negexpseries2,
      negexpseries3,
      negexpseriesrev,
      negexpseries2rev,
      negexpseries3rev
     },
     {                /* series_atan */
      atanseries,
      atanseries2,
      atanseries3,
      atanseriesrev,
      atanseries2rev,
      atanseries3rev,
      binomialseries,
      binomialseries2,
      binomialseries3,
      binomialseriesrev,
      binomialseries2rev,
      binomialseries3rev
     },
     {                               /* series_bernoulli */
      tanseries,
      tanseries2,
      tanseries3,
      cotseries,
      cotseries2,
      cotseries3,
      bernoulliseries,
      bernoulliseries2,
      bernoulliseries3,
      secseries,
      secseries2,
      secseries3,
      zetaseries,
      zetaseries2,
      zetaseries3,
      alternatingharmonicseries
      },
     {                               /* series_appearance */
      ldots0,         /* express series as $a_0 + a_1 + ...$        */
      ldots1,         /* express series as $a_0 + a_1 + a_2 + ... $ */
      ldots2,         /* express series using ... and general term  */
      ldotstosigma,   /* express series using sigma notation        */
      showanotherterm,/* show another term before ...               */
      showmoreterms,  /* show ? more terms before ...               */
      showevaluatedterms, /* show terms with factorials evaluated   */
      showfactorialsinterms, /* do not evaluate factorials in terms */
      showdevaluatedterms,   /* show the coefficients in decimal form */
      showundevaluatedterms  /* do not use decimal form for coefficients */
     },
     {                /* series_algebra                             */
      telescopingseries,
      multiplyseries,
      multiplypowerseries,
      divideseriesbypoly,    /* divide power series by polynomial */
      dividepolybyseries,    /* divide polynomial by power seres  */
      dividepowerseries,
      squareseries,
      squarepowerseries,
      powerofseries,
      addseries,
      subseries
     },
     {                               /* series_manipulations */
                                     /* if the position of intseries changes,
                                        you must modify integrationop in
                                        execute.c */
      seriesfirstterms,     /* split off first few terms */
      seriesmoreterms,      /* decrease lower limit by subtracting terms */
      seriesaddindex,       /* add ? to index variable */
      seriessubindex,       /* subtract ? from index variable */
      renameindexvariable,
      seriessum,            /* sum (u+v) = sum u + sum v  */
      difseries,            /* d/dx sum u = sum  du/dx */
      reversedifseries,     /* sum  du/dx = d/dx sum u */
      intseries,            /* sum  integral u dx = integral  sum u dx */
      reverseintseries,     /* sum  integral u dx = integral  sum u dx */
      evalfirstterms,       /* calculate sum of first few terms */
      seriesintdif,         /* $$u = integral(diff(u,x),x)$$ */
                           /* if positions in this menu change, see selectop.c,
                              search for seriesintdif */
      seriesintdifdef,    /* $$u = integral(diff(u,t),t,0,x) + u(0)$$ */
      seriesdifint,       /* $$u = diff(integral(u,x),x)$$            */
      eliminatecofi,      /* solve for constant of integration        */
      seriesevenandodd,    /* separate terms with even and odd indices */
     },
     {                               /* series_convergence_tests */
      divergencetest,   /* If these change then change the top of series.h too */
      integraltest,
      ratiotest,
      roottest,
      comparisontest1,
      comparisontest2,
      limitcomparisontest,
      condensationtest,
      finishdivergencetest,   /* must change in_loop if these choice numbers change */
      finishintegraltest,
      finishratiotest,
      finishroottest,
      finishcomparisontest1,
      finishcomparisontest2,
      finishlimitcomparisontest,
      finishcondensationtest
     },
     { statefinalbound1,              /* series_convergence2  */
       statefinalbound2,
       harmonicseries,
       zeta2,
       addtozeta,
       zetatobernoulli
     },
     {                                /* complex_functions */
      complexlntopolarform,   /* ln(u+iv) = ln(re^(i theta )) */
      complexln,              /* ln(re^(i theta )) = ln r + i theta  (- pi < theta <= pi ) */
      lnofi,                  /* ln i = i pi /2                      */
      lnofminusone,           /* ln(-1) = i pi                       */
      lnofnegative,           /* ln(-a) = ln a + i pi  (a > 0)       */
      complexcos,             /* cos  theta  = [e^(i theta ) + e^(-i theta )]/2     */
      complexsin,             /* sin  theta  = [e^(i theta ) - e^(-i theta )]/2i    */
      complexsqrt,            /* sqrt(re^(i theta ))=sqrtr e^(i theta /2) (0<= theta <2 pi )  */
      complexroot,            /* root(n,re^(i theta ))=root(n,r) e^(i theta /n)(0<= theta <2 pi ) */
      complexexponential,     /* e^(i theta ) = cos  theta  + i sin  theta          */
      complexexponential2,    /* e^(x+iy) = e^x cos y + i e^x sin y  */
      etotheipi,              /* e^(i pi ) = -1                      */
      etotheminusipi,         /* e^(-i pi ) = -1                     */
      etothei2npi,            /* e^(2n pi i) = 1                     */
      etothecoterminal,       /* e^((2n pi  +  theta )i) = e^(i theta )          */
      introducelninexponent   /* u^v = e^(v ln u)                 */
     },
     {                            /* complex_hyperbolic       */
      isinh,                  /* sin(it) = i sinh t               */
      icosh,                  /* cos(it) = cosh t                 */
      coshi,                  /* cosh(it) = cos t                 */
      sinhi,                  /* sinh(it) = i sin t               */
      itanh,                  /* tan(it) =  i tanh t              */
      icoth,                  /* cot(it) = -i coth t              */
      tanhi,                  /* tanh(it) = i tan t               */
      cothi,                  /* coth(it) = -i cot t              */
      cosisin,                /* cos t + i sin t = e^(it)         */
      cosminusisin,           /* cos t - i sin t = e^(-it)        */
      complexcosrev,          /* [e^(i theta ) + e^(-i theta )]/2 = cos  theta      */
      complexsinrev,          /* [e^(i theta ) - e^(-i theta )]/2i = sin  theta     */
      complexcosrev2,         /* e^(i theta ) + e^(-i theta ) = 2 cos  theta        */
      complexsinrev2          /* e^(i theta ) - e^(-i theta ) = 2i sin  theta       */
     },
     {                            /* hyperbolic_functions     */
      coshdef,                    /* cosh u = (e^u+e^(-u))/2  */
      coshdefrev2,                /* e^u + e^-u = 2 cosh u    */
      sinhdef,                    /* sinh u = (e^u-e^(-u))/2  */
      sinhdefrev2,                /* e^u-e^(-u) = 2 sinh u    */
      coshdefrev,                 /* e^u-e^(-u) = 2 sinh u    */
      sinhdefrev,                 /* [e^u-e^(-u)]/2 = sinh u  */
      cosheven,                   /* cosh(-u) = cosh u        */
      sinhodd,                    /* sinh(-u) = -sinh u       */
      coshplussinh,               /* cosh u + sinh u = e^u    */
      coshminussinh,              /* cosh u - sinh u = e^(-u) */
      cosh0,                      /* cosh 0 = 1               */
      sinh0,                      /* sinh 0 = 0               */
      exptohyper1,                /* e^x = cosh x + sinh x    */
      exptohyper2                 /* e^(-x) = cosh x - sinh x */
     },
     {                            /* hyperbolic2              */
      sinhsqplus1,                /* sinh^2u + 1 = cosh^2 u     */
      coshsqminus1,               /* cosh^2 u - 1 = sinh^2u     */
      coshsqminussinhsq,          /* cosh^2 u - sinh^2u = 1     */
      coshsqtosinhsq,             /* cosh^2 u = sinh^2u + 1     */
      sinhsqtocoshsq,             /* sinh^2u = cosh^2 u - 1     */
      oneminustanhsq,             /* 1-tan^2u = sech^2u         */
      oneminussechsq              /* 1-sech^2u = tan^2u         */
     },
     {                            /* more_hyperbolic          */
      tanhdef,                    /* tanh u = sinh u / cosh u */
      tanhdefrev,                 /* sinh u / cosh u = tanh u */
      cothdef,                    /* coth u = cosh u / sinh u */
      cothdefrev,                 /* cosh u / sinh u = coth u */
      sechdef,                    /* sech u = 1 / cosh u      */
      sechdefrev,                 /* 1 / cosh u = sech u      */
      cschdef,                    /* csch u = 1 / sinh u      */
      cschdefrev,                 /* 1 / sinh u = csch u      */
      tanhsqplussechsq,           /* tanh^2 u + sech^2 u = 1    */
      tanhsqtosechsq,             /* tanh^2 u = 1 - sech^2 u    */
      sechsqtotanhsq,             /* sech^2 u = 1 - tanh^2 u    */
      sinhsum,                    /* sinh(u\pm v)=sinh u cosh v \pm  cosh u sinh v */
      coshsum,                    /* cosh(u\pm v)=cosh u cosh v \pm  sinh u sinh v */
      doublesinh,                 /* sinh 2u = 2 sinh u cosh u */
      doublecosh,                 /* cosh 2u = cosh^2 u + sinh^2 u  */
      tanhln                      /* tanh(ln u) = (1-u^2)/(1+u^2) */
     },
     {                            /* inverse_hyperbolic       */
      asinhtoln,                  /* asin x = ln(x + sqrt(x^2+1))          */
      acoshtoln,                  /* acos x = ln(x + sqrt(x^2-1))          */
      atanhtoln,                  /* arctanh x = (1/2) ln((1+x)/(1-x)) */
      sinhasinh,                  /* sinh(asinh x) = x */
      coshacosh,                  /* cosh(acosh x) = x */
      tanhatanh,                  /* tanh(atanh x) = x */
      cothacoth,                  /* coth(acoth x) = x */
      sechasech,                  /* sech(asech x) = x */
      cschacsch                   /* csch(acsch x) = x */
     },
     {                           /* dif_hyperbolic */
      difsinh,
      difcosh,
      diftanh,
      difcoth,
      difsech,
      difcsch,
      diflnsinh,
      diflncosh
     },
     {                           /* dif_inversehyperbolic */
      difasinh,
      difacosh,
      difatanh,
      difacoth,
      difasech,
      difacsch
     },
     {                           /* sg_function1      */
      sgpos,                 /* sg(x) = 1 if x > 0   */
      sgneg,                 /* sg(x) = -1 if x < 0  */
      sgzero,                /* sg(0) = 0            */
      sgodd,                 /* sg(-x) = -sg(x)      */
      sgodd2,                /* -sg(x) = sg(-x)      */
      sgabs1,                /* sg(x) = abs(x)/x (x nonzero) */
      sgabs2,                /* sg(x) = x/abs(x) (x nonzero) */
      abssg,                 /* abs(x) = x sg(x)     */
      sgevenpower,           /* sg(x)^(2n) = 1, also sg(x)^(even/odd) */
      sgoddpower,            /* sg(x)^(2n+1) = sg(x), also sg(x)^odd/odd */
      sgrecip,               /* 1/sg(x) = sg(x)      */
      difsg,                 /* d/dx sg(u) = 0 (u nonzero) */
      intsg,                 /* integral sg(x) = x sg(x) */
      sgint,                 /* integral(sg(u)v,x) =
                                sg(u) integral(v,x)  if u is nonzero */
      sgassumepos,           /* sg(x) = 1 assuming x > 0 */
      sgassumeneg            /* sg(x) = -1 assuming x < 0 */
     },
     {                             /* sg_function2  */
      sgprod1,               /* sg(au) = sg(u) if a > 0 */
      sgprod2,               /* sg(au) = -sg(u) if a < 0 */
      sgfract1,              /* sg(au/b) = sg(u) if a/b > 0 */
      sgfract2,              /* sg(au/b) = - sg(u) if a/b < 0 */
      sgpower,               /* sg(x^(2n+1)) = sg(x) */
      sgrecip2,              /* sg(1/u) = sg(u) */
      sgrecip3,              /* sg(c/u) = sg(u) si c > 0 */
      sgtoabs,               /* u sg(u) = |u|    */
      abstimessg             /* |u| sg(u) = u   */
     },
     {                           /* bessel_functions */
      difj0,
      difj1,
      difjn,
      dify0,
      dify1,
      difyn
     },
     {                           /* modified_bessel_functions */
      difi0,
      difi1,
      difin,
      difk0,
      difk1,
      difkn
     },
     {                                 /* functions_menu */
       applyfunction0,
       applyfunction1,
       applyfunction2,
       applyfunction3,
       applyfunction4,
       applyfunction5,
       applyfunction6,
       applyfunction7,
       applyfunction8,
       applyfunction9,
       applyfunction10,
       applyfunction11,
       applyfunction12,
       applyfunction13,
       applyfunction14,
       applyfunction15
     },
     {                         /* automode_only */
                               /* brother array at end of this file must always
                                  match this */
       expand,
       multiplyifcancels,
       ordersimplefactors,
       limsum1,
       limsum2,
       limsum3,
       intsqrt,
       doublecos4,
       eliminatesinsq,
       eliminatecossq,
       eliminatetansq,
       eliminatesecsq,
       maximalsub,
       multiplycoefs,
       preparetocancel
     },
     {                             /* automode_only2 */
       knownroot,
       transfereqn,
       transferstrictineq,
       transferineq,
       transfer,      /* works only on intervals */
       contentgcd,
       fractionalsubstitution,
       gcdsubstitution,
       distribandcancel,
       difofpowers,
       limsum4,
       factorhelper,
       factorandcancel,
       factoroneside
     },
     {                             /* automode_only3 */
       unitelns,
       unitelogs,
       unitelns2,
       unitelogs2,
       trigsuminfraction,
       cleanupexponents
     }
};
/*_____________________________________________________________*/
/* when an automode_only operator is used by think_ahead, its
brother from the following table is entered in 'plan' instead of
itself; so this should tell what operator the user should choose
at the point where automode used this operator */
/*_______________________________________________________*/
actualop brother[3][16] =
{
 {
   multiplyout,      /* brother of expand */
   distriblaw,      /* brother of multiplyifcancels */
   orderfactors,     /* brother of ordersimplefactors */
   orderfactors,     /* finishedfactoring always fails, so it doesn't matter
                        what we put in this array for its brother */
   factordenominator, /* brother of limsum1 */
   commondenom,      /* brother of limsum2 */
   eliminatenegexp,  /* brother of limsum3 */
   sqrtexp,          /* brother of intsqrt (integrate square root)  */
   doublecos1,       /* brother of doublecos4 */
   sinsqtocossq,     /* brother of eliminatesinsq */
   cossqtosinsq,     /* brother of eliminatecossq */
   tansqtosecsq,     /* brother of eliminatetansq */
   secsqtotansq,     /* brother of eliminatesecsq */
   makesubstitution, /* brother of maximalsub     */
   multiplyfractions, /* brother of multiplycoefs  */
   sinsqtocossq     /* brother of preparetocancel--doesn't matter what it is. */
 },
 {           /* brothers of operators in automode_only2  */
   evaltorational,   /* brother of knownroot          */
   addeqn,           /* brother of transfereqn        */
   addeqn1,          /* brother of transferstrictineq */
   addeqn2,          /* brother of transferineq       */
   addeqn1,          /* brother of transfer           */
   factorop,         /* brother of contentgcd         */
   makesubstitution, /* brother of fractionalsubstitution */
   makesubstitution, /* brother of gcdsubstitution    */
   distriblaw,       /* brother of distribandcancel   */
   multiplyoutandsimp,   /* brother of difofpowers    */
   tanrule,          /* brother of limsum4; but it could just as
                        well be secrule, secrule2,... */
   contentfactor,    /* brother of factorhelper       */
   differenceofsquares, /* brother of factorandcancel */
   factorsquareofsum /* brother of factoroneside     */
 },
 {                       /* brothers of operators in automode_only3  */
   lnofpower,        /* brother of unitelns           */
   logofpower,       /* brother of unitelogs          */
   lnofproduct,      /* brother of unitelns2          */
   logofproduct,     /* brother of unitelogs2         */
   sumofsin,         /* brother of trigsuminfraction  */
   arithmetic        /* brother of cleanupexponents   */
 }
};

/*_________________________________________________________*/
 actualop * access_optable(int n)
{
  return optable[n];
}
/*_________________________________________________________*/
 actualop get_brother(int menu, int i)
/* return brother[0][i], brother[1][i], or brother[2][i]
   according as menu is automode_only, automode_only2, automode_only3
*/
{
   switch(menu)
     { case automode_only:
          return brother[0][i];
       case automode_only2:
          return brother[1][i];
       case automode_only3:
          return brother[2][i];
     }
  return NULL;
}
/*__________________________________________________________*/
 int cousins(operation a, operation b)
/* return 1 if a and b have the same effect, so that
user could have chosen either one.  This is called by
think_ahead when generating error messages:  if b is what
automode would do at step 2 and user chooses a at step 1,
user will get an error message the same as if he chose b
at step 1.  It is presumed that a and b are not equal
(as operators, though the associated actualop might be the
same).  The automode-op comes in a and the user's op
comes in b; the function is not necessarily symmetrical
as operators never used in auto mode don't have to be
listed in b position.
*/

{ actualop A, B;

  A = optable[a.men][a.choice-1];
  B = optable[b.men][b.choice-1];

  if((void  *) A == (void  *) B)
     return 1;   /* same code at different places in menu */
  if( (void  *) A == (void  *) collectall )
     return (void  *) B == (void  *) collectterms;
  if( (void  *) A == (void  *) collectterms )
     return (void  *) B == (void  *) collectall;
  if( (void  *) A == (void  *) commondenom )
     { if( (void  *) B == (void  *) commondenomandsimp ||
           (void  *) B == (void  *) commondenominfraction ||
           (void  *) B == (void  *) commondenom2 ||
           (void  *) B == (void  *) findcommondenom ||
           (void  *) B == (void  *) commondenomandsimp2
         )
           return 1;
       else
           return 0;
     }
  if( (void  *) A == (void  *) commondenomandsimp )
     { if( (void  *) B == (void  *) commondenom ||
           (void  *) B == (void  *) commondenominfraction ||
           (void  *) B == (void  *) commondenom2 ||
           (void  *) B == (void  *) commondenomandsimp2 ||
           (void  *) B == (void  *) findcommondenom
         )
           return 1;
       else
           return 0;
     }
  if( (void  *) A == (void  *) findcommondenom )
     { if( (void  *) B == (void  *) commondenomandsimp ||
           (void  *) B == (void  *) commondenom ||
           (void  *) B == (void  *) commondenominfraction ||
           (void  *) B == (void  *) commondenom2 ||
           (void  *) B == (void  *) commondenomandsimp2
         )
           return 1;
       else
           return 0;
     }
  return 0;
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists