Timing comparison for diffeq program in c++, Maple and Maxima



Dennis Darland <dennis.darland at yahoo.com> writes:
> I am using just basic math like you say. In maple I can use higher
> precision floating point by setting "Digits". (Though it only seems to
> work up to about 32 digits). I expected to be able to do something
> similar in Maxima. Maxima does have "big floats". I tried them, but,
> as far as I could tell, they did not support trig functions, etc. (You
> only get about 16 digits and a lot of warning messages). 

Maybe you can give an example of how you ended up with warning messages?
If you want more than 16 digits of precision, look at the fpprec
variable.

> If big floats can me made to support trig functions, etc., I would
> like to know about it. I plan to look also for a c++ library for
> extended precision floating point numbers. I am also interested in
> what is called "interval arithmetic."

As far as I know, Maxima doesn't have interval arithmetic built in. It
seems to have been a "nice to have" project for many years.

> I also used Maxima as well as Maple as it is more affordable, and I
> like to support open source. I am not trying to criticize Maple or
> Maxima, only to ascertain the facts. It is interesting that c++ is so
> much faster, in that it makes solving some problems more practical.

C++ is indeed much faster at basic arithmetic. But the languages of
Maxima and Maple aren't really designed for that. You'll probably find
Matlab and Octave to be slower than C/C++ but faster than Maple: if
you're trying to do numerics, they might actually be more suitable than
Maxima.

I'm not sure whether Maxima/Maple could be more help for what you're
doing, but currently you aren't using either in a way that they really
shine.

> The reason I started subscripts at 1 was Dr Chang's work started
> subscripts at 1, and thus it was a lot easier. I used the formulas
> from his draft of a book he started. He was working in FORTRAN, but my
> program is not at all a translation of his program. (He wrote as
> program in FORTRAN which generated a FORTRAN program,) His program is
> beyond my comprehension.  Also other languages I may want to use in
> the future may not permit "0" subscripts. I doubt I will ever support
> FORTRAN.

I presume this was in reply to my comment that your code looked like
FORTRAN. I wasn't being that specific to be honest: I just thought I
should include a language that wasn't from the C family.


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120809/e1d2d8b0/attachment.pgp>;