convert a rational function to continued-fraction form
procedure or expression representing a rational function
(optional) variable name appearing in r, if r is an expression
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 r⁡y 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
max⁡m,n mults/divs and m+n adds/subtracts
The command with(numapprox,confracform) allows the use of the abbreviated form of this command.
The Horner form can be evaluated in 4 mults/divs
whereas the continued-fraction form can be evaluated in 2 mults/divs
Download Help Document
What kind of issue would you like to report? (Optional)