From: Stavros M. (Σ. Μ. <mac...@al...> - 2016-04-01 20:33:52
|
Reasonable questions. It's safest to trigger an error whenever Maxima sees a Lisp complex or rational. But I don't think that adding such code is a particularly productive use of anyone's time. It is a bug for any Maxima code to *create *Lisp complexes or rationals, because much of Maxima assumes they don't exist. Not a bug to handle them correctly if they appear in the input, but not terribly useful. If someone wants to make a serious effort to systematically add support for Lisp complexes or rationals, yes, I will try to dissuade them, because it's a large project and they're wasting their time. Calling that "filling the gaps" is a strange description of that project. It would be equally strange to call converting Maxima to CLOS objects rather than Lisp structures "filling the gaps" (though it is potentially more useful). But if they insist, I'd insist that it be under yet-another-flag control to minimize disruption while it wasn't well tested. And I'd also try to persuade them that they need to start by writing a lot of tests, not just to check that (1+%i)/(1-%i) => %i, but that factor(2+4*%i) => 2*(1+2*%i), etc. Tell me again, what would be the advantage of using Lisp complexes? -s PS There is also a bunch of design work to be done: I assume that the canonical form of %i is #C(0 1). Is #C(2 0) considered simplified, or is it always canonicalized to 2?; if canonicalized, it looks like we still need glue code at interfaces with Lisp code using Lisp complexes. With inflag:false, do we treat #C(1 2) as though it were 1+2*%i? How about with inflag:true (inpart(2/3,0) currently => "/", although inpart(a/b,0) => "*"). By the way, what do you expect general simplification to do with x/(1-%i) == (1/2+%i/2)*x == (1+%i)*x/2 == x/2+x*%i/2? Which of these forms is simplified? If more than one, which simplifies to which? Do we continue to allow things like (-1)^(1/4) or do we always simplify to #C(1,1)/sqrt(2), the way we simplify sqrt(12) => 2*sqrt(3)? On Fri, Apr 1, 2016 at 3:21 PM, Robert Dodier <rob...@gm...> wrote: > On 2016-04-01, Stavros Macrakis <mac...@al...> wrote: > > > It is tempting to want to take advantage of Lisp complex numbers in > Maxima. > > > However, there are several big problems with this theory: > > It's not clear to me if you're proposing any action here. Do you want to > remove any extant accommodation for Lisp complex numbers and instead > trigger an error if any appears? or something else? There is little > support for Lisp complex numbers at present -- are you actively trying > to discourage others from filling the gaps? Would you be disappointed if > someone did make such an effort? > > Full of questions today, I guess -- > > Robert Dodier > > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |