1 | test_simplify = ->
|
2 | run_test [
|
3 |
|
4 | "simplify(A)",
|
5 | "A",
|
6 |
|
7 | "simplify(A+B)",
|
8 | "A+B",
|
9 |
|
10 | "simplify(A B)",
|
11 | "A*B",
|
12 |
|
13 | "simplify(A^B)",
|
14 | "A^B",
|
15 |
|
16 | "simplify(A/(A+B)+B/(A+B))",
|
17 | "1",
|
18 |
|
19 | "simplify((A-B)/(B-A))",
|
20 | "-1",
|
21 |
|
22 | "A=[[A11,A12],[A21,A22]]",
|
23 | "",
|
24 |
|
25 | "simplify(det(A) inv(A) - adj(A))",
|
26 | "0",
|
27 |
|
28 | "A=quote(A)",
|
29 | "",
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | "simplify(-3 exp(-1/3 r + i phi) cos(theta) / sin(theta)\
|
40 | + 3 exp(-1/3 r + i phi) cos(theta) sin(theta)\
|
41 | + 3 exp(-1/3 r + i phi) cos(theta)^3 / sin(theta))",
|
42 | "0",
|
43 |
|
44 | "simplify((A^2 C^2 + A^2 D^2 + B^2 C^2 + B^2 D^2)/(A^2+B^2)/(C^2+D^2))",
|
45 | "1",
|
46 |
|
47 | "simplify(d(arctan(y/x),y))",
|
48 | "x/(x^2+y^2)",
|
49 |
|
50 | "simplify(d(arctan(y/x),x))",
|
51 | "-y/(x^2+y^2)",
|
52 |
|
53 | "simplify(1-sin(x)^2)",
|
54 | "cos(x)^2",
|
55 |
|
56 | "simplify(1-cos(x)^2)",
|
57 | "sin(x)^2",
|
58 |
|
59 | "simplify(sin(x)^2-1)",
|
60 | "-cos(x)^2",
|
61 |
|
62 | "simplify(cos(x)^2-1)",
|
63 | "-sin(x)^2",
|
64 |
|
65 |
|
66 |
|
67 | "simplify(-cos(2/5*pi)*(k/a)^(1/5)-i*(k/a)^(1/5)*sin(2/5*pi))",
|
68 | "((k/a)^(2/5))^(1/2)/((-1)^(3/5))",
|
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 | "simplify(n!/n)-(n-1)!",
|
107 | "0",
|
108 |
|
109 | "simplify(n/n!)-1/(n-1)!",
|
110 | "0",
|
111 |
|
112 | "simplify(rationalize((n+k+1)/(n+k+1)!))-1/(n+k)!",
|
113 | "0",
|
114 |
|
115 | "simplify(condense((n+1)*n!))-(n+1)!",
|
116 | "0",
|
117 |
|
118 | "simplify(1/((n+1)*n!))-1/(n+1)!",
|
119 | "0",
|
120 |
|
121 | "simplify((n+1)!/n!)-n-1",
|
122 | "0",
|
123 |
|
124 | "simplify(n!/(n+1)!)-1/(n+1)",
|
125 | "0",
|
126 |
|
127 | "simplify(binomial(n+1,k)/binomial(n,k))",
|
128 | "(1+n)/(1-k+n)",
|
129 |
|
130 | "simplify(binomial(n,k)/binomial(n+1,k))",
|
131 | "(1-k+n)/(1+n)",
|
132 |
|
133 | "F(nn,kk)=kk*binomial(nn,kk)",
|
134 | "",
|
135 |
|
136 | "simplify((F(n,k)+F(n,k-1))/F(n+1,k))-n/(n+1)",
|
137 | "0",
|
138 |
|
139 | "F=quote(F)",
|
140 | "",
|
141 |
|
142 | "simplify((n+1)/(n+1)!)-1/n!",
|
143 | "0",
|
144 |
|
145 | "simplify(a*b+a*c)",
|
146 | "a*(b+c)",
|
147 |
|
148 |
|
149 |
|
150 | "x=simplify(a*b+a*c)",
|
151 | "",
|
152 |
|
153 | "x",
|
154 | "a*b+a*c",
|
155 |
|
156 | "x=quote(x)",
|
157 | "",
|
158 |
|
159 | "simplify((6 - 4*2^(1/2))^(1/2))",
|
160 | "2-2^(1/2)",
|
161 |
|
162 | "4-4*(-1)^(1/3)+4*(-1)^(2/3)",
|
163 | "0",
|
164 |
|
165 | "simplify(4-4*(-1)^(1/3)+4*(-1)^(2/3))",
|
166 | "0",
|
167 |
|
168 |
|
169 |
|
170 | "simplify(14^(1/2) - (16 - 4*7^(1/2))^(1/2))",
|
171 | "2^(1/2)",
|
172 |
|
173 |
|
174 | "simplify(-(2^(1/2)*(-1+7^(1/2)))+2^(1/2)*7^(1/2))",
|
175 | "2^(1/2)",
|
176 |
|
177 |
|
178 | "simplify((9 + 6*2^(1/2))^(1/2))",
|
179 | "3^(1/2)*(1+2^(1/2))",
|
180 |
|
181 |
|
182 | "simplify((7 + 13^(1/2))^(1/2))",
|
183 | "(1+13^(1/2))/(2^(1/2))",
|
184 |
|
185 |
|
186 | "simplify((17 + 12*2^(1/2))^(1/2) + (17 - 12*2^(1/2))^(1/2))",
|
187 | "6",
|
188 |
|
189 | "simplify((2 + 3^(1/2))^(1/2))",
|
190 | "(1+3^(1/2))/(2^(1/2))",
|
191 |
|
192 | "simplify((1/2 + (39^(1/2)/16))^(1/2))",
|
193 | "(3^(1/2)+13^(1/2))/(4*2^(1/2))",
|
194 |
|
195 |
|
196 |
|
197 |
|
198 | "simplify((-108+108*(-1)^(1/2)*3^(1/2))^(1/3))",
|
199 | "6*(-1)^(2/9)",
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 | "simplify((-4+4*(-1)^(1/2)*3^(1/2))^(1/3))",
|
206 | "2*(-1)^(2/9)",
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 | "simplify((((-3)^(1/2) + 1)/2)^(1/2))",
|
214 |
|
215 | "1/2*(i+3^(1/2))",
|
216 |
|
217 | "simplify((1/2 + (-3)^(1/2)/2)^(1/2))",
|
218 |
|
219 | "1/2*(i+3^(1/2))",
|
220 |
|
221 |
|
222 |
|
223 | "simplify((2 +2^(1/2))^(1/2))",
|
224 | "(2+2^(1/2))^(1/2)",
|
225 |
|
226 | "simplify((1 +3^(1/2)/2)^(1/2) + (1 -3^(1/2)/2)^(1/2))",
|
227 | "3^(1/2)",
|
228 |
|
229 | "simplify((1 +3^(1/2)/2)^(1/2))",
|
230 | "1/2*(1+3^(1/2))",
|
231 |
|
232 |
|
233 |
|
234 | "simplify(((1 +39^(1/2)/8)/2)^(1/2))",
|
235 | "(3^(1/2)+13^(1/2))/(4*2^(1/2))",
|
236 |
|
237 | "simplify((5 +24^(1/2))^(1/2))",
|
238 | "2^(1/2)+3^(1/2)",
|
239 |
|
240 | "simplify((3 +4*i)^(1/2))",
|
241 | "2+i",
|
242 |
|
243 | "simplify((3 -4*i)^(1/2))",
|
244 | "2-i",
|
245 |
|
246 | "simplify((-2 +2*3^(1/2)*i)^(1/2))",
|
247 |
|
248 | "1+i*3^(1/2)",
|
249 |
|
250 | "simplify((9 - 4*5^(1/2))^(1/2))",
|
251 | "-2+5^(1/2)",
|
252 |
|
253 | "simplify((61 - 24*5^(1/2))^(1/2))",
|
254 | "-4+3*5^(1/2)",
|
255 |
|
256 | "simplify((-352+936*(-1)^(1/2))^(1/3))",
|
257 | "2*(4+3*i)",
|
258 |
|
259 |
|
260 | "simplify((3 - 2*2^(1/2))^(1/2))",
|
261 | "-1+2^(1/2)",
|
262 |
|
263 | "simplify((27/2+27/2*(-1)^(1/2)*3^(1/2))^(1/3))",
|
264 | "3*(-1)^(1/9)",
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 | "simplify((1/2+1/2*(-1)^(1/2)*3^(1/2))^(1/3))",
|
272 | "(-1)^(1/9)",
|
273 |
|
274 |
|
275 | "simplify((2 + 5^(1/2))^(1/3))",
|
276 | "1/2*(1+5^(1/2))",
|
277 |
|
278 | "simplify((-3 + 10*3^(1/2)*i/9)^(1/3))",
|
279 | "1+2/3*i*3^(1/2)",
|
280 |
|
281 | "simplify((1-3*x^2+3*x^4-x^6)^(1/2))",
|
282 | "(-x^6+3*x^4-3*x^2+1)^(1/2)",
|
283 |
|
284 | "simplify(subst((-1)^(1/2),i,(-3 + 10*3^(1/2)*i/9)^(1/3)))",
|
285 | "1+2/3*i*3^(1/2)",
|
286 |
|
287 | "simplify(rationalize(-3 + 10*3^(1/2)*i/9)^(1/3))",
|
288 | "1+2/3*i*3^(1/2)",
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 | "simplify((-1)^(1/6) - (-1)^(5/6))",
|
296 | "3^(1/2)",
|
297 |
|
298 | "simplify((7208+2736*5^(1/2))^(1/3))",
|
299 | "17+3*5^(1/2)",
|
300 |
|
301 | "simplify((901+342*5^(1/2))^(1/3))",
|
302 | "1/2*(17+3*5^(1/2))",
|
303 |
|
304 | "-i*(-2*(-1)^(1/6)/(3^(1/2))+2*(-1)^(5/6)/(3^(1/2)))^(1/4)*(2*(-1)^(1/6)/(3^(1/2))-2*(-1)^(5/6)/(3^(1/2)))^(1/4)/(2^(1/2))",
|
305 | "1/2^(1/2)-i/(2^(1/2))",
|
306 |
|
307 | "simplify(-i*(-2*(-1)^(1/6)/(3^(1/2))+2*(-1)^(5/6)/(3^(1/2)))^(1/4)*(2*(-1)^(1/6)/(3^(1/2))-2*(-1)^(5/6)/(3^(1/2)))^(1/4)/(2^(1/2)))",
|
308 |
|
309 | "(1-i)/(2^(1/2))",
|
310 |
|
311 |
|
312 |
|
313 | "(-1)^(-5/a)",
|
314 |
|
315 | "1/(-1)^(5/a)",
|
316 |
|
317 |
|
318 |
|
319 | "simplify((-1)^(-5))",
|
320 | "-1",
|
321 |
|
322 | "simplify((-1)^(5))",
|
323 | "-1",
|
324 |
|
325 | "simplify((1)^(-5))",
|
326 | "1",
|
327 |
|
328 | "simplify((1)^(5))",
|
329 | "1",
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 | "simplify((-1)^(-5/a))",
|
337 |
|
338 | "1/(-1)^(5/a)",
|
339 |
|
340 | "simplify((-1)^(5/a))",
|
341 | "(-1)^(5/a)",
|
342 |
|
343 | "simplify((1)^(-5/a))",
|
344 | "1",
|
345 |
|
346 | "simplify((1)^(5/a))",
|
347 | "1",
|
348 |
|
349 |
|
350 | "simplify((-1)^(-6))",
|
351 | "1",
|
352 |
|
353 | "simplify((-1)^(6))",
|
354 | "1",
|
355 |
|
356 | "simplify((1)^(-6))",
|
357 | "1",
|
358 |
|
359 | "simplify((1)^(6))",
|
360 | "1",
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 | "simplify(i*2^(1/4)*sin(1/8*pi)+2^(1/4)*cos(1/8*pi))",
|
367 | "(-1)^(1/8)*2^(1/4)",
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | "simplify((-1)^(-6/a))",
|
377 |
|
378 | "1/(-1)^(6/a)",
|
379 |
|
380 | "simplify((-1)^(6/a))",
|
381 | "(-1)^(6/a)",
|
382 |
|
383 | "simplify((1)^(-6/a))",
|
384 | "1",
|
385 |
|
386 | "simplify((1)^(6/a))",
|
387 | "1",
|
388 |
|
389 | "simplify(transpose(A)*transpose(x))",
|
390 | "transpose(A*x)",
|
391 |
|
392 | "simplify(inner(transpose(A),transpose(x)))",
|
393 | "transpose(inner(x,A))",
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 | "simplify(sqrt(-1/2 -1/2 * x))",
|
400 | "(-1/2*x-1/2)^(1/2)",
|
401 |
|
402 | "simplify(sqrt(x*y))",
|
403 | "(x*y)^(1/2)",
|
404 |
|
405 | "simplify(sqrt(1/x))",
|
406 | "(1/x)^(1/2)",
|
407 |
|
408 | "simplify(sqrt(x^y))",
|
409 | "(x^y)^(1/2)",
|
410 |
|
411 | "simplify(sqrt(x)^2)",
|
412 | "x",
|
413 |
|
414 | "simplify(sqrt(x^2))",
|
415 | "abs(x)",
|
416 |
|
417 |
|
418 | ]
|