Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
Function: contfracinit Section: sums C-Name: contfracinit Prototype: GD-1,L, Help: contfracinit(M,{lim = -1}): given M representing the power series S = sum_{n>=0} M[n+1]z^n, transform it into a continued fraction suitable for evaluation. Doc: Given $M$ representing the power series $S=\sum_{n\ge0} M[n+1]z^n$, transform it into a continued fraction in Euler form, using the quotient-difference algorithm; restrict to $n\leq \kbd{lim}$ if latter is nonnegative. $M$ can be a vector, a power series, a polynomial; if the limiting parameter \kbd{lim} is present, a rational function is also allowed (and converted to a power series of that accuracy). The result is a 2-component vector $[A,B]$ such that $S = M[1] / (1+A[1]z+B[1]z^2/(1+A[2]z+B[2]z^2/(1+\dots 1/(1+A[lim/2]z))))$. Does not work if any coefficient of $M$ vanishes, nor for series for which certain partial denominators vanish. Variant: Also available is \fun{GEN}{quodif}{GEN M, long n} which returns the standard continued fraction, as a vector $C$ such that $S = c[1] / (1 + c[2]z / (1+c[3]z/(1+\dots...c[lim]z)))$.