File r38/packages/support/patches.rlg artifact ccd7e24535 part of check-in 3519b83598


Fri Jan 12 07:31:07 PST 2007
Loading image file :/home/hearn/reddist/reduce3.8/lisp/psl/linux/red/reduce.img 

REDUCE 3.8, 15-Apr-2004, patched to 11-Jan-2007 ...

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.

% 26 Jun 04.

% This used to give a catastrophic error.

on rounded;

 precision 25;


12


solve({- 1.999994390224005889280191x1*y + 7.979376557069442737297309x1
   - x2*y^2 + 7.974996524843785878673843x2*y - 15.90005560267478176018537
   x2 - 1.999994390224005889280191x3*y + 7.974974155871756786131486x3
   - 0.9999943902318732859562161,
   - 0.9999943902318732859562161x1 - 1.999994390224005889280191x2*y
   + 7.974974155871756786131486x2 - x3*y^2 + 7.974996524843785878673843
   x3*y - 15.90005560267478176018537x3 - 1.999994390224005889280191y
   + 7.979376557069442737297309,
   - 0.9999943902318732859562161x2 - 1.999994390224005889280191x3*y
   + 8.005202587362861321828448x3 - y^2 + 8.009627454668455757619651y
   - 15.03852566251722658450117},
      {x1,x2,x3})$



off rounded;

 precision 12;


25


% 8 Jul 04;

% This used to return zero.

int(e^(a^(1/3)*x)*sin x,x);


   1/3
  a   *x               1/3
 e      *( - cos(x) + a   *sin(x))
-----------------------------------
              2/3
             a    + 1


% 5 Aug 04.

% This used to give an "invalid as operator" error;

load rlfi;

 on latex;

\documentstyle{article}
\begin{document}


procedure fac n;
  if not(fixp n and n>=0) then rederr "non negative integer required"
   else for i:= 1:n product i;


fac


fac 10;

\begin{displaymath}
3628800
\end{displaymath}


off latex;

\end{document}


% 2 Sep 04.

% In rare circumstances, floating point conversion could give an
%  extraneous error.

symbolic read!:num 3.14;


(!:rd!: 220957856717865 . -46)


%  6 Sep 04.

% With rational on, some non-zero factorizations could produce
% a zero coefficient.

on rational;

 factorize(r^((1/4*n^2 - 1/4*n + 1)/(n - 1)));


   1/(n - 1)
{{r         ,1},

   n/4
 {r   ,1}}
 off rational;



% 28 Sep 04.

% This did not produce a closed form solution.

load_package algint;

 int(sqrt(x-1)/(sqrt x*(x-1)),x);


2*log(sqrt(x - 1) + sqrt(x))
 off algint;



% 10 Dec 04.

% This used to produce an erroneous output.

depend {f,b,k},x;



on dfprint;



{df(f,x,~n) => df(k*b,x,n)};


{f     => k*b   }
  x,~n       x,n


nodepend {f,b,k},x;



off dfprint;



% 31 Jan 05.  Some integrals involving square roots could run forever.

% There is no simple example of this error.

% 12 Feb 05.  SOLVE could produce a spurious recursive loop.

solve((4*e^(y^3/3)*cte+2x^2+y^3+3)/e^(y^3/3),y);


                3
              y_ /3          2     3
{y=root_of(4*e     *cte + 2*x  + y_  + 3,y_,tag_3)}


% 20 Apr 05. This gave a DIVISION FAILED error.

int(e^(-a^(1/4)*(-1)^(1/4)*x),x);


      1/4       1/4
     a   *( - 1)   *i
---------------------------
   1/4       1/4
  a   *( - 1)   *x
 e                *sqrt(a)


% 2 May 05. This gave a DIVISION FAILED error.

int(e^(-a^(1/4)*(-1)^(1/4)*i*x)*b+(1/4)*e^(-a^(1/4)
     *(-1)^(1/4)*i*x)*x,x);


          3/4       3/4      3/4       3/4
 i*( - 4*a   *( - 1)   *b - a   *( - 1)   *x - sqrt(a))
--------------------------------------------------------
                    1/4       1/4
                   a   *( - 1)   *i*x
                4*e                  *a


% 22 May 05.  This integral never completed.

int(e^((3sqrt 5+1)*x)*(sqrt 5+1)+e^((3sqrt 5-1)*x)*(sqrt 5+1),x);


  3*sqrt(5)*x   2*x              2*x
 e           *(e   *sqrt(5) + 7*e    + 2*sqrt(5) + 8)
