Ralf Hemmecke <[email protected]> writes:
>> I just noticed the following behaviour, which I find surprising:
>>
>> (2) -> s := taylor(x+x^2+x^3,x=0)$ExpressionToUnivariatePowerSeries(INT,
>> EXPR INT)
>>
>> 2 3
>> (2) x + x + x
>> Type:
>> UnivariateTaylorSeries(Expression(Integer),x,0)
>> (3) -> s.10
>>
>> (3) 0
>> Type:
>> Expression(Integer)
>> (4) -> coefficients s
>>
>> (4) [0,1,1,1]
>> Type:
>> Stream(Expression(Integer))
>
>> In words: the stream of coefficients is finite, but getting the n'th
>> coefficient works.
>
> So?
>
> In UnivariateTaylorSeriesCategory it says...
>
> coefficients: % -> Stream Coef
> ++ \spad{coefficients(a0 + a1 x + a2 x^2 + ...)} returns a stream
> ++ of coefficients: \spad{[a0,a1,a2,...]}. The entries of the stream
> ++ may be zero.
>
> Which means, if I implement the "coefficients" function by just
> returning the stream [a0], that would also match the above
> specification. It doesn't say anything about finite/infinite. It
> doesn't even say whether all or just 1 or 2 or 3 coefficients should
> be returned.
Yes, and what I'm saying is that I do not like this description. I'd
prefer something like:
++ \spad{coefficients(a0 + a1 x + a2 x^2 + ...)} returns the
++ (infinite) stream of all coefficients of the series:
++ \spad{[a0,a1,a2,...]}.
> and at the same time Stream(S) says
>
> ++ A stream is an implementation of an infinite sequence using
> ++ a list of terms that have been computed and a function closure
> ++ to compute additional terms when needed.
should say: ... of a possibly infinite sequence ...
>> 1) there is no bug, we should only specify in coefficients that a
>> finite stream means that the remaining coefficients are zero
>
> I think this is the case.
>
>> 2) series: Stream Coef -> % should require that the given stream is
>> infinite. (but cannot check that of course)
>
> But why?
because in my opinion a power series always has infinitely many
coefficients.
Martin
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.