numtheory/cfrac(deprecated) - Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : numtheory/cfrac(deprecated)

numtheory

  

cfrac

  

compute a regular or simple continued fraction expansion

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

cfrac(ex_numeric, n, con, den, 'quotients')

cfrac(ex_numeric, n, con, den, 'centered', 'quotients')

cfrac(ex_numeric, 'periodic', 'quotients')

cfrac(ex_rat, x, n, form_rational, 'quotients')

cfrac(ex_algebraic, x, n, diag, form_algebraic, 'quotients')

cfrac(ex_algebraic, x=a, n, diag, form_algebraic, 'quotients')

cfrac(ex_cf)

Parameters

ex_numeric

-

number (rational, float, algebraic, transcendental, real, or complex)

n

-

(optional) integer (n+1 is the number of partial quotients)

con

-

(optional) unevaluated name (a list of n+1 convergents is assigned)

den

-

(optional) unevaluated name (a list of n+1 denominators is assigned)

quotients

-

(optional) literal name; specifies that cfrac compute the list form (a list of two lists: the first list is the pre-period, the second list is the period) for the continued fraction expansion.

centered

-

(optional) literal name; specifies that cfrac compute a centered form

periodic

-

(optional) literal name; specifies that cfrac compute the simple continued fraction expansion for a quadratic surd ex_numeric

ex_rat

-

rational polynomial

x

-

(optional) unevaluated name; a variable in which the continued fraction is expanded

form_rational

-

(optional) name: simple, regular, or monic

ex_algebraic

-

series or algebraic object

diag

-

(optional) name: superdiagonal or subdiagonal

form_algebraic

-

(optional) name: simple, semisimple, or simregular

a

-

algebraic expression specifying a finite expansion point

ex_cf

-

continued fraction in fraction form or list form

Description

• 

Important: The numtheory[cfrac] command has been deprecated.  Use the superseding command NumberTheory[ContinuedFraction] instead.

• 

The cfrac command computes a continued fraction expansion of a number, rational polynomial, series, or other algebraic expression.

• 

There are at least five forms for continued fraction expansions:

1. 

Regular continued fraction:

[b0,[a1,b1],[a2,b2],...,[an,bn],...],

  

where, usually, ai and bi for i > 0 are integers or polynomials with integer coefficients. If b00 then it is called superdiagonal, otherwise it is called subdiagonal.

2. 

Simple continued fraction:

[a0,a1,a2,...,an,...]=[a0,[1,a1],[1,a2],...,[1,an],...].

3. 

Simregular continued fraction:

[b0,[a1,1],[a2,1],...,[an,1],...].

4. 

Semisimple continued fraction:

[b0,[e1,b1],[e2,b2],...,[en,bn],...],

  

where ei=1, signbi=1 for i = 1, 2, ...

5. 

Monic polynomial continued fraction:

[b0,[e1,b1],[e2,b2],...,[en,bn],...],

  

where each bi is a monic polynomial for i = 1, 2, ...

• 

By default, the cfrac command returns the fraction form of the continued fraction. The form used in the previous illustrations (1)-(5) is referred to as the list form.

  

The list form for a periodic continued fraction is a0&comma;...&comma;am&comma;b1&comma;...&comma;bn, where 0<m, 1<n, a0&in; and a1&comma;&comma;an&gt;0 describe the preperiod and b1&comma;&comma;bn&gt;0 represent the period, i.e.,

a0&plus;1a1&plus;1...&plus;1an&plus;1b1&plus;1...&plus;1bn&plus;1b1&plus;1...&plus;1bn&plus;1...

• 

If you specify the quotients option, the continued fraction is returned in list form.  For large continued fractions, this form prints more quickly than the fraction form.

• 

If you specify the n option, at most n + 1 quotients of the continued fraction are computed.

• 

If cfrac is passed a continued fraction, in fraction or list form, it computes the last convergent of the continued fraction. For a periodic continued fraction, it returns the corresponding quadratic surd.

• 

The print routine print/CFRAC is used by the prettyprinter to format the fraction form on screen.

• 

This function is part of the numtheory package, and so can be used in the form cfrac(..) only after performing the command with(numtheory). The function can always be accessed in the long form numtheory[cfrac](..).

• 

The cfrac command computes a continued fraction expansion for three kinds of input:

6. 

Numeric

7. 

Rational polynomials

8. 

Series or algebraic objects

Numerical Case: Simple and Centered Continued Fraction

• 

The cfrac(ex_numeric) calling sequence returns a fraction form of the continued fraction for the real or complex number ex_numeric.

  

If ex_numeric is a complex number, cfrac returns a continued fraction expansion if and only if that expansion is finite. (There are many different definitions of continued fractions for complex numbers.)

• 

If you specify the con option, cfrac assigns a list containing the convergents to that name.

• 

If you specify the den option, cfrac assigns a list containing the denominators to that name.

• 