------------------------------------------------------
                            x
                        22*e


% 30 May 05.  This used to give a spurious "Zero divisor" error.

solve({log tan(y/2),y+1/x},{x,y});


                      - 1
{{x=--------------------------------------,
     4*(arbint(2)*pi + atan(sqrt(2) - 1))

  y=4*(arbint(2)*pi + atan(sqrt(2) - 1))},

                      - 1
 {x=--------------------------------------,
     4*(arbint(2)*pi - atan(sqrt(2) + 1))

  y=4*(arbint(2)*pi - atan(sqrt(2) + 1))}}


% 4 Oct 05.  DEG did not work with rational coefficients.

deg(x^3/a-x/5+1/4,x);


3


% 5 Oct 05.  Some SOLVE calculations gave a spurious "Zero Divisor" error.

ex0:= sqrt(a^2-y^2);


             2    2
ex0 := sqrt(a  - y )


solve((-log(( - x + a + y)/ex0) + log((x + a + y)/ex0) + x
   - (a^2 - y^2)/ex0),y);


             2             2    2          y_ + a - x
{y=root_of(y_  - sqrt( - y_  + a )*log(-------------------)
                                                  2    2
                                        sqrt( - y_  + a )

                        2    2          y_ + a + x                   2    2
            + sqrt( - y_  + a )*log(-------------------) + sqrt( - y_  + a )*x
                                               2    2
                                     sqrt( - y_  + a )

               2
            - a ,y_,tag_9)}


clear ex0;



% 16 Nov 05. System errors could occur with rounded and combineexpt on.

on rounded,combineexpt;



0.183*e^x*t^4.39;


       x  4.39
0.183*e *t


off rounded,combineexpt;



% 22 Nov 05. Some definite integrals with variables other than x could
%            give a wrong answer.

int(e^(-y),y,0,x);


  x
 e  - 1
--------
    x
   e


%  9 Dec 05. With combineexpt on, expressions could be dropped.

on combineexpt;

 4*e^(-3*h/2) - 3*h*e^(-h) + 2*e^(-h);


    - (3*h)/2       - h         - h
4*e           - 3*e    *h + 2*e
 off combineexpt;



% 20 Feb 06.  The rule for df(Jacobidn(~u,~m),~u) was wrong.

df(Jacobidn(x,y),x);


                                2
 - jacobicn(x,y)*jacobisn(x,y)*y


% 23 May 06. Derivatives and integrals of matrices were not computed.

m := mat((x,x^2),(x^3,x^4));


     [     2]
     [x   x ]
m := [      ]
     [ 3   4]
     [x   x ]



df(m,x);


[ 1    2*x ]
[          ]
[   2     3]
[3*x   4*x ]



int(m,x);


[  2     3 ]
[ x     x  ]
[----  ----]
[ 2     3  ]
[          ]
[  4     5 ]
[ x     x  ]
[----  ----]
[ 4     5  ]



% 18 Aug 06. After nospur, some traces were still evaluated.

load_package hephys;



nospur f;



x := a*g(f,k,k1)+g(f,k,k2);


x := g(f,k,k1)*a + g(f,k,k2)


procedure tst x; begin scalar y; spur f; y:=x; nospur f; return x end;


tst


tst x;


g(f,k,k1)*a + g(f,k,k2)


clear x;



% 29 Sep 06. With dfprint on, derivatives of integrals would print in a
%            truncated form.

depend f,x,y$



on dfprint;



df(int(f,y),x,y);


int(f,y)
        x,y


off dfprint;

 nodepend f,x,y;



% 11 Jan 07. With rounded arithmetic and factor on, a non-numeric
%            argument error could occur.

on factor,rounded;



0.72*(1.44*p1^2 + 0.096*p1 + 0.28*q0 + 0.0016)^0.5*p1 +
0.0032*(1.44*p1^2 + 0.096*p1 + 0.28*q0 + 0.0016)^0.5 +
1.84*p1^2 -0.0236*p1 + 0.09*q0 + 0.00004;


1.84*(p1 - 0.0128260869565)*p1 + 0.09*(q0 + 0.000444444444444) + 0.72

                                                                0.5
*(1.44*(p1 + 0.0666666666667)*p1 + 0.28*(q0 + 0.00571428571429))

*(p1 + 0.00444444444444)


off factor,rounded;



end;

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

Time for test: 15630 ms, plus GC time: 340 ms

5: 5: 
Quitting
Fri Jan 12 07:31:23 PST 2007


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