wu.tst 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. % wu.tst
  2. % Russell Bradford, 8 June 90.
  3. % Some tests for the Wu algorithm
  4. % The order directives are not necessary for general use: they just
  5. % help tie things down for testing purposes.
  6. % run after loading Wu code: in "wu.red"$
  7. % test 1
  8. order x,y,a,b;
  9. wu({x^2+y^2-a,x*y-b}, {x,y});
  10. % test 2
  11. order x,y,a,b;
  12. wu({x^2+y^2-a,x*y-b},{x,y,a,b});
  13. % test 3
  14. order x,y,z,r;
  15. 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});
  16. % test 4
  17. order x,y,z,r;
  18. 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});
  19. % test 5
  20. order x,y,z;
  21. wu({(x-1)*(y-1)*(z-1), (x-2)*(y-2)*(z-2), (x-3)*(y-3)*(z-3)}, {x,y,z});
  22. % test 6
  23. order x,y,z;
  24. wu({(x-1)*(y-1)*(z-1), (x-2)*(y-2)*(z-2), (x-3)*(y-3)*(z-3)});
  25. % test 7
  26. order x1,x2,x3,x4;
  27. p1 := x1+x2+x3+x4;
  28. p2 := x1*x2+x2*x3+x3*x4+x4*x1;
  29. p3 := x1*x2*x3+x2*x3*x4+x3*x4*x1+x4*x1*x2;
  30. p4 := x1*x2*x3*x4 - 1;
  31. wu({p1,p2,p3,p4}, {x1,x2,x3,x4});
  32. % test 8
  33. order x,y,z;
  34. wu({z*z,y*z-1,x*z-1}, {x,y,z});
  35. end;