/usr/share/maxima/5.38.1/tests/rtest6.mac is in maxima-test 5.38.1-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /*************** -*- Mode: MACSYMA; Package: MAXIMA -*- ******************/
/***************************************************************************
*** *****
*** Copyright (c) 1984 by William Schelter,University of Texas *****
*** All rights reserved *****
***************************************************************************/
integrate(x^(5/4)/(x+1)^(5/2),x,0,inf);
beta(9/4,1/4);
gradef(q(x),sin(x^2));
q(x);
diff(log(q(r(x))),x);
'diff(r(x),x,1)*sin(r(x)^2)/q(r(x));
integrate(%,x);
log(q(r(x)));
?nformat(?complex(1,2));
2*%i + 1;
?nformat(?/(1,2)); /* ?/(1,2) equivalent to (/ 1 2) in Lisp */
1/2$
?typep(interval(1,2),?ri);
true$
is(part(?complex(1,2),0)="+");
true$
/* bug reported to mailing list 2013-05-22 */
block ([a, L],
a : make_array (fixnum, 3),
L : buildq ([a], lambda ([x], a[x])),
print (L, L(0))); /* print(L) --> calls NFORMAT and therefore tickles bug */
0;
/* expressions like f(x)(y) */
(kill (f, x, y), f(x)(y));
f(x)(y);
(f(x)(y), [op (%%), args (%%)]);
[f(x), [y]];
(f(x)(y), [op (op (%%)), args (op (%%))]);
[f, [x]];
apply (f(x), [y]);
f(x)(y);
(kill (z), f(x)(y)(z));
f(x)(y)(z);
(f(x)(y)(z), [op (%%), args (%%), op (op (%%)), args (op (%%)), op (op (op (%%))), args (op (op (%%)))]);
[f(x)(y), [z], f(x), [y], f, [x]];
ev (f(x)(y), f(u) := buildq ([u], lambda ([v], v*u)));
x*y;
apply (f(x)(y), [z]);
f(x)(y)(z);
map (f(x), [1, 2, 3]);
[f(x)(1), f(x)(2), f(x)(3)];
(f(u) := subst (u, 'u, lambda ([v], v^u)),
[f(x), f(x)(y)]);
[lambda ([v], v^x), y^x];
(kill (f),
matchdeclare (xx, integerp),
tellsimp (f(xx), subst ('xx = xx, lambda ([a], a - xx))),
[f(1), f(1)(y)]);
[lambda ([a], a - 1), y - 1];
(remrule (f, all), 0);
0;
(matchdeclare ([xx, yy], integerp),
tellsimp (f(xx)(yy), yy*xx),
[f(2), f(2)(3)]);
[f(2), 6];
kill (rules);
done;
/* verify that subscripted functions are formatted without superfluous parentheses
* see SF bug #2998: "extra () in display2d:false output"
*/
(kill (foo, x, y),
string (foo[x](y)));
"foo[x](y)";
[string (li[2](x)), string (psi[3](y))];
["li[2](x)", "psi[3](y)"];
/* further tests for #2998 combining subscripted functions with various user-defined operators */
block ([opsies : ["infixie", "prefixie", "postfixie", "naryie", "matchfixie", "nofixie"]],
apply (kill, opsies),
map (lambda ([f, a], apply (f, [a])), [infix, prefix, postfix, nary, lambda ([a], matchfix (a, a)), nofix], opsies),
kill (foo, bar, baz, a, b, c, x, y, z),
0);
0;
foo[x, y](a) infixie bar[z](b, c);
(foo[x, y](a)) infixie (bar[z](b, c));
string ((foo[x, y](a)) infixie (bar[z](b, c)));
"foo[x,y](a) infixie bar[z](b,c)";
bar[a, a](x, x) naryie baz[a](x, y) naryie prefixie foo[a, b](x, y);
(bar[a, a](x, x)) naryie (baz[a](x, y)) naryie (prefixie (foo[a, b](x, y)));
string ((bar[a, a](x, x)) naryie (baz[a](x, y)) naryie (prefixie (foo[a, b](x, y))));
"bar[a,a](x,x) naryie baz[a](x,y) naryie prefixie foo[a,b](x,y)";
matchfixie foo[1](z) matchfixie;
matchfixie (foo[1](z)) matchfixie;
string (matchfixie (foo[1](z)) matchfixie);
"matchfixiefoo[1](z)matchfixie";
/* ... and with built-in operators */
foo[x, y](a)^bar[z](b, c);
(foo[x, y](a))^(bar[z](b, c));
string ((foo[x, y](a))^(bar[z](b, c)));
"foo[x,y](a)^bar[z](b,c)";
bar[a, a](x, x) and baz[a](x, y) and not foo[a, b](x, y);
(bar[a, a](x, x)) and (baz[a](x, y)) and (not (foo[a, b](x, y)));
string ((bar[a, a](x, x)) and (baz[a](x, y)) and (not (foo[a, b](x, y))));
"bar[a,a](x,x) and baz[a](x,y) and not foo[a,b](x,y)";
[ foo[1](z) ];
[ (foo[1](z)) ];
string ([ (foo[1](z)) ]);
"[foo[1](z)]";
/* mailing list 2015-10-05: "Wrong result from integrate?" */
(kill(t, R), integrate(sqrt(sin(t)^2*R^2+(1-cos(t))^2*R^2),t,0,2*%pi));
8*R;
|