File: rtest_polynomialp.mac

package info (click to toggle)
maxima 5.49.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 128,980 kB
  • sloc: lisp: 437,854; fortran: 14,665; tcl: 10,143; sh: 4,598; makefile: 2,204; ansic: 447; java: 374; python: 262; perl: 201; xml: 60; awk: 28; sed: 15; javascript: 2
file content (67 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download | duplicates (5)
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
polynomialp(1,[x])$
true$

polynomialp(%pi,[x])$
true$

polynomialp(sqrt(23),[x])$
true$

polynomialp(1+x,[x])$
true$

polynomialp(1 + x * (sqrt(5) + x),[x])$
true$

polynomialp(1 + x * (sqrt(5) + x),[y])$
false$

polynomialp(1 + x * (sqrt(5) + y),[x,y])$
true$

polynomialp(1 + sqrt(x),[x], 'numberp, 'numberp);
true$

polynomialp(1 + sqrt(1 + sqrt(x)),[x], 'numberp, 'numberp);
true$

polynomialp(1 + sqrt(x + sqrt(1 + x*y)),[x,y], 'numberp, 'numberp);
true$

polynomialp(cos(x),[x]);
false$

polynomialp(cos(x),[x], 'numberp, 'numberp);
false$

polynomialp([x],[x], 'numberp, 'numberp);
false$

polynomialp((1+x)^a,[x], 'constantp, lambda([e],freeof(x,e)));
true$

polynomialp((1+x)^a,[x], 'constantp);
false$

polynomialp(sin(p)*x^2+cos(p)*y^2-q,[x,y], lambda([ex],freeof(x,y,ex)));
true$

/* Bug #3543: bug with polynomialp */

block ([z : factor (x[1])],
  /* This should yield true even though the value of z has
   * some extra stuff in its header compared to a vanilla x[1]
   */
  polynomialp (x[1], [z]));
true;