recipCfrac {contFracR}R Documentation

Function to Generate the Reciprocal of A Continued Fraction

Description

Given the numerators and denominators of a continued fraction, generate the numerators and denominators of the reciprocal of that fraction.

Usage

recipCfrac( denom, num = 1, ...)

Arguments

denom

A vector of the continued fraction denominators.

num

A vector of the continued fraction numerators. Default is 1, indicating that all numerators have the value 1.

...

Reserved for future use.

Details

This is a Q&D tool to perform a simple operation. It can easily be shown that the reciprocal of a continued fraction is obtained by prepending 0 to the current denominator sequence and prepending 1 to the current numerator sequence. To be explicit, given the standard denominator notation [b0; a1,a2,a3...] , the new denominator vector is [ 0; b0, a1,a2,a3...]

Value

A list containing denom and num (numerators) for the reciprocal value.

Author(s)

Carl Witthoft, carl@witthoft.com

Examples

foon <- c(1,3,5,7,9)
food <- c(1,2,4,6,8,10)
foor <- recipCfrac(num = foon, den=food)
# compare:
cfrac2num(num=foor$num, denom = foor$denom)$cgmp
original <- cfrac2num(num=foon, denom=food)
original$cgmp *cfrac2num(num=foor$num, denom = foor$denom)$cgmp



[Package contFracR version 1.2.1 Index]