Power series |
Power series are implemented within the class
|
Series are implemented in a lazy way, which means that the precision has not to be specified in advance. Computations are actually done when a coefficient is actually needed.
The precision used for printing the power series can be set to
|
Instead of printing an approximation of the series, it is possible to display the formula it has been built from, as follows:
|
Withing equality test the precision to be taken into account can be
set to
|
The name of the variable to be printed can be set to
|
Naive algorithms for power series are implemented in
Over numerical types, elementary functions are available from
The relaxed product for power series is implemented in
|
The relaxed product has a softly linear cost.
A series is said to be recursive if it
satisfies an equation
that allows to compute
the
-th coefficient of
as the
-th coefficient of
with the only knowledge of the
first
coefficients of
, whenever
is larger than an integer
called the
index.
For example +1, with
can be implemented as follows:
|
On this example, the fact that the -th
coefficient of
depends only on the first
coefficients of
is due to
the multiplication by
. This multiplication
must be done using the left shift
, the recursive series mechanism would call
recursively
Many commonly used series are recursive series. For example, a regular
series root of a polynomial
,
that is
and
, is a
recursive series.
The file
|
which computes the unique regular root of
whose zeroth term is
from its first
coefficient is done by transforming the implicit equation
into a recursive equation
and by
applying the recursive series mechanism.
A variant
Implicit series are implemented in
Vectorial and matricial auxiliary functions are available from
Mmx] |
use "algebramix"; type_mode? := true; |
Mmx] |
z == series (0 :> Rational, 1 :> Rational) |
:
Mmx] |
f == log (1 - z) |
:
Mmx] |
f[20] |
: