File r36/xlog/WU.LOG artifact e16580baed part of check-in 3af273af29


REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...


% wu.tst

% Russell Bradford, 8 June 90.

% Some tests for the Wu algorithm
% The order directives are not necessary for general use: they just
% help tie things down for testing purposes.

% run after loading Wu code: in "wu.red"$

% test 1

order x,y,a,b;



wu({x^2+y^2-a,x*y-b}, {x,y});


       4    2      2
{{{ - y  + y *a - b , - x*y + b},

  y}}


% test 2

order x,y,a,b;



wu({x^2+y^2-a,x*y-b},{x,y,a,b});


           2
{{{b,y, - x  + a},1},

       4    2      2
 {{ - y  + y *a - b , - x*y + b},

  y}}


% test 3

order x,y,z,r;



wu({x^2+y^2+z^2-r^2, x*y+z^2-1, x*y*z-x^2-y^2-z+1}, {x,y,z});


    3    2    2
{{{z  - z  + r  - 1,

       4    2  2    2  2    2      2        2
    - y  - y *z  + y *r  + z  + z*r  - z + r  - 2,

          2
   x*y + z  - 1},

  y},

    7    6      5    4  2    4    3      2  2    2    2
 {{z  - z  - 2*z  + z *r  + z  + z  - 2*z *r  + z  + r  - 1,

    2   3    2    2
   y *(z  - z  + r  - 1),

          2
   x*y + z  - 1},

      3    2    2
  y*(z  - z  + r  - 1)}}


% test 4

order x,y,z,r;



wu({x^2+y^2+z^2-r^2, x*y+z^2-1, x*y*z-x^2-y^2-z+1}, {x,y,z,r});


    3    2    2
{{{z  - z  + r  - 1,

       4    2  2    2  2    2      2        2
    - y  - y *z  + y *r  + z  + z*r  - z + r  - 2,

          2
   x*y + z  - 1},

  y},

    4      2
 {{r  - 4*r  + 3,

        2
   z + r  - 2,

   y,

       2    2
    - x  + r  - 1},

  1},

    7    6      5    4  2    4    3      2  2    2    2
 {{z  - z  - 2*z  + z *r  + z  + z  - 2*z *r  + z  + r  - 1,

    2   3    2    2
   y *(z  - z  + r  - 1),

          2
   x*y + z  - 1},

      3    2    2
  y*(z  - z  + r  - 1)}}


% test 5

order x,y,z;



wu({(x-1)*(y-1)*(z-1), (x-2)*(y-2)*(z-2), (x-3)*(y-3)*(z-3)}, {x,y,z});


    2
{{{z  - 5*z + 6,

       2        2
   2*(y *z - 3*y  - 4*y*z + 12*y + 3*z - 9),

   x*y*z - 3*x*y - 3*x*z + 9*x - 3*y*z + 9*y + 9*z - 27},

        2                    2
  2*(y*z  - 6*y*z + 9*y - 3*z  + 18*z - 27)},

 {{z - 3,y - 2,2*(x - 1)},2},

             2
 {{z - 3,2*(y  - 3*y + 2),x*y - 2*x - 2*y + 4},

  2*(y - 2)},

 {{2*(z - 3),2*(y - 2),4*(x - 1)},16},

                 2
 {{2*(z - 3),4*(y  - 3*y + 2),2*(x*y - 2*x - 2*y + 4)},

  16*(y - 2)},

    2
 {{z  - 5*z + 6,

   y*z - 3*y - 3*z + 9,

   2*(x*z - 3*x - z + 3)},

      2
  2*(z  - 6*z + 9)},

       3      2
 {{2*(z  - 6*z  + 11*z - 6),

   y*z - 3*y - 3*z + 9,

      2                    2
   x*z  - 5*x*z + 6*x - 2*z  + 10*z - 12},

      3      2
  2*(z  - 8*z  + 21*z - 18)},

       3      2
 {{4*(z  - 6*z  + 11*z - 6),

    2  2      2        2        2                      2
   y *z  - 5*y *z + 6*y  - 5*y*z  + 25*y*z - 30*y + 6*z  - 30*z + 36,

   x*y*z - 3*x*y - 3*x*z + 9*x - 3*y*z + 9*y + 9*z - 27},

        3        2                      3       2
  4*(y*z  - 8*y*z  + 21*y*z - 18*y - 3*z  + 24*z  - 63*z + 54)}}


% test 6

order x,y,z;



wu({(x-1)*(y-1)*(z-1), (x-2)*(y-2)*(z-2), (x-3)*(y-3)*(z-3)});


    2
{{{z  - 5*z + 6,

       2        2
   2*(y *z - 3*y  - 4*y*z + 12*y + 3*z - 9),

   x*y*z - 3*x*y - 3*x*z + 9*x - 3*y*z + 9*y + 9*z - 27},

        2                    2
  2*(y*z  - 6*y*z + 9*y - 3*z  + 18*z - 27)},

 {{z - 3,y - 2,2*(x - 1)},2},

             2
 {{z - 3,2*(y  - 3*y + 2),x*y - 2*x - 2*y + 4},

  2*(y - 2)},

 {{2*(z - 3),2*(y - 2),4*(x - 1)},16},

                 2
 {{2*(z - 3),4*(y  - 3*y + 2),2*(x*y - 2*x - 2*y + 4)},

  16*(y - 2)},

    2
 {{z  - 5*z + 6,

   y*z - 3*y - 3*z + 9,

   2*(x*z - 3*x - z + 3)},

      2
  2*(z  - 6*z + 9)},

       3      2
 {{2*(z  - 6*z  + 11*z - 6),

   y*z - 3*y - 3*z + 9,

      2                    2
   x*z  - 5*x*z + 6*x - 2*z  + 10*z - 12},

      3      2
  2*(z  - 8*z  + 21*z - 18)},

       3      2
 {{4*(z  - 6*z  + 11*z - 6),

    2  2      2        2        2                      2
   y *z  - 5*y *z + 6*y  - 5*y*z  + 25*y*z - 30*y + 6*z  - 30*z + 36,

   x*y*z - 3*x*y - 3*x*z + 9*x - 3*y*z + 9*y + 9*z - 27},

        3        2                      3       2
  4*(y*z  - 8*y*z  + 21*y*z - 18*y - 3*z  + 24*z  - 63*z + 54)}}


% test 7

order x1,x2,x3,x4;



p1 := x1+x2+x3+x4;


p1 := x1 + x2 + x3 + x4

p2 := x1*x2+x2*x3+x3*x4+x4*x1;


p2 := x1*x2 + x1*x4 + x2*x3 + x3*x4

p3 := x1*x2*x3+x2*x3*x4+x3*x4*x1+x4*x1*x2;


p3 := x1*x2*x3 + x1*x2*x4 + x1*x3*x4 + x2*x3*x4

p4 := x1*x2*x3*x4 - 1;


p4 := x1*x2*x3*x4 - 1


wu({p1,p2,p3,p4}, {x1,x2,x3,x4});


         4
{{{x4*(x4  - 1),

     2
   x4 *(x3 - x4),

     2    2               2
   x4 *(x2  + 2*x2*x4 + x4 ),

     2
   x4 *(x1 + x2 + 2*x4)},

    6
  x4 },

     4
 {{x4  - 1,

     2
   x4 *(x3 - x4),

           2               2
   2*x4*(x2  + 2*x2*x4 + x4 ),

     2
   x4 *(x1 + x2 + 2*x4)},

      5
  2*x4 },

     4
 {{x4  - 1,

   x3 - x4,

     2               2
   x2  + 2*x2*x4 + x4 ,

   x1 + x2 + 2*x4},

  1},

     4
 {{x4  - 1,

     2     2
   x3  - x4 ,

           2        3        3
   x2*x3*x4  - x2*x4  + x3*x4  - 1,

                             2
   x1*x3 - x1*x4 - x3*x4 + x4 },

    2    2               2
  x4 *(x3  - 2*x3*x4 + x4 )},

     8       4
 {{x4  - 2*x4  + 1,

     2     2
   x3  - x4 ,

           2        3        3
   x2*x3*x4  - x2*x4  + x3*x4  - 1,

        4             4
   x1*x4  - x1 + x3*x4  - x3},

    2       4          5
  x4 *(x3*x4  - x3 - x4  + x4)},

     2    4
 {{x4 *(x4  - 1),

     3
   x4 *(x3 - x4),

     3    2               2
   x4 *(x2  + 2*x2*x4 + x4 ),

     3
   x4 *(x1 + x2 + 2*x4)},

    9
  x4 },

         4
 {{x4*(x4  - 1),

     3
   x4 *(x3 - x4),

       2    2               2
   2*x4 *(x2  + 2*x2*x4 + x4 ),

     3
   x4 *(x1 + x2 + 2*x4)},

      8
  2*x4 },

     4
 {{x4  - 1,

   x4*(x3 - x4),

         2               2
   x4*(x2  + 2*x2*x4 + x4 ),

   x4*(x1 + x2 + 2*x4)},

    3
  x4 },

         4
 {{x4*(x4  - 1),

     2    2     2
   x4 *(x3  - x4 ),

               2        3        3
   x4*(x2*x3*x4  - x2*x4  + x3*x4  - 1),

                                 2
   x4*(x1*x3 - x1*x4 - x3*x4 + x4 )},

    6    2               2
  x4 *(x3  - 2*x3*x4 + x4 )},

         8       4
 {{x4*(x4  - 2*x4  + 1),

     2    2     2
   x4 *(x3  - x4 ),

               2        3        3
   x4*(x2*x3*x4  - x2*x4  + x3*x4  - 1),

            4             4
   x4*(x1*x4  - x1 + x3*x4  - x3)},

    6       4          5
  x4 *(x3*x4  - x3 - x4  + x4)},

     3   2     2   3
 {{x3 *x4  + x3 *x4  - x3 - x4,

        2        2     2        3
   x2*x3  - x2*x4  + x3 *x4 - x4 ,

        2   2        4     2   3        4
   x1*x3 *x4  - x1*x4  - x3 *x4  - x3*x4  + x3 + x4},

    4    4       2   2     4
  x4 *(x3  - 2*x3 *x4  + x4 )}}


% test 8

order x,y,z;



wu({z*z,y*z-1,x*z-1}, {x,y,z});


{{{1},1}}


end;
(TIME:  wu 2330 2420)


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]