Annotation of OpenXM/src/cfep/tests/2006-03-12-qt.rr, Revision 1.1
1.1 ! takayama 1: ctrl("print_quote",2);
! 2: A=quote((x-1)^2+(x-1)+3);
! 3: eval_quote(A);
! 4: print_input_form(A);
! 5:
! 6: ctrl("print_quote",2);
! 7: A=quote((x-y)*(x+y));
! 8: nqt_match(A,quote(P*Q));
! 9: [P,Q];
! 10:
! 11: nqt_match(A,quote(P*Q),1);
! 12: qt_normalize(A,1);
! 13: qt_normalize(A,2);
! 14:
! 15: nqt_match_rewrite(`x*y*z,[`X*Y,`X+Y],1);
! 16: A=`x*x;
! 17: nqt_match_rewrite(A,[`X*Y,`X+Y],2);
! 18: quotetolist(qt_normalize(`x*x,0));
! 19: quotetolist(qt_normalize(`x*x,1));
! 20: quotetolist(qt_normalize(`x*x,2));
! 21:
! 22: ctrl("print_quote",2);
! 23: A=quote((x-y)*(x+y));
! 24: B=qt_normalize(A,0);
! 25: quotetolist(B);
! 26: B=qt_normalize(A,1);
! 27: quotetolist(B);
! 28: qt_normalize(A,2);
! 29: quotetolist(B);
! 30:
! 31: qt_normalize(`x^2,2);
! 32:
! 33: qt_set_coef([a,b]);
! 34: B=qt_normalize(quote((a*x+1/a)^2),2);
! 35: qt_normalize(B+B,2);
! 36:
! 37: qt_normalize(quote(x+y),2);
! 38: qt_set_ord([y,x]);
! 39: qt_normalize(quote(x+y),2);
! 40:
! 41: qt_set_weight([[x,-1],[y,-1]]);
! 42: qt_normalize(quote( 1+(x+y)+(x+y)^2),1);
! 43: [nqt_comp(`x,`y), nqt_comp(`y,`x), nqt_comp(`x,`x)];
! 44:
! 45: [qt_is_var(quote(x)), qt_is_var(quote(3/2))];
! 46:
! 47: import("noro_rewrite.rr");
! 48: R=[[`X*Y,`nqt_comp(Y*X,X*Y)>0, `Y*X]];
! 49: qt_rewrite(`(x-y)^2,R,2);
! 50:
! 51: import("noro_rewrite.rr");
! 52: Rext0=[quote(X*Y),quote(qt_is_var(X) && qt_is_var(Y) && nqt_comp(Y,X)>0),
! 53: quote(-Y*X)];
! 54: Rext1=[quote(X^N),quote(eval_quote(N)>=2),quote(0)];
! 55: Rext2=[quote(X*X),quote(0)];
! 56: Rext=[Rext0,Rext1,Rext2];
! 57: qt_rewrite(quote( (x+2*y)*(x+4*y) ), Rext,1);
! 58:
! 59: qt_set_coef([a,b,c,d]);
! 60: qt_rewrite(quote((a*x+b*y)*(c*x+d*y)), Rext,1);
! 61:
! 62: /* 微分 */
! 63: import("noro_rewrite.rr");
! 64: qt_set_coef([a,b]);
! 65: Rd1=[`d(X+Y), `d(X)+d(Y)];
! 66: Rd2=[`d(X*Y),`d(X)*Y+X*d(Y)];
! 67: Rd3=[`d(N), `qt_is_coef(N), `0];
! 68: Rd4=[`d(x),`1];
! 69: Rd=[Rd1,Rd2,Rd3,Rd4];
! 70: B=qt_rewrite( `d( (a*x+b)^3),Rd,2);
! 71:
! 72: fctr(eval_quote(B));
! 73:
! 74: ctrl("print_quote",2);
! 75: A=quote((x-1)^2+(x-1)+3);
! 76: eval_quote(A);
! 77: print_input_form(A);
! 78:
! 79: qt_normalize(`(x+y)^2);
! 80:
! 81:
! 82:
! 83:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>