sttaylor.spad line 1 [edit on github]
StreamTaylorSeriesOperations implements Taylor series arithmetic, where a Taylor series is represented by a stream of its coefficients, see corresponding operations in the category Ring.
r * a
returns the power series scalar multiplication of r
by a
: r * [a0, a1, ...] = [r * a0, r * a1, ...]
a * r
returns the power series scalar multiplication of a
by r:
[a0, a1, ...] * r = [a0 * r, a1 * r, ...]
a * b
returns the power series (Cauchy) product of a
and b:
[a0, a1, ...] * [b0, b1, ...] = [c0, c1, ...]
where ck = sum(i + j = k,
.ai
* bk)
a + b
returns the power series sum of a
and b
: [a0, a1, ..] + [b0, b1, ..] = [a0 + b0, a1 + b1, ..]
- a
returns the power series negative of a
: - [a0, a1, ...] = [- a0, - a1, ...]
a - b
returns the power series difference of a
and b
: [a0, a1, ..] - [b0, b1, ..] = [a0 - b0, a1 - b1, ..]
a / b
returns the power series quotient of a
by b
. An error message is returned if b
is not invertible. This function is used in fixed point computations.
addiag(x)
performs diagonal addition of a stream of streams. if x
= [[a<0, 0>, a<0, 1>, ..], [a<1, 0>, a<1, 1>, ..], [a<2, 0>, a<2, 1>, ..], ..]
and addiag(x) = [b<0, b<1>, ...], then b<k> = sum(i+j=k, a<i, j>)
.
coerce(r)
converts a ring element r
to a stream with one element.
compose(a, b)
composes the power series a
with the power series b
.
deriv(a)
returns the derivative of the power series with respect to the power series variable. Thus deriv([a0, a1, a2, ...])
returns [a1, 2 a2, 3 a3, ...]
.
eval(a, r)
returns a stream of partial sums of the power series a
evaluated at the power series variable equal to r
.
evenlambert(st)
computes f(x^2) + f(x^4) + f(x^6) + ...
if st
is a stream representing f(x)
. This function is used for computing infinite products. If f(x)
is a power series with constant coefficient 1, then prod(f(x^(2*n)), n=1..infinity) = exp(evenlambert(log(f(x))))
.
exquo(a, b)
returns the power series quotient of a
by b
, if the quotient exists, and "failed" otherwise
gderiv(f, [a0, a1, a2, ..])
returns [f(0)*a0, f(1)*a1, f(2)*a2, ..]
.
generalLambert(f(x), a, d)
returns f(x^a) + f(x^(a + d)) + f(x^(a + 2 d)) + ...
. f(x)
should have zero constant coefficient and a
and d
should be positive.
general_Lambert_product(f(x), a, d)
returns f(x^a)*f(x^(a + d))*f(x^(a + 2 d))* ...
. f(x)
should have constant coefficient equal to one and a
and d
should be positive.
int(r)
returns [r
, r+1
, r+2
, ...], where r
is a ring element.
integers(n)
returns [n, n+1, n+2, ...]
.
integrate(r, a)
returns the integral of the power series a
with respect to the power series variable where r
denotes the constant of integration. Thus integrate(a, [a0, a1, a2, ...]) = [a, a0, a1/2, a2/3, ...]
.
invmultisect(a, b, st)
substitutes x^((a+b)*n)
for x^n
and multiplies by x^b
.
lagrange(g)
produces the power series for f
where f
is implicitly defined as f(z) = z*g(f(z))
.
lambert(st)
computes f(x) + f(x^2) + f(x^3) + ...
if st
is a stream representing f(x)
. This function is used for computing infinite products. If f(x)
is a power series with constant coefficient 1 then prod(f(x^n), n = 1..infinity) = exp(lambert(log(f(x))))
.
lazyGintegrate(f, r, g)
is used for fixed point computations.
lazyIntegrate(r, f)
is a version of integrate used for fixed point computations.
mapdiv([a0, a1, ..], [b0, b1, ..])
returns [a0/b0, a1/b1, ..]
.
mapmult([a0, a1, ..], [b0, b1, ..])
returns [a0*b0, a1*b1, ..]
.
monom(deg, coef)
is a monomial of degree deg
with coefficient coef.
multisect(a, b, st)
selects the coefficients of x^((a+b)*n+a)
, and changes them to x^n
.
nlde(u)
solves a first order non-linear differential equation described by u
of the form [[b<0, 0>, b<0, 1>, ...], [b<1, 0>, b<1, 1>, .], ...]
. the differential equation has the form y' = sum(i=0 to infinity, j=0 to infinity, b<i, j>*(x^i)*(y^j))
.
oddintegers(n)
returns [n, n+2, n+4, ...]
.
oddlambert(st)
computes f(x) + f(x^3) + f(x^5) + ...
if st
is a stream representing f(x)
. This function is used for computing infinite products. If f
(x
) is a power series with constant coefficient 1 then prod(f(x^(2*n-1)), n=1..infinity) = exp(oddlambert(log(f(x))))
.
power(a, f)
returns the power series f
raised to the power a
.
powern(r, f)
raises power series f
to the power r
.
prodiag(x)
performs "diagonal" infinite product of a stream of streams. When x(i)
is interpreted as stream of coefficients of series f_i(z), i=1,...
, then prodiag(x) = (1 + z*f_1(z))*(1 + z^2*f_2(x))*...
recip(a)
returns the power series reciprocal of a
, or "failed" if not possible.
revert(a)
computes the inverse of a power series a
with respect to composition. the series should have constant coefficient 0 and invertible first order coefficient.