If you specify the periodic option, cfrac computes a continued fraction for the quadratic surd ex_numeric. None of the other optional arguments (n, con, den) can be specified in this case.

Rational Polynomial Case

• 

The cfrac(ex_rat) calling sequence returns a fraction form of the continued fraction for the rational polynomial ex_rat.

• 

You can specify the form of the resulting continued fraction using the form_rational option (simple, regular, or monic). By default, cfrac returns the simple continued fraction form.

• 

Applying the cfrac command to a finite simple continued fraction (fraction form or list form) returns the original rational polynomial.

Series and Algebraic Object Cases

• 

The cfrac(ex_algebraic) calling sequence returns a superdiagonal continued fraction approximation for the series or algebraic object ex_algebraic that is equal to the k&comma;k or k&comma;k1 Pade approximant (depending on the parity of the order n if specified).

• 

Using the cfrac(ex_algebraic, x=a) calling sequence, you can specify an expansion point. The continued fraction will be expressed in terms of powers of xa.

• 

If you specify the subdiagonal option, cfrac computes the continued fraction equivalent to the k&comma;k or k1&comma;k Pade approximant.

• 

You can specify the form of the resulting continued fraction using the form_algebraic option (simple, semisimple, or simregular). By default, cfrac returns the simple continued fraction form.

Examples

withnumtheory&colon;

cfrac&pi;&comma;6

3&plus;17&plus;115&plus;11&plus;1292&plus;11&plus;11&plus;...

(1)

cfrac&pi;&comma;100&comma;&apos;quotients&apos;

3&comma;7&comma;15&comma;1&comma;292&comma;1&comma;1&comma;1&comma;2&comma;1&comma;3&comma;1&comma;14&comma;2&comma;1&comma;1&comma;2&comma;2&comma;2&comma;2&comma;1&comma;84&comma;2&comma;1&comma;1&comma;15&comma;3&comma;13&comma;1&comma;4&comma;2&comma;6&comma;6&comma;99&comma;1&comma;2&comma;2&comma;6&comma;3&comma;5&comma;1&comma;1&comma;6&comma;8&comma;1&comma;7&comma;1&comma;2&comma;3&comma;7&comma;1&comma;2&comma;1&comma;1&comma;12&comma;1&comma;1&comma;1&comma;3&comma;1&comma;1&comma;8&comma;1&comma;1&comma;2&comma;1&comma;6&comma;1&comma;1&comma;5&comma;2&comma;2&comma;3&comma;1&comma;2&comma;4&comma;4&comma;16&comma;1&comma;161&comma;45&comma;1&comma;22&comma;1&comma;2&comma;2&comma;1&comma;4&comma;1&comma;2&comma;24&comma;1&comma;2&comma;1&comma;3&comma;1&comma;2&comma;1&comma;1&comma;10&comma;2&comma;...

(2)

cfrac312&comma;&apos;periodic&apos;

1&plus;11&plus;12&plus;11&plus;12&plus;...

(3)

cfrac312&comma;&apos;periodic&apos;&comma;&apos;quotients&apos;

1&comma;1&comma;2

(4)

cfrac3547099661&plus;315I99661&comma;&apos;centered&apos;

I3I&plus;11&plus;5I12&plus;I&plus;I1&plus;2II3&plus;2II1&plus;I

(5)

fcfracx4&plus;13x2&plus;50x&plus;1205x2&plus;x&plus;1

f:=15x2125x&plus;321125&plus;16255934x281087511737452&plus;12321668005614242671875x&plus;5743135263614242671875

(6)

cfracf

x4&plus;13x2&plus;50x&plus;1205x2&plus;x&plus;1

(7)

gcfrac1&plus;xk&comma;x&comma;7&comma;&apos;subdiagonal&apos;&comma;&apos;simregular&apos;

g:=11kx1&plus;12k&plus;1x116k1x1&plus;16k&plus;2x1110k2x1&plus;110k&plus;3x1&plus;...

(8)

opg

0&comma;1&comma;1&comma;kx&comma;1&comma;12k&plus;1x&comma;1&comma;16k1x&comma;1&comma;16k&plus;2x&comma;1&comma;110k2x&comma;1&comma;110k&plus;3x&comma;1&comma;...

(9)

cfrac&ExponentialE;x&comma;x&equals;1&comma;5

&ExponentialE;&plus;x11&ExponentialE;&plus;x12&ExponentialE;&plus;x13&ExponentialE;&plus;x12&ExponentialE;&plus;x15&ExponentialE;&plus;...

(10)

Compatibility

• 

The optional arguments con and den can be used in conjunction with the option centered as of Maple 16.

• 

The argument ex_cf can be a periodic continued fraction as of Maple 16.

• 

The a parameter was introduced in Maple 16.

• 

The ex_cf parameter was updated in Maple 16.

• 

For more information on Maple 16 changes, see Updates in Maple 16.

See Also

convert/confrac

numtheory

numtheory[cfracpol]

numtheory[invcfrac]

numtheory[nthconver]

op

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam