File: rtestmcond_display.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 (212 lines) | stat: -rw-r--r-- 8,265 bytes parent folder | download | duplicates (18)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
kill (all);
done;

string ('(if a > b then c else d));
"if a > b then c else d";

string ('if a > b then c else d);
"if a > b then c else d";

string ('(if a > b then c));
"if a > b then c";

string ('if a > b then c);
"if a > b then c";

string ('(if a then if b then if c then d else if e then f else g else if h then i else j else k));
"if a then (if b then (if c then d else (if e then f else g)) else (if h then i else j)) else k";

string ('if a then 'if b then 'if c then d else 'if e then f else g else 'if h then i else j else k);
"if a then (if b then (if c then d else (if e then f else g)) else (if h then i else j)) else k";

string ('(if a then b));
"if a then b";

string ('(if a then b else d));
"if a then b else d";

string ('(if a then b elseif c then false));
"if a then b elseif c then false";

string ('(if a then b elseif c then d));
"if a then b elseif c then d";

string ('(if a then b elseif c then d else f));
"if a then b elseif c then d else f";

string ('(if a then b elseif c then d elseif e then false));
"if a then b elseif c then d elseif e then false";

string ('(if a then b elseif c then d elseif e then f));
"if a then b elseif c then d elseif e then f";

string ('(if a then b elseif c then d elseif e then f else h));
"if a then b elseif c then d elseif e then f else h";

string ('(if a then b elseif c then d elseif e then f elseif g then false));
"if a then b elseif c then d elseif e then f elseif g then false";

string ('(if a then b elseif c then d elseif e then f elseif g then h));
"if a then b elseif c then d elseif e then f elseif g then h";

string ('if a then b);
"if a then b";

string ('if a then b else d);
"if a then b else d";

string ('if a then b elseif c then false);
"if a then b elseif c then false";

string ('if a then b elseif c then d);
"if a then b elseif c then d";

string ('if a then b elseif c then d else f);
"if a then b elseif c then d else f";

string ('if a then b elseif c then d elseif e then false);
"if a then b elseif c then d elseif e then false";

string ('if a then b elseif c then d elseif e then f);
"if a then b elseif c then d elseif e then f";

string ('if a then b elseif c then d elseif e then f else h);
"if a then b elseif c then d elseif e then f else h";

string ('if a then b elseif c then d elseif e then f elseif g then false);
"if a then b elseif c then d elseif e then f elseif g then false";

string ('if a then b elseif c then d elseif e then f elseif g then h);
"if a then b elseif c then d elseif e then f elseif g then h";

(a: z^3,
b: q/p,
c: x < 1024,
d: 1729.0,
e: 'if a > b then c else d,
f: 'if c < d then a elseif c < b then e else g,
g: abs(r),
h: %pi*e,
0);
0;

string ('if a then b);
"if z^3 then q/p";

string ('if a then b else d);
"if z^3 then q/p else 1729.0";

string ('if a then b elseif c then false);
"if z^3 then q/p elseif x < 1024 then false";

string ('if a then b elseif c then d);
"if z^3 then q/p elseif x < 1024 then 1729.0";

string ('if a then b elseif c then d else f);
"if z^3 then q/p elseif x < 1024 then 1729.0 else (if x < 1024 < 1729.0 then z^3 elseif x < 1024 < q/p then (if z^3 > q/p then x < 1024 else 1729.0) else g)";

string ('if a then b elseif c then d elseif e then false);
"if z^3 then q/p elseif x < 1024 then 1729.0 elseif (if z^3 > q/p then x < 1024 else 1729.0) then false";

string ('if a then b elseif c then d elseif e then f);
"if z^3 then q/p elseif x < 1024 then 1729.0 elseif (if z^3 > q/p then x < 1024 else 1729.0) then (if x < 1024 < 1729.0 then z^3 elseif x < 1024 < q/p then (if z^3 > q/p then x < 1024 else 1729.0) else g)";

string ('if a then b elseif c then d elseif e then f else h);
"if z^3 then q/p elseif x < 1024 then 1729.0 elseif (if z^3 > q/p then x < 1024 else 1729.0) then (if x < 1024 < 1729.0 then z^3 elseif x < 1024 < q/p then (if z^3 > q/p then x < 1024 else 1729.0) else g) else %pi*(if z^3 > q/p then x < 1024 else 1729.0)";

string ('if a then b elseif c then d elseif e then f elseif g then false);
"if z^3 then q/p elseif x < 1024 then 1729.0 elseif (if z^3 > q/p then x < 1024 else 1729.0) then (if x < 1024 < 1729.0 then z^3 elseif x < 1024 < q/p then (if z^3 > q/p then x < 1024 else 1729.0) else g) elseif abs(r) then false";

string ('if a then b elseif c then d elseif e then f elseif g then h);
"if z^3 then q/p elseif x < 1024 then 1729.0 elseif (if z^3 > q/p then x < 1024 else 1729.0) then (if x < 1024 < 1729.0 then z^3 elseif x < 1024 < q/p then (if z^3 > q/p then x < 1024 else 1729.0) else g) elseif abs(r) then %pi*(if z^3 > q/p then x < 1024 else 1729.0)";

(postfix ("abc"), postfix ("xyz"), grind: true, linel: 65, 0);
0;

/* NOTE: the literal strings in the remainder of this file
 * contain embedded tabs and newlines.
 */
string (my_union(x,y):=if x = [] then y
          else (if member(t:first(x),y) then my_union(rest(x),y)
                    else cons(t,my_union(rest(x),y)))); 
"my_union(x,y):=if x = [] then y
          else (if member(t:first(x),y) then my_union(rest(x),y)
                    else cons(t,my_union(rest(x),y)))" ; 

string (g(l):=catch(map(lambda([x],if x < 0 then throw(x) else f(x)),l))); 
"g(l):=catch(map(lambda([x],if x < 0 then throw(x) else f(x)),l))" ; 

string (typeof(x):=block([q],if numberp(x) then return(algebraic),
       if not atom(x) then return(maplist(typeof,x)),
       q:get(x,type),
       if q = false then error("not numeric") else q)); 
"typeof(x):=block([q],if numberp(x) then return(algebraic),
       if not atom(x) then return(maplist(typeof,x)),
       q:get(x,type),
       if q = false then error(\"not numeric\") else q)" ; 

string (closeto(e,tol):=block([numer:true,abse],abse:abs(e),
        if abse < tol then true else abse)); 
"closeto(e,tol):=block([numer:true,abse],abse:abs(e),
        if abse < tol then true else abse)" ; 

string (fib[n]:=if n = 1 or n = 2 then 1 else fib[n-1]+fib[n-2]); 
"fib[n]:=if n = 1 or n = 2 then 1 else fib[n-2]+fib[n-1]" ; 

string (eta(mu,nu):=if mu = nu then mu
     else (if mu > nu then mu-nu else mu+nu)); 
"eta(mu,nu):=if mu = nu then mu
     else (if mu > nu then mu-nu else nu+mu)" ; 

string ('(if not 5 >= 2 and 6 <= 5 or 5 > 3 then a else b)); 
"if 5 < 2 and 6 <= 5 or 5 > 3 then a else b" ; 

string ('(for i thru 10 do
      (guess:subst(guess,x,0.5*(x+10/x)),
       if abs(guess^2-10) < 1/20000 then return(guess)))); 
"for i thru 10 do
    (guess:subst(guess,x,0.5*(x+10/x)),
     if abs(guess^2-10) < 1/20000 then return(guess))" ; 

string (newton(f,guess):=block([numer,y],local(f,df,x,guess),numer:true,
       define(df(x),diff(f(x),x)),
       do (y:df(guess),
           if y = 0 then error("derivative at",guess,"is zero"),
           guess:guess-f(guess)/y,
           if abs(f(guess)) < 1/200000 then return(guess)))); 
"newton(f,guess):=block([numer,y],local(f,df,x,guess),numer:true,
       define(df(x),diff(f(x),x)),
       do (y:df(guess),
           if y = 0 then error(\"derivative at\",guess,\"is zero\"),
           guess:guess-f(guess)/y,
           if abs(f(guess)) < 1/200000 then return(guess)))" ; 

string ('(extremal_subset(set(2*sqrt(7),1.4b0,a,b+a),
                  lambda([x],if atom(x) then 0 else 1),max))); 
"extremal_subset({2*sqrt(7),1.4b0,a,b+a},
                lambda([x],if atom(x) then 0 else 1),max)" ; 

string (rprimep(i,j):=block([],
        if integerp(i) and integerp(j)
            then (if gcd(i,j) > 1 then 0 else 1)
            else funmake(rprimep,[i,j]))); 
"rprimep(i,j):=block([],
        if integerp(i) and integerp(j)
            then (if gcd(i,j) > 1 then 0 else 1)
            else funmake(rprimep,[i,j]))" ; 

string ('(extremal_subset(set(2*sqrt(7),1.4b0,a,b+a),
                  lambda([x],
                         if foo(x)
                             then (if atom(x) then 0
                                       else 1)! abc! xyz!
                             else (if bar(x) then glob
                                       else blurf)),max))); 
"extremal_subset({2*sqrt(7),1.4b0,a,b+a},
                lambda([x],
                       if foo(x)
                           then (if atom(x) then 0
                                     else 1)! abc! xyz!
                           else (if bar(x) then glob
                                     else blurf)),max)" ;