File r37/patches/patches.rlg from the latest check-in


Tue Mar  6 13:52:20 PST 2001
Loading image file :/home/hearn/reddist/reduce3.7/lisp/psl/linux/red/reduce.img 
REDUCE 3.7, 15-Apr-1999, patched to 6-Mar-2001 ...

1: 
2: 2: 2: 2: 2: 2: 2: 
3: 3: % This file tests some of the patches included in the patches.red file.
% If the latter file has been correctly installed, none of these should
% give an error.

%  7 Aug 99.

% This did not terminate.

df(tan((sqrt(1-x^2)*asin acos x + 2*sqrt(1-x^2)*x)/x),x);


           4
( - acos(x) *asin(acos(x))

                2                                 2
       sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2
 *tan(-----------------------------------------------------)
                                x

           4
  - acos(x) *asin(acos(x))

                             2                                 2
             4      sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2  3
  - 2*acos(x) *tan(-----------------------------------------------------) *x
                                             x

             4  3            2
  - 2*acos(x) *x  + 2*acos(x) *asin(acos(x))

                2                                 2
       sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2
 *tan(-----------------------------------------------------)
                                x

             2                          2                     2             2
  + 2*acos(x) *asin(acos(x)) + sqrt( - x  + 1)*sqrt( - acos(x)  + 1)*acos(x)

                2                                 2
       sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2
 *tan(-----------------------------------------------------) *x
                                x

             2                     2             2
  + sqrt( - x  + 1)*sqrt( - acos(x)  + 1)*acos(x) *x

                             2                                 2
             2      sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2  3
  + 4*acos(x) *tan(-----------------------------------------------------) *x
                                             x

             2  3
  + 4*acos(x) *x

                                2                                 2
                       sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2
  - asin(acos(x))*tan(-----------------------------------------------------)
                                                x

                             2                     2
  - asin(acos(x)) - sqrt( - x  + 1)*sqrt( - acos(x)  + 1)

                2                                 2
       sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2
 *tan(-----------------------------------------------------) *x
                                x

             2                     2
  - sqrt( - x  + 1)*sqrt( - acos(x)  + 1)*x

                    2                                 2
           sqrt( - x  + 1)*asin(acos(x)) + 2*sqrt( - x  + 1)*x  2  3      3
  - 2*tan(-----------------------------------------------------) *x  - 2*x )/(
                                    x

            2       2         4            2
   sqrt( - x  + 1)*x *(acos(x)  - 2*acos(x)  + 1))



% 20 Oct 99.

% This gave a wrong answer.

a1:=12x^2-16x+3;


          2
a1 := 12*x  - 16*x + 3

a2:=3x-4;


a2 := 3*x - 4

off mcd;


on combineexpt;


e^(a1/a2);


             -1  2               -1                -1
 12*(3*x - 4)  *x  - 16*(3*x - 4)  *x + 3*(3*x - 4)
e

on mcd;

 off combineexpt;


clear a1,a2;



%  8 Nov 99.

% This gave a catastrophic error.

factorize(2*c*s*u^3*v^5-2*c*s*u^3*v +2*c*s*u*v^5-2*c*s*u*v
	  -s^2*u^4*v^4+s^2*u^4+s^2*u^2*v^6-s^2*u^2*v^4-s^2*u^2*v^2
	  +s^2*u^2 +s^2*v^6-s^2*v^2+u^4*v^4-u^4*v^2 -v^4+v^2);


           3                2  2  2    2  2    2  4    2  2    2  2    2
{{2*c*s*u*v  + 2*c*s*u*v - s *u *v  - s *u  + s *v  + s *v  + u *v  - v ,

  1},

   2
 {u  + 1,1},

 {v + 1,1},

 {v - 1,1}}



% 18 Dec 99.

% The following integration generated a catastrophic error.

load_package numeric;



on rounded;



f := exp(10*exp(-x)*(x+1-0.1))$



num_int(f,x=(0 .. 300));


5615.56420985


off rounded;



clear f;



% 31 Jan 00.

% This gave an error that x was invalid as a kernel.

weight x=1,y=1;


{}
 wtlevel 10;


1
 factor x;



symbolic(wtl!* := asymplis!* := nil);



remfac x;




% 5 Feb 00.

% This gave a spurious error.

matx := mat((1,2));


matx := [1  2]

 sign sqrt 42;


1



%  6 Feb 00.

% This gave a wrong answer.

on complex;



sqrt(i*sqrt(3)-1);


 sqrt(2)*(i*sqrt(3) + 1)
-------------------------
            2


off complex;



% 10 Feb 00.

% This gave the error that "***** x= - 2.61803398875 invalid as scalar."

on rounded,fullroots;



solve(x^3+4*x^2+4*x+1,x);


{x= - 2.61803398875,x= - 0.38196601125,x=-1}


off rounded,fullroots;




% 18 Feb 00.

% This used to cause a type mismatch error.

m := mat((a,b),(c,d));


     [a  b]
m := [    ]
     [c  d]

 det sub(a=1,m);


 - b*c + d


% 18 Apr 00.

% matchlength!* can now be set to match more products.

for all a let opr(a*v) = a*opr(v);


*** opr declared operator 


opr(a1*a2*a3*a4*a5*v);


opr(a1*a2*a3*a4*a5*v)


matchlength!* := 6;


matchlength* := 6


opr(a1*a2*a3*a4*a5*v);


opr(v)*a1*a2*a3*a4*a5


% 22 Apr 00;

% This example created a long list in oldrules!*.

procedure hu (x); wq(x) := x^2;


hu
 wq(2) := 20;


*** wq declared operator 

wq(2) := 20


for i:=1:1000 do hu i;

 for i:=1:1000 do hu i;



lisp length oldrules!*;


0



% 28 Jul 00.

% A sum index within a derivative was treated as an identifier.

sum(x^n/factorial n*sub(x=0,df(cos x,x,n)),n,0,5);


  4       2
 x  - 12*x  + 24
-----------------
       24



% 2 Aug 00.

% With complex on, some factorizations seemed to run forever.

on complex;



factorize (400*y^12+400*y^10*z+40*y^9*z^2+100*y^8*z^2
	   +20*y^7*z^5+120*y^7*z^4+20*y^7*z^3+41*y^6*z^4+60*y^5*z^7
	   +60*y^5*z^5+20*y^4*z^7+6*y^4*z^6+20*y^4*z^5
	   +2*y^3*z^6+9*y^2*z^8+6*y*z^8+z^8);


       12        10         9  2        8  2       7  5        7  4       7  3
{{400*y   + 400*y  *z + 40*y *z  + 100*y *z  + 20*y *z  + 120*y *z  + 20*y *z

         6  4       5  7       5  5       4  7      4  6       4  5      3  6
   + 41*y *z  + 60*y *z  + 60*y *z  + 20*y *z  + 6*y *z  + 20*y *z  + 2*y *z

        2  8        8    8
   + 9*y *z  + 6*y*z  + z ,

  1}}


off complex;




% 29 Aug 00.

% This caused a segmentation violation or similar error.

load_package gentran,scope;



matrix aaa(10,10);



on gentranopt;



gentran aaa(1,1) ::=: aaa(1,1);



      real aaa(n,n)
      aaa(1,1)=0.0

t


off gentranopt;



% 19 Sep 00.

% This used to give a spurious "not found" message.

sqrt_:= {sqrt(~x/~y) => sqrt x/sqrt y};


                ~x       sqrt(x)
sqrt_ := {sqrt(----) => ---------}
                ~y       sqrt(y)


clearrules sqrt_;



clear sqrt_;



% 20 Sep 00.

% The following caused a catastrophic error.

load_package algint;



int(1/sqrt((2*e^c-y)/(e^c*y)),y);


                                                       c
 c/2                     c         c           sqrt(2*e  - y)
e   *( - sqrt(y)*sqrt(2*e  - y) + e *int(--------------------------,y))
                                                     c
                                          2*sqrt(y)*e  - sqrt(y)*y



% 8 Nov 00.

% The following did not optimize completely.

load_package scope;



dX1 := - sqrt(abs(k_l*mttx1 - k_l*mttx2))*sign(k_l*mttx1 - k_l*mttx2)*f*mttu5 +
         sqrt(abs(k_l*mttx1 - k_s*mttx3 - mttu3))*
          sign( - k_l*mttx1 + k_s*mttx3 + mttu3)*f*mttu6 + 
         sqrt(abs(k_l*mttx1 - k_s*mttx4 - mttu4))*
          sign( - k_l*mttx1 + k_s*mttx4 + mttu4)*f*mttu7 - mttu2$


dX2 :=   sqrt(abs(k_l*mttx1 - k_l*mttx2))*sign(k_l*mttx1 - k_l*mttx2)*f*mttu5 
       - sqrt(abs(k_l*mttx2 - k_s*mttx3))*sign(k_l*mttx2 - k_s*mttx3)*f*mttu8 
       - sqrt(abs(k_l*mttx2 - k_s*mttx4))*sign(k_l*mttx2 - k_s*mttx4)*f*mttu9 +
          mttu1$


dX3 := f*( - sqrt(abs(k_l*mttx1 - k_s*mttx3 - mttu3))*
             sign( - k_l*mttx1 + k_s*mttx3 + mttu3)*mttu6 + 
             sqrt(abs(k_l*mttx2 - k_s*mttx3))*
             sign(k_l*mttx2 - k_s*mttx3)*mttu8)$


dX4 := f*( - sqrt(abs(k_l*mttx1 - k_s*mttx4 - mttu4))*
             sign( - k_l*mttx1 + k_s*mttx4 + mttu4)*mttu7 + 
             sqrt(abs(k_l*mttx2 - k_s*mttx4))*
             sign(k_l*mttx2 - k_s*mttx4)*mttu9)$



optimize
  dX1 :=: dX1,
  dX2 :=: dX2,
  dX3 :=: dX3,
  dX4 :=: dX4 
iname s$



