Continuous C-fractions

6 views
Skip to first unread message

Waldek Hebisch

unread,
Jun 14, 2025, 6:38:19 PMJun 14
to fricas...@googlegroups.com
Attached is a little package which converts a stream of coefficients
of a Taylor series into continuous C-fraction. This package is
somewhat releated to PadeApproximants, but I was unable to use
PadeApproximants to do what I wanted, so I created a new package.

This package takes a stream of coefficient as an argument.
Mathematically it would be nicer to take Taylor series, but
current limitations on constants in types means that version
using Taylor series would be harder to write and use.

A the example I wanted is:

st1 := coefficients(taylor(exp(x), x = 0))::Stream(FRAC(INT))
pCF := PadeContinuousFraction(FRAC(INT), 'x)

pade_cf(st1, monomial(1, 1))$pCF

(actually, I needed stream of coefficients of continuous C-fraction
but the above is slightly nicer to look at).

I plan to include it.

--
Waldek Hebisch
padecf.spad

Ralf Hemmecke

unread,
Jun 15, 2025, 4:19:26 AMJun 15
to fricas...@googlegroups.com
On 6/15/25 00:38, Waldek Hebisch wrote:
> Attached is a little package which converts a stream of coefficients
> of a Taylor series into continuous C-fraction. This package is
> somewhat releated to PadeApproximants, but I was unable to use
> PadeApproximants to do what I wanted, so I created a new package.

In fact, I had similar problems in my QEtaPackage, so I created my own
Taylor series implementation by setting the variable to q and the point
of expansion to 0.

https://github.com/hemmecke/qeta/blob/master/src/qetaser.spad#L143

That works well for me, since I don't need other expansion points.
But I remember that I had problems writing a coerce between my domain
and UnivariateTaylorSeries.

In fact, you do the similar thing in mantepse.spad.

https://github.com/fricas/fricas/blob/master/src/algebra/mantepse.spad#L25

Maybe, it is time to add domains for Taylor, Laurent, and Puiseux series
which work similar in spirit like SUP, i,e. no variable and no expasion
point.

Ralf

Waldek Hebisch

unread,
Jun 15, 2025, 1:12:39 PMJun 15
to 'Ralf Hemmecke' via FriCAS - computer algebra system
Maybe. No variable may be limiting.

--
Waldek Hebisch

Ralf Hemmecke

unread,
Jun 15, 2025, 2:01:35 PMJun 15
to fricas...@googlegroups.com
>> In fact, you do the similar thing in mantepse.spad.
>>
>> https://github.com/fricas/fricas/blob/master/src/algebra/mantepse.spad#L25
>>
>> Maybe, it is time to add domains for Taylor, Laurent, and Puiseux series
>> which work similar in spirit like SUP, i,e. no variable and no expasion
>> point.
>
> Maybe. No variable may be limiting.

That is somewhat true. I actually do not quite like that SUP print's its
variable as "?", I'd rather prefer that there would be a domain variable
that can be set via setOutputVariable!: Symbol -> Symbol (and returning
the previous value). As in the univariate polynomial case, we could then
use such (variableless and point-of-expansion-less) version to implement
the current Tayler, Laurent, Puiseux series. I would start working on
such a simple refactoring, if you agree.

Erm, .. but what should I call those domains/categories?

Ralf


Waldek Hebisch

unread,
Jun 18, 2025, 10:11:37 PMJun 18
to 'Ralf Hemmecke' via FriCAS - computer algebra system
At core this looks reasonable. However, mutable state implied by
setOutputVariable! is a nightmare in basic library. Rather, library
should use something like "?" and if desired setOutputVariable! be
part of some user facing domain.

Also, refactoring should start from categories and we would need
categories that are good both for domains without variable and
expansion point and for ones containing them.

There are other potential tricky points, one would have to try
to see if it works better than current code.

> Erm, .. but what should I call those domains/categories?

That is somewhat problematic. We have several series domains
which already have longish names. Old code uses prefix like
Inner to indicate implementation domains, but that leads to
even longer names.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages