James Frye | 1 Apr 2003 01:07

Re: Is Maxima modular?...(and/or How learn source code?...)

On Sat, 29 Mar 2003, Richard Fateman wrote:

> There is a notion that underlies much of the CAS
> "rewriting" that has been done in building Maple,
> Mathematica, Mupad, Singular, Pari etc.  And that is that the
> old systems like Reduce, Scratchpad, Macsyma, are
> kludgey, non-modular, etc  because the people who
> built them were doing something wrong, and that
> new systems will not suffer from the same problems
> because people know better now.

Also remember that you're talking about code that was written around the
1970s, when processor speeds were under a MHz, and RAM came (if you were
lucky) in 64 Kb chunks.  I don't know the Maxima code, but having worked
on/with codes that started in the same era, I would suspect that a lot of
that "kludginess" is really very clever programming that was done because
it was the only way to get Maxima to run on the available hardware.

So maybe you don't need that sort of effort because you've got a 3 GHz
machine with a gig of RAM on your desktop, but that just means you aren't
considering big enough problems :-)

James
Stavros Macrakis | 1 Apr 2003 01:51
Picon

RE: Is Maxima modular?...(and/or How learn source code?...)

> Also remember that you're talking about code that was written
> around the 1970s, when processor speeds were under a MHz,

Yes, the code was mostly developed on the PDP-6 and the KA-10 model of
the PDP-10, which ran at about 0.3-0.5 mips.  Because of both speed and
space restrictions, compiled code (originally, interpreted code, too)
was run without error checking -- so that many basic Lisp operations --
NULL, CAR, CDR, EQ, RPLACA, RPLACD, function call -- took only one
machine instruction.

> RAM came... in 64 Kb chunks

I believe that most of the development work on Macsyma was done after
MIT-AI got its 256 kiloword (about 1 Mb) memory for the PDP-10 (in
1966?) -- a CONS cell took one 36-bit word.  MIT-AI was a time-shared
machine supporting dozens of users, and a single Macsyma process of say
100kW was considered a very heavy burden on other users.  Later, on the
MIT-ML machine, dedicated to running Macsyma, we eventually got 512 kW
physical memory, but addressing still constrained us to 256 kilowords
per process.  In particular, it was not possible to load the entire
Macsyma system into a single process and have enough working space left
to get much useful done.  Still, we could have 3-6 simultaneous active
users of Macsyma.

So, yes, both code and data space were used very parsimoniously.  As you
say, there is a fair amount of cleverness in the code for saving time
and space.  This often comes at a cost in readability and
maintainability.

      -s
(Continue reading)

James Frye | 1 Apr 2003 02:20

RE: Is Maxima modular?...(and/or How learn source code?...)

On Mon, 31 Mar 2003, Stavros Macrakis wrote:

> > Also remember that you're talking about code that was written
> > around the 1970s, when processor speeds were under a MHz,
> 
> Yes, the code was mostly developed on the PDP-6 and the KA-10 model of
> the PDP-10, which ran at about 0.3-0.5 mips.  Because of both speed and
> space restrictions, compiled code (originally, interpreted code, too)
> was run without error checking -- so that many basic Lisp operations --
> NULL, CAR, CDR, EQ, RPLACA, RPLACD, function call -- took only one
> machine instruction.

Just for comparison, I'm currently working with a Beowulf cluster: 128 2.4
GHz processors, 256 GBytes RAM - and I'm still having to do some of the
same sort of "kludges", 'cause the properly object-oriented & modular code
the last person designed was at least 2 orders of magnitude too slow to do
the job.

Never fails, they give you a faster machine, and they give you bigger
problems to go along with it :-)

James
Dan Stanger | 1 Apr 2003 06:20
Picon

picking out parts of a expresssion

I have a long expression involving several functions, including
fresnelF,
and fresnelG.  I would like to go thru this expression, and pull out the

arguments of these 2 functions.  Following is part of the expression.
fresnelg( - ((sqrt(2) * f)/(200 * sqrt(5))) - ((1595600001 *
sqrt(2))/(10000 * sqrt(5)))) *
sin(((2 * %pi * f)/25) + ((%pi)/625)) + 2*fresnelg(((sqrt(2) * f)/(200 *
sqrt(5))) - ((1595599999 * sqrt(2))/(10000 * sqrt(5))))
The reason I am doing this, is that I want to evaluate the limit of this
expression
at certain points, and I want to automate producing atvalue expressions.

Thanks,
Dan Stanger
J. Milgram | 1 Apr 2003 17:37
Picon

Re: Differences between Maxima and Macsyma and GPL vs. commercial version


