Updated testsuite with an expected GCL error in to_poly_share
[maxima.git] / tests / rtest6b.mac
blob1bd2b77d08e71581ecd112ed746d839458b07195
1 /*************** -*- Mode: MACSYMA; Package: MAXIMA -*-  ******************/
2 /***************************************************************************
3 ***                                                                    *****
4 ***     Copyright (c) 1984 by William Schelter,University of Texas     *****
5 ***     All rights reserved                                            *****
6 ***************************************************************************/
9 kill(all);
10 done;
12 1/(x^2+2);
13 1/(x^2+2)$
14 substpart(3/2,%,2,1,2);
15 1/(x^(3/2)+2)$
16 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1;
17 27*y^3+54*x*y^2+36*x^2*y+y+8*x^3+x+1$
18 substpart(factor(piece),%,[1,2,3,5]);
19 (3*y+2*x)^3+y+x+1$
20 1/x+y/x-1/z;
21 -1/z+y/x+1/x$
22 substpart(xthru(piece),%,[2,3]);
23 (y+1)/x-1/z$
24 substpart("+",%,1,0);
25 -1/z+y+x+1$
26 ratsimp((k^2*x^2-1)*(cos(x)+eps)/(3*k+n[1])/(5*k-n[2]));
27 ((k^2*x^2-1)*cos(x)+eps*k^2*x^2-eps)/(15*k^2+(5*n[1]-3*n[2])*k-n[1]*n[2])$
28 factor(%);
29 (k*x-1)*(k*x+1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
30 substpart(ratsimp(piece),%,1,[1,2]);
31 (k^2*x^2-1)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2]))$
32 -substpart(-piece,%,1,1);
33 -((1-k^2*x^2)*(cos(x)+eps)/((3*k+n[1])*(5*k-n[2])))$
34 a+b/(x*(y+(a+b)*x)+1);
35 b/(x*(y+(b+a)*x)+1)+a$
36 substpart(multthru(piece),%,1,2,1);
37 b/(x*y+(b+a)*x^2+1)+a$
38 x . 'diff(f(x),x,2);
39 x . 'diff(f(x),x,2)$
40 substinpart(d^2,%,2);
41 x . d^2$
42 substinpart(f1,f[1](x+1),0);
43 f1(x+1)$
45 /* SF bug #2667: "tex1 of f(x)^n" */
47 simp:false $
48 false $
50 tex1 (sqrt(x)^n);
51 "\\sqrt{x}^{n}";
53 simp:true $
54 true $
56 tex1(sin(x)^2);
57 "\\sin ^2x";
59 tex1(f(x)^2);
60 "f\\left(x\\right)^2";
62 tex1(sin(x)^n);
63 "\\sin ^{n}x";
65 tex1(f(x)^n);
66 "f\\left(x\\right)^{n}";
68 tex1(sin(x)^-1);
69 "{{1}\\over{\\sin x}}";
71 tex1(f(x)^-1);
72 "{{1}\\over{f\\left(x\\right)}}";
74 tex1(sin(x)^-2);
75 "{{1}\\over{\\sin ^2x}}";
77 tex1(f(x)^-2);
78 "{{1}\\over{f\\left(x\\right)^2}}";
80 /* see: https://stackoverflow.com/questions/66056058/wxmaxima-texput-for-powers-of-expressions
81  */
83 logexpand: false; /* disable log simplifications */
84 false;
86 foo: map (tex1, [log(x), log(x+1), log(x)^n]);
87 ["\\log x","\\log \\left(x+1\\right)","\\left(\\log x\\right)^{n}"];
89 texput (log, "\\ln ");
90 "\\ln ";
92 bar: map (tex1, [log(x), log(x+1), log(x)^n]);
93 ["\\ln x","\\ln \\left(x+1\\right)","\\left(\\ln x\\right)^{n}"];
95 /* verify that log is just as it was before but with \ln instead of \log */
97 if bar = map (lambda ([s], ssubst ("ln", "log", s)), foo) then true else bar;
98 true;
100 /* there's no user-level interface for this, and :lisp isn't recognized in test scripts, so ... */
101 block([simp:false], ?\*tex\-mexpt\-trig\-like\-fns\*: ?cons(log, ?\*tex\-mexpt\-trig\-like\-fns\*), 0);
104 baz: map (tex1, [log(x), log(x+1), log(x)^n]);
105 ["\\ln x","\\ln \\left(x+1\\right)","\\ln ^{n}x"];
107 /* verify that now, log acts just like tan in tex output */
109 map (lambda ([s], ssubst ("ln", "tan", s)), map (tex1, [tan(x), tan(x+1), tan(x)^n]));
110 ''baz;
112 /* restore TeX properties */
114 (kill (log),
115  ?pop (?\*tex\-mexpt\-trig\-like\-fns\*),
116  0);
119 (reset (), 0);