root2cfrac: Function To Generate Continued Fraction For Arbitrary Roots
Description
This function generates the generalized continued fraction for any input value x^(m/n).
Usage
root2cfrac(x, n, m = 1, nterms = 10, ...)
Value
A list, containing:
The continued fraction numerators and denominators in bigz form num , denom .
The continued fraction numerators and denominators in numeric form numericnum, numericdenom . In the extreme case that a value exceeds the machine size of a numeric, NA is returned.
The inputs x, n, m are echoed back.
Arguments
x
The number itself. Integers, doubles, bigz, and bigq classes are allowed.
n
The integer denominator of the power to which x is raised. That is, when m is 1, the n-th root of x is generated.
m
The integer numerator of the power to which x is raised. The default is 1.
The generalized continued fraction for arbitrary roots will not be periodic, and may not even show a pattern in the denominator values. By comparison, sqrt2periodicCfrac generates a simple continued fraction with a periodic sequence for square roots only. That periodic sequence tends to converge more slowly than the aperiodic sequence produced here.