Hacker News new | ask | show | jobs
by kbk 1228 days ago
I like maxima and used to use it (through the interface wxmaxima or KDE Cantor) for solving my physics problem. I am no expert in CAS, just use them for simple problem solving.

However, since I stumbled upon this blog post by Thingwy https://thingwy.blogspot.com/2015/07/maxima-versus-mathemati..., I find myself uneasy when using maxima. I quote Thingwy:

    “Maxima gets elementary math wrong, it knows very little about integration, it is weak on simplifying expressions, it fails on trivial equations, it is slow, Maxima usage is discouraged by CAS power users. In summary: do not go and waist your time or wreck your nerves using Maxima. JUST DON'T DO IT”
Since this was in 2015, I want to know the situation now, and the comments of experts on the issues raised by the blog poste.

(Excuse my bad English)

3 comments

I’m a bit suspicious of the section saying “Maxima is slow” blaming linked lists. Maxima is built on Common Lisp which definitely has arrays and vectors, so the claims made there seem a bit uninformed. I don’t really know enough math to judge the rest, though.
I'm extremely suspicious of that explanation. It would be nice to see a few benchmarks.

Anectote time: I used Mathematica many years ago. One surprising thing was that when you update the content of a vector, Mathematica creates a new vector and copies the content of the old vector. If you just copy an algorithm from C to Mathematica, it may be N times slower because it's creating a lot of intermediate vectors. So you must rewrite your code using "fold", or something like that. It was a long time ago, so I'm not sure if they have already added some trick to optimize code from people like me that don't know what they are doing. If Mathematica or Maxima has this trick but the other doesn't, it may cause a huge difference of time between algorithm that look very similar. Anyway, this is totally unrelated to lists.

Checked the examples and Maxima still fails. It's even more disheartening that author mentions towards the end that had reported those issues years before they wrote the article. I had also used Maxima before and, though unsurprisingly found it less polished than Mathematica, got the job done without issues. But will probably refrain from recommending it. Would also like to see how other systems tackle those examples.
I checked the failing limt one and it worked fine. Maybe it was fixed recently?

  ;;; Loading #P"/usr/lib/ecl-21.2.1/sb-bsd-sockets.fas"
  ;;; Loading #P"/usr/lib/ecl-21.2.1/sockets.fas"
  Maxima 5.46.0 https://maxima.sourceforge.io
  using Lisp ECL 21.2.1
  Distributed under the GNU Public License. See the file COPYING.
  Dedicated to the memory of William Schelter.
  The function bug_report() provides bug reporting information.
  (%i1) declare(a,real);
  (%o1)                                done
  (%i2) declare(b,real);
  (%o2)                                done
  (%i3) assume(a>b,b>0);
  (%o3)                           [a > b, b > 0]
  (%i4) limit(log(b-a+%i*eta),eta,0,plus);
  (%o4)                         log(a - b) + %i %pi
  (%i5) limit(log(b-a+%i*eta),eta,0,minus);
  (%o5)                         log(a - b) - %i %pi
Version I've installed is 5.45.1 and gets "log(b - a) + %i %pi" and "log(b - a) - %i %pi", so should be. Gave changelog for 5.46.0 a look but not sure whether it had a direct fix for this or was indirectly fixed due to one of the other closed bugs.
Hmm, there is a weird fix with the limits, could be #484: limit(x=0,x,0) wrong
My university course uses Maxima for optimization modules and essentially none of the examples from the textbook work as they should. Official documentation is sparse and often unhelpful too. The functions output Lisp stacktraces if you do something wrong, rather than actually catching errors and printing some human-friendly message that describes the problem and which particular argument caused it without having to dig into Maxima source code. It would be great CAS software if it was a bit more polished, but unfortunately that is unlikely to ever change - it hasn't in the last 4 years that I've used it at least.
> it knows very little about integration

Somewhat related: I've read before that the FOSS CAS Axiom has the only kinda complete implementation of the Risch algorithm for integration. Axiom looks harder to use, but maybe it's an option.

(I don't know anything about the topic)

The axiom implementation isn't complete either and doesn't handle mixed algebraic transcendental functions like sqrt(atan(x)), from what I understand.

The Sympy implementation handles the purely transcendental case and does best effort on the algebraic extensions. It's a lot more ergonomic than fricas/axiom though.