



Programming and Miscellaneous
| System | License | Status | Web Location |
| GCL | GPL | Rosetta | http://www.gnu.org/software/gcl |
| GnuPlot | GPL | Rosetta | http://www.gnuplot.org |
| Haskell | GPL | Rosetta | http://www.haskell.org |
| Readline | GPL | Rosetta | http://prep.ai.mit.edu/pub/gnu/readline |
| TeXmacs | GPL | Rosetta | http://www.texmacs.org |
| Unix/Microsoft user initialization file | ||
| Axiom | ~/axiom.input | |
| CoCoA | ~/init.coc | |
| ~/userinit.coc | ||
| Derive | derive.ini | |
| DoCon | ~/.ghci | (interactive system init.) |
| GAP | ~/.gaprc | GAP.RC |
| Giac | ||
| GiNaC | ||
| Macsyma | ~/macsyma-init.macsyma | mac-init.mac |
| Magnus | ||
| Maple | ~/.mapleinit | maplev5.ini |
| Mathcad | ||
| Mathematica | ~/init.m | init.m |
| Maxima | ~/macsyma-init.macsyma | mac-init.mac |
| MuPAD | ~/.mupadinit | \mupad\bin\userinit.mu |
| Octave | ||
| Pari | ~/.gprc | |
| Reduce | ~/.reducerc | reduce.rc |
| Singular | ~/.singularrc | ~/.singularrc |
| Yacas | ~/.yacasrc | None |
| Describe keyword | Find keywords containing pattern | |
| Axiom | )what operations pattern | |
| CoCoA | H.Command(""); | Man("keyword"); |
| Derive | ||
| DoCon | ||
| GAP | ?keyword | ??keyword |
| Giac | ||
| GiNaC | ||
| Macsyma | describe("keyword")$ | apropos("pattern"); |
| Magnus | ||
| Maple | ?keyword | ?pattern 1 |
| Mathcad | [F1] | [Shift][F1] |
| Mathematica | ?keyword | ?*pattern* |
| Maxima | describe("keyword")$ | apropos("pattern"); |
| MuPAD | ?keyword | ?*pattern* |
| Octave | help -i keyword | |
| Pari | ||
| Reduce | ||
| Singular | ?keyword; | ?*pattern*; |
| Yacas | ?keyword | no pattern searching |
| Comment | Line continuation | |
| Axiom | -- comment | input _<CR>input |
| CoCoA | -- comment | input<CR>input; |
| Derive | "comment" | input ~<CR>input |
| DoCon | ||
| GAP | # comment | input\<CR>input |
| Macsyma | /* comment */ | input<CR>input; |
| Magnus | ||
| Maple | # comment | input<CR>input; |
| Mathcad | Text Region | |
| Mathematica | (* comment *) | input<CR>input |
| Maxima | /* comment */ | input<CR>input; |
| MuPAD | # comment # | input<CR>input; |
| Octave | ## | |
| Pari | ||
| Reduce | % comment | input<CR>input; |
| Singular | // comment | input<CR>input; |
| Yacas | /* comment */ or | input\<CR>input; |
| //comment <CR> | ||
| Previous | Case | Variables | |
| expression | sensitive | assumed | |
| Axiom | % | Yes | real |
| CoCoA | It | Yes | |
| Derive | No | real | |
| DoCon | |||
| GAP | last | Yes | no assumption |
| Macsyma | % | No | real |
| Magnus | |||
| Maple | % | Yes | complex |
| Mathcad | |||
| Mathematica | % | Yes | complex |
| Maxima | % | No | real |
| MuPAD | % | Yes | complex |
| Octave | Yes | ||
| Pari | |||
| Reduce | ws | No | complex |
| Singular | _ | Yes | none |
| Yacas | % | Yes | real |
| Load a file | Time a command | |
| Axiom | )read "file" )quiet | )set messages time on |
| CoCoA | << 'MySession' | Time T := F(); |
| Derive | [Transfer Load Derive] | |
| DoCon | ||
| GAP | Read("file"); | time; (also see Runtime();) |
| Macsyma | load("file")$ | showtime: all$ |
| Magnus | ||
| Maple | read("file"): | readlib(showtime): on; |
| Mathcad | File: Open Document | |
| Mathematica | << file | Timing[command] |
| Maxima | load("file")$ | showtime: all$ |
| MuPAD | read("file"): | time(command); |
| Octave | load file | tic(); cmd ; toc() |
| Pari | ||
| Reduce | in "file"$ | on time; |
| Singular | < "file"; | timer=1; |
| Yacas | Load("file"); | Time(command); |
| Quit | |
| Axiom | )quit |
| CoCoA | Quit; or Ciao; |
| Derive | [Quit] |
| DoCon | |
| GAP | quit; |
| Macsyma | quit(); |
| Magnus | |
| Maple | quit |
| Mathcad | File: Exit |
| Mathematica | Quit[] |
| Maxima | quit(); |
| MuPAD | quit |
| Octave | quit or exit |
| Pari | |
| Reduce | quit; |
| Singular | quit; |
| Yacas | quit or Exit(); |
| Display | Suppress | ||
| output | output | Substitution: f(x, y) f(z, w) |
|
| Axiom | input | input; | subst(f(x, y), [x = z, y = w]) |
| CoCoA | input; | Subst(F,[z,w]); | |
| Derive | input | var:= input | [Manage Substitute] |
| DoCon | |||
| GAP | input; | input;; | Value(f,[x,y],[z,w]);2 |
| Macsyma | input; | input$ | subst([x = z, y = w], f(x, y)); |
| Magnus | |||
| Maple | input; | input: | subs({x = z, y = w}, f(x, y)); |
| Mathcad | |||
| Mathematica | input | input; | f[x, y] /. {x -> z, y -> w} |
| Maxima | input; | input$ | subst([x = z, y = w], f(x, y)); |
| MuPAD | input; | input: | subs(f(x, y), [x = z, y = w]); |
| Octave | input | input; | |
| Pari | |||
| Reduce | input; | input$ | sub({x = z, y = w}, f(x, y)); |
| Singular | input; | default | substitute(f,x,z,y,w) |
| Yacas | input; | not supported | f(x,y) /: {x<-z,y<-w}; |
| Set | List | Matrix | |
| Axiom | set [1, 2] | [1, 2] | matrix([[1, 2],[3, 4]]) |
| CoCoA | Set([1,2]) | [1, 2] | Mat[[1,2],[3,4]]; |
| Derive | {1, 2} | [1, 2] | [[1,2], [3,4]] |
| DoCon | |||
| GAP | Set([1,2]) | [1, 2] | [[1,2], [3,4]]3 |
| Macsyma | [1, 2] | [1, 2] | matrix([1, 2], [3, 4]) |
| Magnus | |||
| Maple | {1, 2} | [1, 2] | matrix([[1, 2], [3, 4]]) |
| Mathcad | Math: Matrices | ||
| Mathematica | {1, 2} | {1, 2} | {{1, 2}, {3, 4}} |
| Maxima | [1, 2] | [1, 2] | matrix([1, 2], [3, 4]) |
| MuPAD | {1, 2} | [1, 2] | export(Dom): export(linalg): |
| matrix:= ExpressionField(normal)): | |||
| matrix([[1, 2], [3, 4]]) | |||
| Octave | |||
| Pari | |||
| Reduce | {1, 2} | {1, 2} | mat((1, 2), (3, 4)) |
| Singular | |||
| Yacas | {1,2} | {1,2} | {{1,2}, {3,4}} |
| Equation | List element | Matrix element | Length of a list | |
| Axiom | x = 0 | l . 2 | m(2, 3) | #l |
| CoCoA | L[2] | L[2,3] | Len(L) | |
| Derive | x = 0 | l SUB 2 | m SUB 2 SUB 3 | DIMENSION(l) |
| DoCon | ||||
| GAP | x = 0 | l[2] | m[2][3] | Length(l) |
| Macsyma | x = 0 | l[2] | m[2, 3] | length(l) |
| Magnus | ||||
| Maple | x = 0 | l[2] | m[2, 3] | nops(l) |
| Mathcad | l[2 | M[2,3 | ||
| Mathematica | x == 0 | l[[2]] | m[[2, 3]] | Length[l] |
| Maxima | x = 0 | l[2] | m[2, 3] | length(l) |
| MuPAD | x = 0 | l[2] | m[2, 3] | nops(l) |
| Octave | ||||
| Pari | ||||
| Reduce | x = 0 | part(l, 2) | m(2, 3) | length(l) |
| Singular | x == 0 | l[2] | m[2, 3] | size(l) |
| Yacas | x==0 | L[2] | M[2][3] | Length(L) |
| Prepend/append an element to a list | ||
| Axiom | cons(e, l) | concat(l, e) |
| CoCoA | Concat([E1],L1) | Append(L, E) |
| Derive | APPEND([e], l) | APPEND(l, [e]) |
| DoCon | ||
| GAP | Concatenation([e],l) | Add(l,e) |
| Macsyma | cons(e, l) | endcons(e, l) |
| Magnus | ||
| Maple | [e, op(l)] | [op(l), e] |
| Mathcad | ||
| Mathematica | Prepend[l, e] | Append[l, e] |
| Maxima | cons(e, l) | endcons(e, l) |
| MuPAD | [e, op(l)] | append(l, e) |
| Octave | ||
| Pari | ||
| Reduce | e . l | append(l, e) |
| Singular | insert(l,e,1) | insert(l, e, size(l)+1) |
| Yacas | e:L | Append(L,e) |
| Append two lists | |
| Axiom | append(l1, l2) |
| CoCoA | Concat(L1, L2) |
| Derive | APPEND(l1, l2) |
| DoCon | |
| GAP | Append(l1, l2) |
| Macsyma | append(l1, l2) |
| Magnus | |
| Maple | [op(l1), op(l2)] |
| Mathcad | |
| Mathematica | Join[l1, l2] |
| Maxima | append(l1, l2) |
| MuPAD | l1 . l2 |
| Octave | |
| Pari | |
| Reduce | append(l1, l2) |
| Singular | l1+l2 |
| Yacas | Concat({a,b},{c,d}) |
| Matrix column dimension | Convert a list into a column vector | |
| Axiom | ncols(m) | transpose(matrix([l])) |
| CoCoA | Len(ColumnVectors(M)) | Transposed(Mat(Vector([l]))) |
| Derive | DIMENSION(m SUB 1) | [l]` |
| DoCon | ||
| GAP | Length(mat[1]) | objects are identical |
| Macsyma | mat_ ncols(m) | transpose(matrix(l)) |
| Magnus | ||
| Maple | linalg[coldim](m) | linalg[transpose](matrix([l])) |
| Mathcad | ||
| Mathematica | Dimensions[m][[2]] | Transpose[{l}] |
| Maxima | mat_ ncols(m) | transpose(matrix(l)) |
| MuPAD | linalg::ncols(m) | transpose(matrix([l])) 4 |
| Octave | ||
| Pari | ||
| Reduce | load_ package(linalg)$ | matrix v(length(l), 1)$ |
| column_dim(m) | for i:=1:length(l) do | |
| v(i, 1):= part(l, i) | ||
| Singular | ncols(m) | vector v; |
| for(int i=1;i<=size(l);i++) | ||
| { v[i]=l[i]; } | ||
| Yacas | Transpose({L}) | |
| Convert a column vector into a list | |
| Axiom | [v(i, 1) for i in 1..nrows(v)] |
| CoCoA | V:=ColumnVectors(M); |
| List(V[1]); | |
| Derive | v` SUB 1 |
| DoCon | |
| GAP | objects are identical |
| Macsyma | part(transpose(v), 1) |
| Magnus | |
| Maple | op(convert(linalg[transpose](v), listlist)) |
| Mathcad | |
| Mathematica | Flatten[v] |
| Maxima | part(transpose(v), 1) |
| MuPAD | [op(v)] |
| Octave | |
| Pari | |
| Reduce | load_ package(linalg)$ |
| for i:=1:row_ dim(v) collect(v(i, 1)) | |
| Singular | list l; |
| for(int i; i<=size(v);i++) { l[i]=v[i]; } | |
| Yacas | Transpose(%)[1] |
| True | False | And | Or | Not | Equal | Not equal | |
| Axiom | true | false | and | or | not | = | ~= |
| CoCoA | TRUE | FALSE | AND | OR | NOT | = | <> |
| Derive | TRUE | FALSE | AND | OR | NOT | = | /= |
| DoCon | |||||||
| GAP | true | false5 | and | or | not | = | <> |
| Macsyma | true | false | and | or | not | = | # |
| Magnus | |||||||
| Maple | true | false | and | or | not | = | <> |
| Mathcad | |||||||
| Mathematica | True | False | && | || | ! | == | != |
| Maxima | true | false | and | or | not | = | # |
| MuPAD | true | false | and | or | not | = | <> |
| Octave | |||||||
| Pari | |||||||
| Reduce | t | nil | and | or | not | = | neq |
| Singular | 1 | 0 | and | or | not | == | <> |
| Yacas | True | False | And | Or | Not | = | != |
| If+then+else statements | |
| Axiom | if _ then _ else if _ then _ else _ |
| CoCoA | If _ Then _ Elsif _ Then _ Else _ End |
| Derive | IF(_, _, IF(_, _, _)) |
| DoCon | |
| GAP | if _ then _ elif _ then _ else _ fi |
| Macsyma | if _ then _ else if _ then _ else _ |
| Magnus | |
| Maple | if _ then _ elif _ then _ else _ fi |
| Mathcad | |
| Mathematica | If[_, _, If[_, _, _]] |
| Maxima | if _ then _ else if _ then _ else _ |
| MuPAD | if _ then _ elif _ then _ else _ |
| end_if | |
| Octave | |
| Pari | |
| Reduce | if _ then _ else if _ then _ else _ |
| Singular | if (_) { _ } else { _ } |
| Yacas | If(_,_,_) |
| Strings (concatenated) | |
| Axiom | concat(["x", "y"]) |
| CoCoA | Concat("x","y") |
| Derive | "xy" |
| DoCon | |
| GAP | Concatenation("x","y") |
| Macsyma | concat("x", "y") |
| Magnus | |
| Maple | "x" . "y" |
| Mathcad | |
| Mathematica | "x" <> "y" |
| Maxima | concat("x", "y") |
| MuPAD | "x" . "y" |
| Octave | |
| Pari | |
| Reduce | "xy" or mkid(x, y) |
| Singular | "x"+"y" |
| Yacas | ConcatStrings("x","y"); |
| Simple loop and Block | |
| Axiom | for i in 1..n repeat ( x; y ) |
| CoCoA | For I:=1 To N Do _ End; |
| Derive | VECTOR([x, y], i, 1, n) |
| DoCon | |
| GAP | for i in [1..n] do _ od; |
| Macsyma | for i:1 thru n do (x, y); |
| Magnus | |
| Maple | for i from 1 to n do x; y od; |
| Mathcad | |
| Mathematica | Do[x; y, {i, 1, n}] |
| Maxima | for i:1 thru n do (x, y); |
| MuPAD | for i from 1 to n do x; y |
| end_for; | |
| Octave | |
| Pari | |
| Reduce | for i:=1:n do <<x; y>>; |
| Singular | for(int i=n;i>0;i--) { x;y; } |
| Yacas | For(i:=1,i<n,i++)[x;y;]; |
| Generate the list [1, 2, . . . , n] | |
| Axiom | [f(i) for i in 1..n] |
| CoCoA | List(1..10) |
| Derive | VECTOR(f(i), i, 1, n) |
| DoCon | |
| GAP | [1..n] or [1,2..n] |
| Macsyma | makelist(f(i), i, 1, n); |
| Magnus | |
| Maple | [f(i) $ i = 1..n]; |
| Mathcad | |
| Mathematica | Table[f[i], {i, 1, n}] |
| Maxima | makelist(f(i), i, 1, n); |
| MuPAD | [f(i) $ i = 1..n]; |
| Octave | |
| Pari | |
| Reduce | for i:=1:n collect f(i); |
| Singular | list l; for(int i=n;i>0;i--) |
| Yacas | 1 .. n; |
| Complex loop iterating on a list | |
| Axiom | for x in [2, 3, 5] while x**2 < 10 repeat output(x) |
| CoCoA | For X In [2, 3, 5] Do While X^2 < 10 Do PrintLn(X) End; End; |
| Derive | |
| DoCon | |
| GAP | for x in [2, 3, 5] do while x^2<10 do Print(x);od;od; |
| Macsyma | for x in [2, 3, 5] while x^2 < 10 do print(x)$ |
| Magnus | |
| Maple | for x in [2, 3, 5] while x^2 < 10 do print(x) od: |
| Mathcad | |
| Mathematica | For[l = {2, 3, 5}, l != {} && l[[1]]^2 < 10, |
| l = Rest[l], Print[l[[1]]] ] | |
| Maxima | for x in [2, 3, 5] while x^2 < 10 do print(x)$ |
| MuPAD | for x in [2, 3, 5] do if x^2 < 10 then print(x) end_if |
| end_for: | |
| Octave | |
| Pari | |
| Reduce | for each x in {2, 3, 5} do if x^2 < 10 then write(x)$ |
| Singular | for(l=list(2,3,5);size(l>0;l=delete(l,1)) |
| { if(l[1]^2<10) { l[1];}} | |
| Yacas | ForEach(x,{2,3,5})If(x^2<10,Echo(x)); |
| Assignment | Function definition | |
| Axiom | y:= f(x) | f(x, y) == x*y |
| CoCoA | Y:= F(x); | F(X,Y):=X*Y; |
| Derive | y:= f(x) | f(x, y):= x*y |
| DoCon | ||
| GAP | y:= f(x); | f:=function(x, y) return x*y; end; |
| Macsyma | y: f(x); | f(x, y):= x*y; |
| Magnus | ||
| Maple | y:= f(x); | f:= proc(x, y) x*y end; |
| Mathcad | ||
| Mathematica | y = f[x] | f[x_, y_ ]:= x*y |
| Maxima | y: f(x); | f(x, y):= x*y; |
| MuPAD | y:= f(x); | f:= proc(x, y) |
| begin x*y end_ proc; | ||
| Octave | ||
| Pari | ||
| Reduce | y:= f(x); | procedure f(x, y); x*y; |
| Singular | y=f(x); | proc f(x,y) |
| Yacas | y:=f(x); | f(x,y):x*y; |
| Clear vars and funs | |
| Axiom | )clear properties y f |
| CoCoA | Delete Y; |
| Derive | y:= f:= |
| DoCon | |
| GAP | no symbolic variables |
| Macsyma | remvalue(y)$ |
| remfunction(f)$ | |
| Magnus | |
| remfunction(f)$ | |
| Maple | y:= 'y': f:= 'f': |
| Mathcad | |
| Mathematica | Clear[y, f] |
| Maxima | remvalue(y)$ |
| MuPAD | y:= NIL: f:= NIL: |
| Octave | |
| Pari | |
| Reduce | clear y, f; |
| Singular | kill y,f; |
| Yacas | Clear(var); Retract(f,nrargs); |
| Function definition with a local variable | |
| Axiom | f(x) == (local n; n:= 2; n*x) |
| CoCoA | Define F(X) N:=2; Return N*; End; |
| Derive | |
| DoCon | |
| GAP | f:=function(x) local n; n:=2;return n*x; end; |
| Macsyma | f(x):= block([n], n: 2, n*x); |
| Magnus | |
| Maple | f:= proc(x) local n; n:= 2; n*x end; |
| Mathcad | |
| Mathematica | f[x_ ]:= Module[{n}, n = 2; n*x] |
| Maxima | f(x):= block([n], n: 2, n*x); |
| MuPAD | f:= proc(x) local n; begin n:= 2; n*x end_ proc; |
| Octave | |
| Pari | |
| Reduce | procedure f(x); begin scalar n; n:= 2; return(n*x) end; |
| Singular | proc f(int x) { int n=2; return(n*x); } |
| Yacas | f(x):=[Local(n);n:=2;n*x;]; |
| Return unevaluated symbol | Define a function from an expression | |
| Axiom | e:= x*y; 'e | function(e, f, x, y) |
| CoCoA | ||
| Derive | e:= x*y 'e | f(x, y):== e |
| DoCon | ||
| GAP | No unevaluated symbols6 | |
| Macsyma | e: x*y$ 'e; | define(f(x, y), e); |
| Magnus | ||
| Maple | e:= x*y: 'e'; | f:= unapply(e, x, y); |
| Mathcad | ||
| Mathematica | e = x*y; HoldForm[e] | f[x_, y_ ] = e |
| Maxima | e: x*y$ 'e; | define(f(x, y), e); |
| MuPAD | e:= x*y: hold(e); | f:= hold(func)(e, x, y); |
| Octave | ||
| Pari | ||
| Reduce | e:= x*y$ | for all x, y let f(x, y):= e; |
| Singular | string e="x*y"; | proc f(x,y) |
| { execute("return("+e+");");} | ||
| Yacas | [e:=x*y;Hold(e);]; | f(x):=Eval(e); |
| Fun. of an indefinite number of args | Apply "+" to sum a list | |
| Axiom | reduce(+, [1, 2]) | |
| CoCoA | Sum([1,2]); | |
| Derive | LST l:= l | |
| DoCon | ||
| GAP | lst:=function(args) _ end; | Sum([1,2]) |
| Macsyma | lst([l]):= l; | apply("+", [1, 2]) |
| Magnus | ||
| Maple | lst:=proc() [args[1..nargs]] end; | convert([1, 2], `+`) |
| Mathcad | ||
| Mathematica | lst[l_ _ _ ]:= {l} | Apply[Plus, {1, 2}] |
| Maxima | lst([l]):= l; | apply("+", [1, 2]) |
| MuPAD | lst:= proc(l) begin [args()] | _ plus(op([1, 2])) |
| end_ proc; | ||
| Octave | ||
| Pari | ||
| Reduce | xapply(+, {1, 2}) 7 | |
| Singular | proc f(list #) { _ } | |
| Yacas | f(L,...):=L; | UnFlatten({1,2},"+",0); |
| Apply a fun. to a | ||
| list of its args | Map an anonymous function onto a list | |
| Axiom | reduce(f, l) | map(x +-> x + y, [1, 2]) |
| CoCoA | Call(Function("F"),l) | L:=[]; |
| Foreach I In [1,2] Do | ||
| Append(L,Call(Function("F"),I); End; | ||
| Derive | x:= [1, 2] | |
| VECTOR(x SUB i + y, i, 1, DIMENSION(x)) | ||
| DoCon | ||
| GAP | List(l,f) | List([1,2],x->x+y) |
| Macsyma | apply(f, l) | map(lambda([x], x + y), [1, 2]) |
| Magnus | ||
| Maple | f(op(l)) | map(x -> x + y, [1, 2]) |
| Mathcad | ||
| Mathematica | Apply[f, l] | Map[# + y &, {1, 2}] |
| Maxima | apply(f, l) | map(lambda([x], x + y), [1, 2]) |
| MuPAD | f(op(l)) | map([1, 2], func(x + y, x)) |
| Octave | ||
| Pari | ||
| Reduce | xapply(f, l) | for each x in {1, 2} collect x + y |
| Singular | ||
| Yacas | MapSingle("-",{1,2}); | Apply({{x},x+y},{{1,2}}); |
Pattern matching: f(3y) + f(zy) 3f(y) + f(zy) |
|
| Axiom | f:= operator('f); |
| ( rule f((n | integer?(n)) * x) == n*f(x) )( _ | |
| f(3*y) + f(z*y)) | |
| CoCoA | |
| Derive | |
| DoCon | |
| GAP | |
| Macsyma | matchdeclare(n, integerp, x, true)$ |
| defrule(fnx, f(n*x), n*f(x))$ | |
| apply1(f(3*y) + f(z*y), fnx); | |
| Magnus | |
| Maple | map(proc(q) local m; |
| if match(q = f(n*y), y, 'm') and | |
| type(rhs(op(m)), integer) then | |
| subs(m, n * f(y)) else q fi | |
| end, | |
| f(3*y) + f(z*y)); | |
| Mathcad | |
| Mathematica | f[3*y] + f[z*y] /. f[n_Integer * x_ ] -> n*f[x] |
| Maxima | matchdeclare(n, integerp, x, true)$ |
| defrule(fnx, f(n*x), n*f(x))$ | |
| apply1(f(3*y) + f(z*y), fnx); | |
| MuPAD | d:= domain("match"): d::FREEVARIABLE:= TRUE: |
| n:= new(d, "n", func(testtype(m, DOM_INT), m)): | |
| x:= new(d, "x", TRUE): | |
| map(f(3*y) + f(z*y), | |
| proc(q) local m; begin m:= match(q, f(n*x)); | |
| if m = FAIL then q | |
| else subs(hold("n" * f("x")), m) end_if | |
| end_ proc); | |
| Octave | |
| Pari | |
| Reduce | operator f; |
| f(3*y) + f(z*y) | |
| where {f(~n * ~x) => n*f(x) when fixp(n)}; | |
| Singular | |
| Yacas | f(3*y)+f(z*y) /: {f(n_IsInteger*_x) <- n*f(x)}; |
| Define a new infix operator and then use it | |
| Axiom | |
| CoCoA | |
| Derive | |
| DoCon | |
| GAP | One can overload existing infix operators for ones own purposes |
| Macsyma | infix("~")$ "~"(x, y):= sqrt(x^2 + y^2)$ 3 ~ 4; |
| Magnus | |
| Maple | `&~`:= (x, y) -> sqrt(x^2 + y^2): 3 &~ 4; |
| Mathcad | |
| Mathematica | x_ \[Tilde] y_:= Sqrt[x^2 + y^2]; 3 \[Tilde] 4 |
| Maxima | infix("~")$ "~"(x, y):= sqrt(x^2 + y^2)$ 3 ~ 4; |
| MuPAD | tilde:= proc(x, y) begin sqrt(x^2 + y^2) end_ proc: |
| 3 &tilde 4; | |
| Octave | |
| Pari | |
| Reduce | infix |$ procedure |(x, y); sqrt(x^2 + y^2)$ 3 | 4; |
| Singular | |
| Yacas | Infix("~",10); x ~ y := Sqrt(x^2+y^2); |
| Main expression | |||
| operator | 1st operand | List of expression operands | |
| Axiom8 | kernels(e) . 1 | kernels(e) | |
| CoCoA | |||
| Derive | various9 | ||
| DoCon | |||
| GAP | There are no formal unevaluated expressions | ||
| Macsyma | part(e, 0) | part(e, 1) | args(e) |
| Magnus | |||
| Maple | op(0, e) | op(1, e) | [op(e)] |
| Mathcad | |||
| Mathematica | Head[e] | e[[1]] | ReplacePart[e, List, 0] |
| Maxima | part(e, 0) | part(e, 1) | args(e) |
| MuPAD | op(e, 0) | op(e, 1) | [op(e)] |
| Octave | |||
| Pari | |||
| Reduce | part(e, 0) | part(e, 1) | for i:=1:arglength(e) |
| collect part(e, i) | |||
| Singular | |||
| Yacas | Type(e); | ||
TERMS, FACTORS, NUMERATOR, LHS, etc.
| Print text and results | |
| Axiom | output(concat(["sin(", string(0), ") = ", |
| string(sin(0))])); | |
| CoCoA | PrintLn "Does Sin exist?"; |
| Derive | "sin(0)" = sin(0) |
| DoCon | |
| GAP | Print("There is no sin, but factors(10)= ",Factors(10), "\n") |
| Macsyma | print("sin(", 0, ") =", sin(0))$ |
| Magnus | |
| Maple | printf("sin(%a) = %a\n", 0, sin(0)): |
| Mathcad | |
| Mathematica | Print[StringForm["sin(``) = ``", 0, Sin[0]]]; |
| Maxima | print("sin(", 0, ") =", sin(0))$ |
| MuPAD | print(Unquoted, "sin(".0.")" = sin(0)): |
| Octave | |
| Pari | |
| Reduce | write("sin(", 0, ") = ", sin(0))$ |
| Singular | "sin(",0,") =", sin(0); |
| Yacas | Echo("sin(0) = ",Sin(0)); |
| Generate FORTRAN | Generate TeX/LaTeX | |
| Axiom | outputAsFortran(e) | outputAsTex(e) |
| CoCoA | Latex(e); | |
| Derive | [Transfer Save Fortran] | |
| DoCon | ||
| GAP | Print(LaTeX(e)); | |
| Macsyma | fortran(e)$ or gentran(eval(e))$ | tex(e); |
| Magnus | ||
| Maple | fortran([e]); | latex(e); |
| Mathcad | ||
| Mathematica | FortranForm[e] | TexForm[e] |
| Maxima | fortran(e)$ or gentran(eval(e))$ | tex(e); |
| MuPAD | generate::fortran(e); | generate::TeX(e); |
| Octave | ||
| Pari | ||
| Reduce | on fort; e; off fort; or | load_ package(tri)$ |
| load_ package(gentran)$ gentran e; | on TeX; e; off TeX; | |
| Singular | LIB "latex.lib"; | |
| texobj(e); | ||
| Yacas | TeXForm(e); | |
Import two space separated columns of integers from file |
|
| Axiom | |
| CoCoA | |
| Derive | [Transfer Load daTa] (from file.dat) |
| DoCon | |
| GAP | |
| Macsyma | xy: read_num_data_to_matrix("file", nrows, 2)$ |
| Magnus | |
| Maple | xy:= readdata("file", integer, 2): |
| Mathcad | |
| Mathematica | xy = ReadList["file", Number, RecordLists -> True] |
| Maxima | xy: read_num_data_to_matrix("file", nrows, 2)$ |
| MuPAD | |
| Octave | |
| Pari | |
| Reduce | |
| Singular | |
| Yacas | |
Export two space separated columns of integers to file10 |
|
| Axiom | )set output algebra "file" (creates file.spout) |
| for i in 1..n repeat output( _ | |
| concat([string(xy(i, 1)), " ", string(xy(i, 2))]) ) | |
| )set output algebra console | |
| Derive | xy [Transfer Print Expressions File] (creates file.prt) |
| CoCoA | |
| DoCon | |
| GAP | PrintTo("file");for i in [1..n] do |
| AppendTo("file",xy[i][1]," ",xy[i][2],"\n");od; | |
| Macsyma | writefile("file")$ for i:1 thru n do |
| print(xy[i, 1], xy[i, 2])$ closefile()$ | |
| Magnus | |
| Maple | writedata("file", xy); |
| Mathcad | |
| Mathematica | outfile = OpenWrite["file"]; |
| Do[WriteString[outfile, | |
| xy[[i, 1]], " ", xy[[i, 2]], "\n"], {i, 1, n}] | |
| Close[outfile]; | |
| Maxima | writefile("file")$ for i:1 thru n do |
| print(xy[i, 1], xy[i, 2])$ closefile()$ | |
| MuPAD | fprint(Unquoted, Text, "file", |
| ("\n", xy[i, 1], xy[i, 2]) $ i = 1..n): | |
| Octave | |
| Pari | |
| Reduce | out "file"; for i:=1:n do |
| write(xy(i, 1), " ", xy(i, 2)); shut "file"; | |
| Singular | link l=":w file";(open(l); |
| for(int i=1;i<=n;i++) { write(l,xy[i,1]," ",xy[i,2]); } | |
| close(l); | |
| Yacas | ToFile("file")For(i:=1,i<=Length(xy),i++)Echo(xy[i][1],"",xy[i][2]); |