hgfred and create-poly



Am Freitag, den 29.01.2010, 14:03 -0500 schrieb Raymond Toy:
> On 1/29/10 12:58 PM, Dieter Kaiser wrote:
> > Because of some additional checks in 2f1polys we can get results in
> > terms of unsimplified polynomials:
> >
> > (%i18) hgfred([-1,1],[1/2],x);
> > (%o18) chebyshev_t(1,1-2*x)
> > (%i19) ev(%),nouns;
> > (%o19) 1-2*x
> >
> > (%i20) hgfred([-1,3],[3/2],x);
> > (%o20) ultraspherical(1,1,1-2*x)/2
> > (%i21) ev(%),nouns;
> > (%o21) 1-2*x
> >
> > Especially, when we have a number as an argument I think it is of
> > interest to get the most simple result immediately. Now we have to do an
> > extra evaluation:
> >   
> I kind of like it returning the special orthogonal polynomials.  Yes,
> it's sometimes annoying when the result is so simple, as you show above,
> but it might be nice to know that it was a special polynomial before it
> gets simplified.

OK, I see that it is of interest to get the more general expression
too. 

To get both, the most simple result if desired and the more general
expression I would like to suggest to trigger the expansion with an user
flag, e.g. $expand_polynomials.

To get it all consistent we have in addition to revert some already done
expansions of polynomials. Furthermore, we have to decide what the
default value should be.

Remark: Especially in longer and complex calculations or in algorithm
like specint it might be preferable to simplify immediately to the most
simple result by default.

Dieter Kaiser