[BACK]Return to taylor CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / sample

Diff for /OpenXM/src/asir-contrib/packages/sample/taylor between version 1.1 and 1.2

version 1.1, 2000/02/17 09:12:08 version 1.2, 2000/02/17 10:47:04
Line 3  def taylor(F,X,P,N){
Line 3  def taylor(F,X,P,N){
         A = F;          A = F;
   
         for(I=0;I<N;I++){          for(I=0;I<N;I++){
                 if(I!=0){  
                         A /= I;  
                 }  
                 R += subst(A,X,P) * x^I;                  R += subst(A,X,P) * x^I;
                 A = diff(A,X);                  A = diff(A,X)/(I+1);
         }          }
         return R;          return R;
 }  }
   
 taylor(1/(1-x),x,0,20);  def taylor_test(){
           print(taylor(exp(z),z,0,10));
           print(taylor(sin(z),z,0,10));
           print(taylor(cos(z),z,0,10));
           print(taylor(cos(z),z,1,10));
           print(taylor(1/(1-z),z,0,10));
           print(taylor((1-z)^(1/2),z,0,10));
           print(taylor((1-z)^(1/2),z,2,10));
   }
   
   /* taylor_test(); */
 quit;  quit;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>