[sorry if I'm out of sync on these comments; am catching up on email]

> > (2) If Macsyma/Maxima is/was the oldest and greatest,
> > then how come Mathematica gets all the press and attention?
> 
> 1. Very good marketing by Stephen Wolfram. (Boy genius revolutionizes
> mathematics, says physicists and NY Times reporter)
> 2. Slick design of front end.
> 3. Timing.

I'd add: (4) a very high quality user's manual. Something for us to take
notice of.

> > Depending on how you answer (1), I believe we have a serious
> > open source product here that should get more attention.
> > 
> > We don't want youngsters like me naively thinking Mathematica
> > is the one and only choice for symbolic stuff anymore.

I used Macsyma as an undergrad "because it was there".
As a grad, I used Mathematica "because it was there".

Probably nothing would serve Maxima advocacy as well as encouraging
general use on campus.

Judah
Stavros Macrakis | 1 Apr 2003 17:58
Picon

RE: picking out parts of a expresssion

> I would like to go thru this expression, and pull out the
> arguments of these 2 functions.

The easiest way I can think of is a simple recursive function:

funcargs(expr,funcs):=
  if atom(expr) or constantp(expr)
     then []
  else
  if member(part(expr,0),funcs)
     then [expr]
  else
     apply(append,
           makelist(funcargs(subexpr,funcs),subexpr,args(expr)));

(C13) funcargs(a^2+f(y/3)-g(f(x)),[f]);
                            y
(D13)                    [f(-), f(x)]
                            3
(C14) funcargs(a^2+f(y/3)-g(f(x)),[f,g]);
                          y
(D14)                  [f(-), g(f(x))]
                          3

If you want to include cases where one function is called within
another:

funcargs(expr,funcs):=
  if atom(expr) or numberp(expr)
    then []
(Continue reading)

Stavros Macrakis | 1 Apr 2003 19:44
Picon

RE: picking out parts of a expresssion

> pull out the arguments of these 2 functions

An even easier way is as follows as long as your expression won't do
funny things if evaluated:

accumulate(arg):=list:if not member(arg,list) then list:cons(arg,list);

(list:[],ev(subst(accumulate,fresnelg,expr),accumulate),list)
kovzol | 1 Apr 2003 20:13
Picon

is() problem

Dear All,

now I'm having a problem with IS(). I'd like to know whether
sin(x)/cos(x)=tan(x). I'm writing:

IS(EQUAL(sin(x)/cos(x),tan(x)));

Maxima reports an error:

MACSYMA was unable to evaluate the predicate:
ERREXP1
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)

Is this the normal behaviour?

TIA, Zoltan

Kova'cs Zolta'n
assistant teacher at Bolyai Institute
kovzol <at> math.u-szeged.hu
http://www.math.u-szeged.hu/~kovzol
Nikolaos I. Ioakimidis | 1 Apr 2003 20:52
Picon

Re: is() problem


Dear Zoltan,

I have also observed the same behaviour on Windows and I feel this 
is normal for Maxima in the way the computations are done although
I do not know any of the details of these computations. Exactly as you 
did, I also received from Maxima:

(C1) is(equal(sin(x)/cos(x), tan(x)));
MACSYMA was unable to evaluate the predicate:
ERREXP1
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)

In my impression, it seems that Maxima requires that both members
of equal be exactly the same in is and this is possible in the present
trigonometric functions with the devoted (not just the standard) 
simplification command, which is trigsimp.

(C2) is(equal(sin(x)/cos(x), trigsimp(tan(x))));
(D2)          TRUE

Personally, I prefer to use the = sign (a not exactly equivalent 
approach)

(C3) is(sin(x)/cos(x) = tan(x));
(D3)      FALSE
(C4) is(sin(x)/cos(x) = trigsimp(tan(x)));
(D4)       TRUE

in order to get just false (before the trigonometric simplification) or
(Continue reading)

Stavros Macrakis | 1 Apr 2003 21:13
Picon

RE: is() problem

> IS(EQUAL(sin(x)/cos(x),tan(x))) =>
> MACSYMA was unable to evaluate the predicate

> Is this the normal behaviour?

Yes, this is normal behavior.  There are two issues here: why it gives
an error (rather than Unknown) and why it isn't using stronger equality
testing.

It gives an error because "is" evaluation is intended for program
control structures.  It is the same kind of evaluation as in "if ...".
In program control, the answer must be either True or False; it is not
useful given the current semantics to return Unknown.  With prederror
set to False, it will return Unknown if it cannot determine the answer.

Is/equal does not apply "strong" equality testing methods.  There is no
general-purpose strong zero-testing method in Maxima, because different
approaches are appropriate in different cases, some of them can be very
time-consuming, and some of them are not infallible.

Is/equal *does* apply stronger equality testing than is/= does, though.
is/= is strictly syntactic, so that is(x^2-1=(x-1)*(x+1)) and even
is(1/2=0.5) are false, while the same comparisons with equal are true.
(On the other hand, is/= also reports true in the case
taylor(x,x,0,1)=x, which I think it should not.)

The approaches include:

Ratsimp -- Effective for rational functions.  Is/equal uses this as well
as some other techniques.
(Continue reading)


Gmane