approx-alike bug



Maybe the simplest way to do this is something like:

temp:taylor(1+x+y+z,[x,0,3],[y,1,2],[z,2,1]);
  4+(z-2)+(y-1)+x$
taylorinfo(temp);

[[x,0,3],[y,1,2],[z,2,1]]$


Here's a case which looks like a bug in taylorinfo:

(%i27) s13:taylor(sin(x),x,0,3);
(%o27)/T/ x-x^3/6+...            OK
(%i28) s45:taylor(sin(x)^4,x,0,5);
(%o28)/T/ x^4+...                 OK
(%i29) s13+s45;
(%o29)/T/ x-x^3/6+...         OK, correctly truncated at min(3,5)
(%i30) taylorinfo(%);
(%o30) [[x,0,5]]                 So why is its taylorinfo degree 5?

Am I misunderstanding the meaning of the "degree" of the expansion?

            -s

On Thu, Dec 6, 2012 at 8:39 PM, Barton Willis <willisb at unk.edu> wrote:

>
>
>  > Hmm, I'd have thought that a regression test should check that
> taylorinfo of two taylor expressions was the same, not just the ratdisrep.
>  The list of vars of a CRE probably doesn't matter,
> > because the ratdisrep will be different except in degenerate cases, and
> anyway doesn't have any mathematical importance (unlike the order of a
> taylor expansion, which does).
>
> Oh, I agree.  To change this, about 100 tests need to changed. Likely it
> will be some time before I work on this. Fixing the
> tests isn't  100% straightforward; for example the test
>
>   taylor(1+x+y+z,[x,0,3],[y,1,2],[z,2,1]);
>   4+(z-2)+(y-1)+x$
>
>
> would need an   expected output of ''
> taylor(1+x+y+z,[x,0,3],[y,1,2],[z,2,1])"  And that's  silly. The next
> test is
>
>   1/%;
>   1/4-(z-2)/16+(-1/16+(z-2)/32)*(y-1)+(1/64-3*(z-2)/256)*(y-1)^2  + <more
> stuff>
>
> Fixing these requires thought.
>
> --Barton
>
>
>
>
>