numapprox - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Numerical Computations : Approximations : numapprox Package : numapprox/confracform

numapprox

  

confracform

  

convert a rational function to continued-fraction form

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

confracform(r)

confracform(r, x)

Parameters

r

-

procedure or expression representing a rational function

x

-

(optional) variable name appearing in r, if r is an expression

Description

• 

This procedure converts a given rational function r into the continued-fraction form which minimizes the number of arithmetic operations required for evaluation.

• 

If the second argument x is present then the first argument must be a rational expression in the variable x. If the second argument is omitted then either r is an operator such that ry yields a rational expression in y, or else r is a rational expression with exactly one indeterminate (determined via indets).

• 

Note that for the purpose of evaluating a rational function efficiently (i.e. minimizing the number of arithmetic operations), the rational function should be converted to continued-fraction form. In general, the cost of evaluating a rational function of degree m,n when each of numerator and denominator is expressed in Horner (nested multiplication) form, with the denominator made monic, is

m+n mults/divs   and   m+n adds/subtracts

  

whereas the same rational function can be evaluated in continued-fraction form with a cost not exceeding

  

 

maxm,n mults/divs   and   m+n adds/subtracts

• 

The command with(numapprox,confracform) allows the use of the abbreviated form of this command.

Examples

withnumapprox:

ft→1.1t220.5t+5.3t2+7.6t+0.1

f:=t→1.1t220.5t+5.3t2+7.6t+0.1

(1)

The Horner form can be evaluated in 4 mults/divs

hornerformf

t→5.3+20.5+1.1tt0.1+7.6+tt

(2)

whereas the continued-fraction form can be evaluated in 2 mults/divs

confracformf

y→1.10000000028.86000000y+7.779833680+1.499076119y0.1798336798

(3)

epadeⅇx,x,2,2

e:=112x2+12x+1112x212x+1

(4)

confracforme,x

1+12x6+12x

(5)

r2,3minimaxtanxx,x=0..π4,2,3

r2,3:=1.130422926+0.078427982540.07066118710xx1.130423032+0.07843711579+0.4473405792+0.02547897687xxx

(6)

confracformr2,3

2.773313366x18.66715865+33.63826614x+8.668760300+49.52801799x7.558844295

(7)

See Also

convert/confrac

indets

numapprox[hornerform]

 


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