s31 := mttx2*k_l
s33 := mttx1*k_l
s3 := s33 - s31
s32 := mttx3*k_s
s7 := s32 - s33 + mttu3
s30 := mttx4*k_s
s11 := s30 - s33 + mttu4
s26 := mttu7*sign(s11)*sqrt(abs( - s11))*f
s28 := mttu6*sign(s7)*sqrt(abs( - s7))*f
s29 := mttu5*f*sign(s3)*sqrt(abs(s3))
dx1 := s26 + s28 - s29 - mttu2
s15 := s31 - s32
s19 := s31 - s30
s25 := mttu9*sign(s19)*sqrt(abs(s19))*f
s27 := mttu8*sign(s15)*sqrt(abs(s15))*f
dx2 := s29 + mttu1 - s25 - s27
dx3 := s27 - s28
dx4 := s25 - s26


remprop('!:rd!:,'intequivfn);


rdintequiv


% 20 Nov 00.

% This used to return results in the wrong order.

noncom u,v;



sum(u(n)*v(1-n),n,0,1);


*** u declared operator 

*** v declared operator 

u(1)*v(0) + u(0)*v(1)


% 13 Dec 00.

% This used to go into an infinite loop.

on numval,rounded;

 y:=x^4+x3*x^3+x2*x^2+x1*x+x0;


      4    3       2
y := x  + x *x3 + x *x2 + x*x1 + x0


on fullroots;



% This one takes a long time.

% solve(y,x)$

off numval,rounded,fullroots;

 clear y;




%  9 Jan 01.

solve({y=x+t^2,x=y+u^2},{x,y,u,t});


         2
{{x=y - t ,

  y=arbcomplex(4),

  u=t*i,

  t=arbcomplex(3)},

         2
 {x=y - t ,

  y=arbcomplex(2),

  u= - t*i,

  t=arbcomplex(1)}}


% 14 Jan 01.

% This caused an error.

resultant(p^3-3p^2-a,3p*(p-2),p);


27*a*(a + 4)


% 19 Jan 01.

% Some algebraic integrals could produce a catastrophic error.

% Unfortunately, there is no simple example of this problem.

% 22 Jan 01.

% This used to give a spurious zero divisor error.

int((sqrt((-sqrt(a^4*x^2+4)+a^2*x)/(2*x))
       *(-sqrt(a^4*x^2+4)*a^2*x-a^4*x^2-4))/(2*(a^4*x^2+4)),x);


                                  4  2         2
                    sqrt( - sqrt(a *x  + 4) + a *x)
(sqrt(2)*( - 4*int(---------------------------------,x)
                                4  2
                       sqrt(x)*a *x  + 4*sqrt(x)

                                        4  2         2
                  sqrt(x)*sqrt( - sqrt(a *x  + 4) + a *x)*x      4
           - int(-------------------------------------------,x)*a
                                   4  2
                                  a *x  + 4

                                4  2                    4  2         2
                  sqrt(x)*sqrt(a *x  + 4)*sqrt( - sqrt(a *x  + 4) + a *x)      2
           - int(---------------------------------------------------------,x)*a
                                          4  2
                                         a *x  + 4

          ))/4


% This used to return an incorrect result.

noncom q;



1/mat((1,0,0),(x/p*q 1,1,0),(x*y/(2p*(p-1))*q 1*q 1,y/(p-2)*q 1,1));


*** q declared operator 

[        1                0       0]
[                                  ]
[     - x*q(1)                     ]
[   -----------           1       0]
[        p                         ]
[                                  ]
[            2                     ]
[    x*y*q(1)          - y*q(1)    ]
[------------------  -----------  1]
[     2                 p - 2      ]
[ 2*(p  - 3*p + 2)                 ]



% 2 Feb 01.

% This used to give a spurious zero divisor error.

solve(sqrt x*sqrt((4x^2*x+1)/x)-1=0,x);


{x=0}


% 9 Feb 01.

% The patched version of combine!-logs included an undefined macro.

% No test is included for this.

% 20 Feb 01.

% Even with combineexpt on, some expressions did not simplify adequately.

on combineexpt;



a*a^x;


 x + 1
a


e*e^(2/(2-x));


 (x - 4)/(x - 2)
e


e^(x+3)*e^(3/(4-3*x))/e^(5*x-3);


         2
 ( - 12*x  + 34*x - 27)/(3*x - 4)
e


off combineexpt;



%  6 Mar 01.

% This produced a stream of "***** Unexpected algebraic" messages and
% then aborted.

int((x^(2/3)*sqrt(sqrt(y)*sqrt(pi) + 2*pi*y*x)*sqrt( - sqrt(y)*sqrt(pi)
	     + 2pi*y*x))/(4pi*y*x^3 - x),x);


     sqrt(sqrt(y)*sqrt(pi) + 2*pi*x*y)*sqrt( - sqrt(y)*sqrt(pi) + 2*pi*x*y)
int(------------------------------------------------------------------------,x)
                                1/3     2      1/3
                             4*x   *pi*x *y - x


end;

4: 4: 4: 4: 4: 4: 4: 4: 4: 

Time for test: 30720 ms, plus GC time: 1070 ms

5: 5: 
Quitting
Tue Mar  6 13:52:51 PST 2001


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