confrac - Maple Help

convert/confrac

convert to continued-fraction form

 Calling Sequence convert(expr, confrac) convert(expr, confrac, maxit) convert(expr, confrac, 'cvgts' ) convert(expr, confrac, maxit, 'cvgts') convert(expr, confrac, 'subdiagonal') convert(expr, confrac, var) convert(expr, confrac, var, ctype) convert(expr, confrac, var, order) convert(expr, confrac, var, order, 'subdiagonal')

Parameters

 expr - algebraic expression maxit - (optional) non-negative integer cvgts - (optional) name var - (optional) variable ctype - (optional) one of 'monic', 'regular', or 'simple'. The default is 'monic'. order - (optional) non-negative integer

Description

 • The convert(expr, confrac) command converts a number, series, rational function, or other algebraic expression to a continued-fraction approximation.
 • If expr is numeric then maxit (optional) is the maximum number of partial quotients to be computed, and cvgts (optional) will be assigned a list of the convergents. A list of the partial quotients is returned as the function value.
 • If expr is a series and no additional arguments are specified, a continued-fraction approximation (to the order of the series) is computed.  It is equivalent to either an $\left(n,n\right)$ or $\left(n,n-1\right)$ Pade approximant (depending on the parity of the order). By specifying 'subdiagonal' as an optional third argument, the continued-fraction computed will be equivalent to a $\left(n,n\right)$ or $\left(n-1,n\right)$ Pade approximant.
 • If expr is a ratpoly (quotient of polynomials) in x, the calling sequence is convert(expr, confrac, x). The rational form is converted into its associated continued-fraction form as required for efficient evaluation of numerical subroutines.
 • If expr is any other algebraic expression, the third argument specifies a variable and (optionally) the fourth argument specifies order. The series function is applied to the arguments to obtain a series and then case series applies.
 • By default, a rational polynomial is converted to a monic continued fraction, that is, one with monic polynomials in the non-fractional part of the denominator.  If the option regular or simple is specified then a regular or a simple continued fraction is returned, respectively.
 • Otherwise, convert/confrac is applied to each component of a non-algebraic structure.
 • For information on the inverse transformation, see NumberTheory[ContinuedFraction].

Examples

 > $\mathrm{convert}\left(2.3,\mathrm{confrac}\right)$
 $\left[{2}{,}{3}{,}{3}\right]$ (1)
 > $\mathrm{convert}\left(\frac{21}{13},\mathrm{confrac},'\mathrm{convergents}'\right)$
 $\left[{1}{,}{1}{,}{1}{,}{1}{,}{1}{,}{2}\right]$ (2)
 > $\mathrm{convergents}$
 $\left[{1}{,}{2}{,}\frac{{3}}{{2}}{,}\frac{{5}}{{3}}{,}\frac{{8}}{{5}}{,}\frac{{21}}{{13}}\right]$ (3)
 > $\mathrm{convert}\left(\mathrm{exp}\left(x\right),\mathrm{confrac},x\right)$
 ${1}{+}\frac{{x}}{{1}{+}\frac{{x}}{{-}{2}{+}\frac{{x}}{{-}{3}{+}\frac{{x}}{{2}{+}\frac{{x}}{{5}}}}}}$ (4)
 > $\mathrm{convert}\left(\mathrm{exp}\left(x\right),\mathrm{confrac},x,\mathrm{subdiagonal}\right)$
 $\frac{{1}}{{1}{+}\frac{{x}}{{-}{1}{+}\frac{{x}}{{-}{2}{+}\frac{{x}}{{3}{+}\frac{{x}}{{2}{-}\frac{{x}}{{5}}}}}}}$ (5)
 > $r≔\frac{3{x}^{3}+10{x}^{2}+12}{3{x}^{3}-2{x}^{2}+12}$
 ${r}{≔}\frac{{3}{}{{x}}^{{3}}{+}{10}{}{{x}}^{{2}}{+}{12}}{{3}{}{{x}}^{{3}}{-}{2}{}{{x}}^{{2}}{+}{12}}$ (6)
 > $\mathrm{convert}\left(r,\mathrm{confrac},x\right)$
 ${1}{+}\frac{{4}}{{x}{-}\frac{{2}}{{3}}{+}\frac{{4}}{{{x}}^{{2}}}}$ (7)
 > $\mathrm{convert}\left(r,\mathrm{confrac},x,\mathrm{regular}\right)$
 ${1}{+}\frac{{12}}{{3}{}{x}{-}{2}{+}\frac{{12}}{{{x}}^{{2}}}}$ (8)
 > $\mathrm{convert}\left(r,\mathrm{confrac},x,\mathrm{simple}\right)$
 ${1}{+}\frac{{1}}{\frac{{x}}{{4}}{-}\frac{{1}}{{6}}{+}\frac{{1}}{{{x}}^{{2}}}}$ (9)

Compatibility

 • The option subdiagonal can be used together with the optional argument var as of Maple 16.
 • The subdiagonal option was updated in Maple 16.