Stavros Macrakis wrote:
> ($ratsimp `((rat simp) 1 2)) => ((RAT) 1 2)
>
> This is clearly a bug. $ratsimp should be returning a simplified
> result.
I disagree!
But first, let me point out that the INPUT is slightly bogus.
First of all, you should not be providing the SIMP tag yourself.
You should allow the system to put that tag in. In particular,
the system has only one copy of (RAT SIMP) and you have put in
another one.
Also you probably mean '((... instead of `((... though here it
makes no difference.
So why is it not a bug??
Ordinarily, $ratsimp does not know for sure that its results are
simplified and thus does not have the right to put a SIMP flag
on the expression.
For example,
($ratsimp '((mexpt) x ((mtimes) 3 n))) ==>
((MEXPT RATSIMP) ((MEXPT SIMP) X N) 3)
which is not simplified.
The read-eval-simplify-print loop fixes this
to
((MEXPT SIMP) X ((MTIMES SIMP) 3 N))
You too can do (simplifya ($ratsimp ....))
But it is probably a poor idea to put any quoted (RAT SIMP) or (... SIMP)
in an expression you are building. You might not be right that
an expression is simplified, and then you will make trouble in some
other place.
RJF
That said, in normal Maxima evaluation (meval), every
> function result is simplified explicitly. So it is not clear that
> this has any effects. It would be more serious if ratsimp returned
> something marked simplified which wasn't, e.g. ((rat simp) 2 4).
>
> By the way, if you give $ratsimp an unsimplified *argument* 2/4, it
> does return an unsimplified value 2/4, but it does *not* mark it
> simplified:
>
> ($ratsimp '((rat) 2 4)) => ((rat) 2 4)
>
> I have not found any cases where the missing flag causes problems (yet).
>
> There are several related issues.
>
> ($rat '((rat) 2 4)) => ((mrat simp nil nil) 2 . 4)
> But many Maxima functions don't work well with
> unsimplified arguments.
>
> ($ratdisrep ($rat '((rat) 2 4))) => ((rat) 2 4)
> This is the underlying issue, I think, in the $ratsimp case.
>
> It is not clear whether any of this causes problems in realistic use scenarios:
>
> -s
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima