LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN 510.84 IJifcr Tp.54l-b46> cop 2- Digitized by the Internet Archive in 2013 http://archive.org/details/statusofinvestig542robe Z" }}UZ% UIUCDCS-R-72-5^2 THE STATUS OF INVESTIGATIONS INTO THE USE OF CONTINUED FPACTIONS FOR COMPUTER HARDWARE by August, 1972 James E. Robertson* and Kishor Trivedi* ME LiSRARY q £ tjje SEP 12 1972 UNIVERSITY OF ILLINOIS ATU r ^ '"-CHAMPAIGN UIUCDCS-R-72-5^2 THE STATUS OF INVESTIGATIONS INTO THE USE OF CONTINUED FRACTIONS FOR COMPUTER HARDWARE by James E. Robertson* and Kishor Trivedi* August, 1972 The research on which this paper is based was supported in part by the National Science Foundation under Contract GJ81J, by the Applied Mathematics Department of Brookhaven National Laboratory, and by the Department of Computer Science of the University of Illinois. ^Department of Computer Science, University of Illinois, Urbana, Illinois, Abstract The purpose of this paper is to demonstrate that representations of numbers other than positional notation may lead to practical hardware realizations for the digital calculation of classes of algorithms. It is the authors' opinion that practicality of the use of continued products has been demonstrated. This paper describes current research in the use of continued fractions. Although practicality has not been demonstrated, theoretical results are promising, and the results thus far are presented as a case study of the difficulties which arise when use of a new representation is attempted. There appear to be three fundamental requirements for a proposed representation to be useful. Existence of sets of digital values for coefficients (e.g., for partial denominators and partial numerators for continued fractions) and a concomitant simple procedure for conversion to positional notation are necessary. Secondly, a compatible set of algorithms must be found, with the set of sufficient scope to justify its use. Thirdly, simple rules for selection of the coefficients must be found. For continued fractions, the first requirement necessitates the use of simple binary coefficients (e.g., 1/2, l), which primarily distinguishes the approach taken here from results of the past several centuries of research. For the second requirement, emphasis is given to the first algorithm to be found, namely, solution of a quadratic equation. Finding a set of algorithms of sufficiently wide scope seems to be the major problem, and at this time, only a few techniques which may lead to new algorithms can be described. An example of selection rules for solution of the quadratic is presented in detail. 1. History and Motivation This paper is essentially a report on research in progress. The fundamental observation is that, currently, virtually all digital hardware calculations are based on the use of positional notation; equivalently, on weighted sums of series. Other representations of numbers exist; the concern here will be with continued products and continued fractions. The use of positional notation has been limited to addition, subtraction, multiplication, division, and, to a lesser extent, square and higher roots. It has been shown [1] that use of continued products extends the list of implementable algorithms to the logarithm, the exponential, the trigonometric and inverse trigonometric functions, as well as multiply, divide, and square root. Both time of execution and cost of hardware are reasonable with current technology; in comparison with a conventional arithmetic unit, factors of 2 to 3 for both time and cost are typical. A small read-only memory fast enough to match accumulator rates is also needed. The investigation of the use of continued products was originally limited to the binary case. Higher radix techniques appear promising, and are being investigated [2]. Otherwise, emphasis will be given here to investigations into the use of continued fractions. Results to date are theoretically promising, but not yet practical in the sense of hardware implementation. There appear to be three fundamental requirements for a proposed representation of numbers to be useful for implementation in hardware. These are: 1) Conversion to conventional series form (positional notation) must be "both possible and simple. Implicit here is the requirement that the set of possible results spans continuously (in the limit of infinite precision) some permissible range of values. For floating point arithmetic, it seems sufficient to require that the ratio of the upper limit to the lower limit of the range be at least two. 2) The set of algorithms should include algorithms which are easily soluble for the representation of numbers employed. Compatability among algorithms, in the sense of hardware sharing, is also a desirable goal. 3) Since most algorithms, other than multiplication, appear to require trial and error procedures in the absence of redundancy, it must be possible to devise techniques such that the selection of each of the successive coefficients is practical (cf., quotient digit selection in division). It should be pointed out that the use of the coefficients of a representation is ephemeral, since conversion to positional notation occurs in parallel with the successive steps of the algorithm. For example, for a continued product, fr (1+2-%) = (l+S-\) k -if 1 (l^- i 6 ,). i=l 1 k 1=1 X At any one step the (k-l)st continued product has been determined, the coefficient e, is determined by the selection rules appropriate to the algorithm, and the kth value of the continued product (in positional notation) is calculated by adding the (k-l)st value to a shifted version of itself. The entire set of coefficients e. (i = 1, 2, . .., m) is never simultaneously available. It is difficult to generalize about the procedures necessary to determine whether or not a proposed representation satisfies the requirements previously discussed. For continued products and continued fractions, determination of the set of coefficient values and the associated conversion procedure has been relatively simple. The identification of suitable algorithms appears to be by far the most difficult requirement to satisfy. In retrospect, for continued products, the observation that the logarithm of a continued product is the sum of the logarithms of the individual terms leads to the identification of the logarithm and its inverse, the exponential, as suitable algorithms. Similarly, the properties of the complex exponential indicate that the trigonometric functions and their inverses are identifiable as algorithms for continued product representations. No such general observation is as yet apparent to the authors 1 for continued fractions. Formulating selection rules appears to be very much a function of the individual algorithm. 2. Examples: Division Algorithms For illustrative purposes, algorithms for division are developed for positional notation, for continued products, and for continued fractions. In each case, the initial assumption is that Era D " X - ° or some variant thereof, where N is the dividend, D is the divisor, and X is the quotient. The same procedures are then used for developing the algorithms, except for the representation of X. For positional notation the division algorithm in common use is developed. For continued products, a new algorithm with many useful properties is found. The continued fraction algorithm is obviously an exercise in futility, since the conversion procedure requires of itself a division as its terminal step. 2.1 Positional Notation We define the remainder at the ith step by N - DX. s Y.j and also N - DX. , = Y. . l i 7 l-l l-l For positional notation X. = X. . + 2~ 1 x. = i 2~ J 'x. i i-l i j=1 J Y. = N - DX. = N - DX. . - 2 -1 Dx. = Y. _ - 2 _1 Dx. l l l-l l i-l l Since the allowed range of Y. decreases by a factor of two at each step, it is convenient to define a shifted remainder r. r. =2 I., and also r. - = 2 " i. . i i' i-l i-l r. = 2 X Y. . - Dx. = 2r. . - Dx. 2.1.1 l i-l l i-l l Equation 2.1.1 is the familiar recursion for most "binary division procedures in common use. The initial remainder Y = r = N, the dividend, and X = 0. o 2.2 Continued Products As in the previous example, the remainder is N - DX. = Y., and N - DX. - = Y. - l i l-l l-l For a continued product X. = X. n (l+2 _1 x. ) = tt (l+2" J "x.) 2.2.1 l i-l v i y . - j Y n = N - DX. = N - DX. _ - 2" X DX. -X. 1 l l-l l-l l = Y. . - 2 _1 (N-Y. _)x. l-l l-l l = Y. n (l+2" 1 x. ) - 2 _1 Nx. l-l l i It is again convenient to define a shifted remainder r. . r. = 2 X Y., and r. _ = 2 1 ~ 1 Y. , l i' l-l l-l r. = 2 X Y. n (l+2 _1 x.) - Nx. l i-l v l i = 2r. n (l+2" 1 x. ) - Nx. 2.2.2 l-l l l The conversion procedure is X. = X. n + 2 _1 x.X. -, with X * 1 1 1-1 1 i-l' o and x. = 1, 0, 1, or x. = 0, 1. The initial remainder is Y = r ■ = N - D. l 7 ' ' l oo An alternative which simplifies the selection procedure is to let I = 1 in equation 2.2.2, and compensate by letting X q = N as the initial condition for the conversion procedure of equation 2.2.1. 7 2.3 Continued Fractions P. For continued fractions, let X. = — , and define the remainder Y. as ' i Q. i y. = m. - dp. Ill The conversion procedure is given by the recursions P l " «i P i-l + P l P i-2 P o " ° P l " *1 \ " «A-1 + P i\-2 Q o " X 9 1 " *1 which must he followed by a terminal division (i=m) as indicated by P X = 7T— . Otherwise, the conversion consists of additions and shifts if m Q, ' m p. and q. are simple binary coefficients; e.g., 1/4, 1/2, 1, and 2. We note that 2.3.1 Y. = HQ. n - DP. „ i-2 i-2 i-2 Y. _ = NQ. _ - DP. . l-l i-l l-l therefore Y. = Kfq.Q.^ + p.Q._ 2 ) -D( q .P._ 1+ p.P._ 2 ) Y i " Vi-1 + P i Y i-2 2 - 5 - 2 Equation 2.3.2 is derived here for illustrative purposes only. Due to the obvious impracticality of the process, neither the rate of convergence (i.e., decrease in range of Y. ) nor the selection procedure (i.e., method of choosing q. and p.) have been studied. 3. The First Quadratic Consider the finite continued fraction with k partial numerators p. and k partial denominators q. (i = 1, 2, ..., k), whose value is W i - e *' p p k 1 \ \ + V 2 *2 + !l q 3 + q k P and Q- are determined from the recursions: p i ■ h p i-i - p ± p ±-2 l .- a » 5 > ••' k % ■ % Q i-1 + % Q i-2 P = ° P l = ?l S' 1 \=1l It is clear that P, and Q. can be separately and simultaneously determined in two binary arithmetic units in k-1 addition times if the p. and q. are chosen to be simple in the binary sense. It is convenient to make the choice p. = 1 for all i; it can be shown (Section 6) that other values of p. are admissable. The digit set for q. is initially assumed to be two-valued, and after some investigation it was found that choice of the digit set q. = [1/2, 1} yields continued fractions whose values — are continuous in the limit over the interval as defined by the following equation: P k 1/2 < lim gp < 1 k-> oo K These properties indicate that a suitable continued fraction representation exists, such that conversion to conventional binary can be achieved by repetitive use of two binary adders in parallel, followed by a division to determine the quotient P /Q . Determination of an algorithm and the appropriate corresponding computational procedure is much more difficult. The particular algorithm chosen for investigation was the solution of the limited class of quadratics x + b, x - c = (x-u)(x+v) = 3-1 such that l/2 < u < 1. The problem, specifically, is, given b and c , find u (and hence v = b, + u). This algorithm was selected because of the following property of infinite periodic continued fractions, of period k. If the sum of the first k-1 terms is P, -i/Q^ -\ an( ^ the sum of the first k terms is P,/Q, , then the quadratic coefficients b and c are b = (Q, - P )/Q» , and c = P./Q. -> • The value of the infinite periodic continued fraction is then u, the positive root of the quadratic. The problem is then resolved specifically to the following one. Given (0, - P -1 )/ < \. -1 a *id P,/Qn -, (Note that k is unknown.), find the sequence of partial denominators q. (i = 1, 2, ..., k). The first two approaches to a computational procedure were similar. Given the limited information about the values of continued fractions of order k-1 and order k implicit in b and c , determine the sequence of partial denominators a) q k+1 = q a , q k+2 = q^ ..., q^ = q k , or 'b) q k , q k-1 , ..-, q-L 10 After extensive investigation, it appears possible to prove that either of these approaches requires knowledge of the solution in order to determine the q., hence these approaches were abandoned. The third and fourth approaches were based on the observation that the value u of the infinite periodic continued fraction of period k with p. = 1, q. = 11/2, 1}, (i = X f 2, . .., k) is also the value u of the infinite periodic continued fraction of period one with each p. = c and each q. = b (i = 1, 2, . .., oo). That is, C k u = b. + u k Approaches three and four may therefore be considered as methods of conversion from one form of infinite continued fraction to that form which is easily converted to a conventional binary representation. Computational approach number three, in successive steps, generates q , q^, etc., such that u = c. =1 =1 k K + "v ^ + 7 k-l q l + ^-T — 8+7 ^ 7 k-2 b k + °k k_1 k - 1 B +y ZT-Z 6. , + P k-2 7 k-2 b + H k-1 s K . \ P k-2 + For this approach, the recursion relations are 2 ^^and 1 + qjl ^~ n+1 2 k " n "' _Qn " Vn+1 ailC Vn " 7 k-n+l ^ for n = 1, 2, ..., with 8 = b and y = c for the first step. Clearly, this procedure requires two divisions as well as other operations at each step, and is unsuitable for mechanization. 11 The fourth approach, in successive steps, generates partial quotients q,, q„, etc., by increasing the periodicity of periodic continued fractions, as follows : u - c. =1 = 1 k rmmm w mn h k ¥ c k q l + C k-1 q l + X b~TZ Vi + i % + Vg BT+ q i + °k-l \-2 + k Vi + After a considerable amount of algebra, the recursion relations can be shown to be; b k-n = %. C k-n+l " V-l C k-n+2 + b k-n+2 3.2 k-n ti k-n ti k-n+1 k-n+2 It should be noted that the relative simplicity of these recursions is dependent on the fact that P Q, , - P , Q, = (-1) , which requires that * n n-1 n-1 h ' the partial numerators p. be 1. For n = 1, the recursions require that 3 b k+1 m 0, c k+1 = 1, and a^ = 12 k. Extension of the Range and Domain of Quadratic Solutions In the previous section, the generality of the solution of the quadratic of equation 3»1 is limited by the requirement that the root u is representable. For the choice q.e{l/2, 1} and p. = 1, the range of u is 1/2 < u < 1. Replacing x in equation 3»1 by u . = 1/2 and u max = 1, the solutions are limited to the triangular "wedge in the c b plane 1/2 b n + 1 /k < c < b +1 (k-.l) ' k ' — k — k It will be shown in section 5 that selection procedures impose the further requirement b, > 0. (^.2) The purpose of this section is to show that any point in the upper half of the c , b plane (i.e., c > 0) can be mapped onto a point in the region defined by conditions A-.l and k.£. At this point, it is convenient to delineate four areas in the c , b plane and relate each area to properties of the root magnitudes u and V. b 2 1) c, < - k. Both roots are imaginary. h 2 T 2) - k < c < 0. Both roots are real and of the same sign. 3) c > 0, b, < (second quadrant). The roots are real and of opposite sign, with u > v. k) c > 0> b > (first quadrant). The roots are real and of opposite sign, with v > u. It is first shown that any point in the first quadrant of the c, , b plane may be scaled to lie within a triangular wedge such that 1/2 < u < 1. 2 Since v = u + b, and c, = uv, it follows that c, = ub, + u , and the range k k ' k k l/2 < u < 1 is equivalent to 1/2 b k + l/k < c^ < b k + 1 (k.l) 13 21 Multiplying equations 3-1 and k.l by 2 J (j an integer) yields (2 J x) 2 + (2 J b k )(2 J 'x) - 2 2J c k = (If. 3) 2 3 '" 1 (2 d b. ) + 2 2(;j " l) < 2 2j a < 2 J (2 d b. ) + 2 25 (1^) Let 2 J x = x', 2^b k = b', and 2 2j c fc = c' Then (x' ) 2 + b. 1 x' - C = (lj-5) 2 '" 1 b.' + 2 2 ^'" 1 ^ -: C' < 2 D ' b; + 2 2 ^ 0.6) Given cl* and b', the scaling procedure is then a) Determine the value of j, such that equation k.6 is satisfied. -2 i - i b) Multiply c' and b' by 2 d and 2 , respectively, to obtain K. K. c and b, , which satisfy equation k.l. c) When the root u is determined, find the positive root u' of equation k.5> by scaling u in accordance with u 1 = 2 u. Note that the scaling procedure reduces to that normally employed for square roots in floating point computers, when b, = 0. For any point c' b' in the first quadrant, an integer value of j can be found such that equation k.6 is satisfied. It is therefore sufficient, for the first quadrant, to solve equation 3*1 subject to the constraints of equation k-.l, with b, > 0. For the second quadrant, with b, < it is sufficient to replace b, = v - u by b" = -b, = u - v. Equation 3*1 becomes x 2 + b k x - c k = (x-v)(x+u) = 0. (k.7) Solution of ('+.7) yields the magnitude v of the negative root. The value of u is then u = b" + v. k Ik The solution for the case of two imaginary roots has not been considered. Attempts to find a method of solution for two real roots of the same sign have thus far been unsuccessful. The preceding observations, however, indicate that a continued fraction solution of the quadratic can be found if c > 0; i.e., if the two roots are real and are of opposite sign. 15 5. Selection Procedures for the First Quadratic This section develops a selection procedure for p. and q. of the algorithm of equations 3»2 for solving quadratics using continued fractions. We decide to have p. = 1 for all i. Thus the problem reduces to the selection of q. . First, we must choose the set from which to pick q. ; we call this a digit set of q. . We put five requirements on this digit set. a) All elements must be of the form 2 J where j is an integer. b) Let the range of numbers representable as infinite continued fractions using this digit set be [a,b]. We require that this range form a continuum between a and b. c) The range [1/2, 1] should be a subset of the range [a, b]. d) The cardinality of the digit set should be as low as possible. e) It should be possible to develop a selection procedure for our algorithm, with this digit set. The set [1, 2} does not satisfy the requirement (b). The set [1, 1/2} satisfies all requirements except (e). The reason for this is that, with this set, every number representable as an infinite continued fraction, has a unique representation. We will see later in this paper, that a certain amount of redundancy in representation is necessary to satisfy the requirement (e). The set [1, 1/2, 1/k) satisfies all five requirements; so now we focus our attention on this digit set. The requirement (a) is clearly satisfied. It is easily shown that the range [a, b], is approximately [0.39* 1«56] with this digit set. Thus the requirement (c) is satisfied. The requirement (d) is also satisfied. To show that the requirement (b) is satisfied we can proceed as follows. 16 First any number f e[a, b] can be expanded as a continued fraction as follows . Let 1 , = , ■ „ and m general, let 1 q, + f to ' 1 2 1 % + f i + i If a < f . < 1/2 then choose q. = 1. If 1/2 < f . < 1 then choose q. = 1/2. If 1 < f. < b then choose q. = 1/k. — 1 — 1 ' It can easily be verified that with f e[a, b] and using the above rules, f.e[a, b] for all i. Therefore the above rules can be used for all i > 1. We call such a method of expansion a consistent method of expansion. By an expansion of f., to k terms is meant the fraction — , — ...,—. 1 q i q 2 q k Next we use the following theorem, which we state without proof. Theorem 1 : For a number f e[a, b], if there is a consistent method of expansion of f.. in the form of a continued fraction, then such an expansion converges to the value f as the number of terms in the expansion increases, provided that the smallest element in the digit set is greater than [ 5] • Thus every number in [a, b] has an infinite continued fraction expansion with the digit set {1, 1/2, 1/^} and hence the requirement (b) is satisfied. We devote the rest of this section to show that the requirement (e) is satisfied. We restrict the problem to b > 0. C k-i 1 ; be expanded to f . = ■ — - — . -i + u 1 Vi + f i+i Let f . = - 1 \ 17 Given that 0.39 < f . < 1*56, we have to find q. e [1, 1/2, 1/4} such that 0.39 < f. .-i < 1.56. From these, we get, for 0.39 fa .+u) < c, . < 0.72 fa .+u); choose q. ,_ = 1. k-i — k-i — k-i 1+1 for 0.485 fa .+u) < c, . < 1.124- fa .+u); choose q. ,_ = 1/2. k-x — k-i — k-i 7 l+l ' and for 0„553 fa .+u) < c n . < 1*56 fa .+u); choose q. ,_ = 1/4. k-i — k-i — k-i l+l ' The regions where two choices are allowed are, 0.485 fa .+11) < c, . ■: 0oT2 fa .+u) then q. ,. = 1/2 or 1, k-i — k-i — k-i l+l ' and 0.553 fa . +u) < c. . C 1.124 (b ? .+u) then a. = l/k or 1/2. iC — 1 j£-"l K.-1 1+1 Both these are triangular wedges in the (c, . , b, .) plane. We k-i' k-i * will call these the (l/2 & l) and the (1/4 & 1/2) overlap regions, respectively. Clearly these wedges vary with u. To get a selection line which decides between q = 1/2 or 1 and which is u-independent, (since u is unknown) we should first take the intersection of all (l/2 & l) regions as u varies over the range [1/2, 1] and then take a line which is completely within this intersection. A similar statement can be made about the (l/4 & 1/2) region but unfortunately the resulting triangular wedges are not yet wide enough for cur problem. It is clear that if we let u vary over a smaller range, we shall have wider overlap regions. Thus partitioning the u-range into three subranges, namely, I. = [1/2, 5/8), I = [5/8, 3/4) and I = [3/4, 1] works well. It is clear that from the given values of c and b it is simple k k * to determine the subrange for root u with shift, add and comparison operations 18 only. For example, c k - 1/2 b k > 1/1+ and c - 5/8 b fc < 25/61)- => u e I . Now we ask for three selection procedures for these three subranges of u. First we discuss the case of subrange I, = [l/2, 5/8). The (l/2 & l) overlap region is given by, O.i+85 (b. .+5/8) < c. . < 0.72 (b. .+1/2) k-i ' — k-i — k-i ' Similarly, the (l/k & l/2) overlap region is given by, 0.553 (b k-i +5/8) < c k _. < 1.12 (b k _.+l/2). We show these regions on the (c. . , b, .) plane, in figure 5.1. The upper and the lower bounds of the (l/k & l/2) region are labelled A and B respectively, and those for the (l/2 & l) region are labelled C and D. We also show the greatest upper bound c . =1.56 (b .+5/8) as line H and the least lower bound c. . = 0.39 (b, .+1/2) as line L. We also k-i k-i ' draw two selection lines SI and S2, which are c . = h. . + 1/2 and ' k-i k-i ' c „ = 1/2 b . + 5/l6 respectively. Notice that the coefficients in these lines are chosen to be "simple" binary numbers. For any point in the region enclosed by line H and SI we choose q.. , = l/k. For any point between S2 and L, we choose q. _ =1 and otherwise we choose q = l/2. Notice that with these rules our choice could be erroneous in certain regions. Where this happens, we call these regions the forbidden regions. The quadrilateral enclosed by lines H, B, SI and L is the (l/k & 1/2) forbidden region and the quadrilateral enclosed by lines H, S2, C and L is the (l/2 & l) forbidden region. We have to make sure that for no value of i, the point (c, . , b, .) lies in one of these regions. This ' k-1 7 k-i o en i 19 l H in •H 20 we do in appendix I in the proof of convergence. A similar treatment can be given to the other two subranges I and I . For the subrange I , the selection lines SI and S2 are, c . = b. . + 5/8 and c. . = 1/2 b, . + 3/8 ' k-i k-i ' k-i ' k-i ' respectively. For the subrange I,, the selection lines SI and S2 are c . = b . + 3/4 and c . = l/2 b . + l/2 respectively. Although this general selection procedure is valid for all i > 0, we want to use a special procedure for i = so that when we make tests for the subrange determination, we also find q on the basis of the same tests. For 1 = } f. = u. Then from our previous analysis, we have, 0.485 < u < 1.124 then a = l/2 and 0.39 < u < 0.72 then q f 1. Thus we can choose q = 1 for all uel and q = 1/2 for all uel or 1^. ¥e now give the complete algorithm A. A_0: [Check] If b, < o then exit, no solution; otherwise k If (c k -l/2b k ) < 1/4 or If (c k -b k >l) then exit, no solution; A_l: [Subrange] If c - 5/8 b < 25/64 then set q <- 1, Kl 4- 1/2, K2 *-5/l6 and go to step A_2; otherwise set q <- 1/2; If c - 3/4 b < 9/16 then set Kl *- 5/8, K2 *- 3/8 and go to step A_2; otherwise set Kl - 3/4, K2 - 1/2; 21 A_2: [Initialize] Set P <- 0. Q *- P. <- 1, Q n <- q_ ; o o 1 1 1 Set b^ - q lV c k _ x «_ 1 + q x (b k -b k _ ] _); Set i «- 2; A_5: [Selection] If Wi > (b k- i+ i +K1) then set q. *- 1/k and go to step Ajj-; otherwise If c. . , < 1/2 b n . . + K2 then k-i+1 — ' k-i+1 set cl «- 1 and go to step A_^; otherwise set q^ *- 1/2; A_k: [Advance] Set Vi - Vfc-i+1 " Vl C k-i + 2 + Vi + 2> Vi-% (b k-i + l" Vi) +C k-i + 2> P i - % P i-l + P i-2 i «- i + 1; A_5: [Loop Test] If i < i then go to step A_3; A 6: [Finall u (=R00T_ ) «- P./Q., _ L 1 l' l' v <- b. + u; k Note: The value of i will be decided by the machine precision, in case, this algorithm is implemented in hardware. If this algorithm is implemented in software, however, the value of i max will be decided by the allowable error. 22 6. Recent Related Work In the preceding sections, the discovery of the first continued fraction algorithm and its method of application have been described. In this regard, the exposition is historically ordered. The purpose of this section is to describe briefly the results of more recent research. A study of the derivation of the quadratic algorithm of equations 5*2 has indicated that the requirement that p. = 1 for all i is unnecessary [3]» Equations 3*2 then become % Vi 'k-n " p "k-n+1 p ., "k-n+2 ! k-n+2 ^n ^n-l 'k-n ti k-n ' ti k-n+1 p n c, n-1 k-n+2 6.1 Selection rules for the digit sets p.e{l/2, 1} and q. e[l/2, 1} have been determined. In a companion paper[^-], it is shown that the Ricatti equation o y' + ay + by + c = 6.2 leads to relatively simple recursions if the partial numerators p. and partial denominators q. of the associated continued fraction are simple in the binary sense. Since both tan x and e satisfy the Ricatti equation for particular choices of a, b, and c, there is some hope that useful continued fraction algorithms for these functions can be found. Attempts to find selection rules for tan x have thus far been unsuccessful, and have not been attempted for the exponential. The derivation of the recursion relations for the Ricatti equation suggested a similar derivation for the quadratic equation, and led to a second set of recursion relations for the quadratic. The special selection 23 procedure for i = o described in section 5 suffices for selection rules for this second quadratic algorithm. Recursion relations for higher order polynomials can also be found by this method. 2k 7« Conclusions It should be emphasized that the primary purpose of this paper is to point out that hardware construction can be based on representations of numbers other than positional notation. It seems quite clear that the use of continued products yields a useful set of algorithms which can share the same hardware in a feasible and practical manner using current technology. The discussion of continued fractions presented here is a case study of the problems which arise when a different representation of numbers is proposed. The research on the use of continued fractions is incomplete; the results obtained thus far do not justify hardware construction based on continued fractions. It seems appropriate, therefore, to conclude with a list of questions for future research. These include: 1) Can the set of algorithms soluble with continued products be extended? 2) How can the set of algorithms based on the use of continued fractions be extended? Can feasible selection rules for each algorithm be found? 3) What additional representations of numbers exist? What is their potential usefulness? 25 APPENDIX I The Proof of Convergence of Algorithm A To prove convergence, we only need to show that the selection procedure in step A_]> of Algorithm A is a consistent method, and then using theorem 1, we have the required result. To show consistency, first notice that, C k-i f . = r — *-* — and a < f . < b 1 b. . + u — i - k-i for all i. Thus a (t>. . +u) < c. . < b (b. . +u) is always satisfied, and k-i — k-i — k-i ' we are well within the bounds H and L of figure 5*1. We also need to show that for any value of i > 1, the point (c, ., b .) does not fall in any one of the forbidden regions. It is necessary to treat each of the ranges I , I and I, separately. We only treat the range I here, others being similar. We use the following result [ 5] • For all i > o; c . and b . satisfy one equation to the line P. Q, x (b . -b ). The line of closest approach to the forbidden l l k-i Q. . Q. -. k-i k l-l i-I region or alternatively, the left most line is given by P. \ / Q. 11 ' x b. 'k-i Q. , . ft, J. k-i 1-1/ mm \ i-I /mm since b, > o. We wish to show that this line is within the allowed region in figure 5«1« We have, l/k < c, < 'd^/Gh and b = o then with q = 1, the above line K K 1 for i = 1 is c , = 1 - b , l/k < b < 25/6^. This is shown (labelled P) lc— 1 K— A. k— 1 in figure A.l. Next consider i > 3 and i odd. We first get a lower bound on P. q— . We use a theorem [6], which states that odd ordered convergents approach the value of an infinite continued fraction from above (and even ordered convergents approach from below). 26 H < CD !h iaJD •H Thus Now > i odd min uel 27 (u) = 1/2. V2 + . * 1 q l odd / P - \ Thus ^ — > 9/40. \ ' l > 3 odd Thus the left most line (labelled OLM in figure A.l) for odd values of i, is given by e k _. =, 9A0 - 9/20 b k _. . Next consider the case of even values of i > 2. It can be seen P 2 (from figure A.l) that q^ = l/2 for all uel . Then ^— = 1/3- Now again '~P. % using the stated theorem on convergents, | r?- Next observe that, > 1/3. i/i > 2 even 11111 1 _. ., > r . t . t . t . t . . T finite L Q. . J -lt-+l + l + l + l+ +1 1-1/- T7 l even 4 1111 4+1+1+1+ infinite. 4~ 0.640388 28 Thus q7 > 0.2135. i > 2 even Thus the left most line (labelled ELM in figure A.l) is given "by, C. . = 0.2135 - 0.6k b . It is clear from figure A.l that we never K-l k-i transcend into the forbidden regions. Thus we have satisfied the consistency requirement As a matter of practical interest, we mention here that c, . and b. . remain bounded in algorithm A. In particular bounds on c, . are given by < CL . < 3«57 + 1.2 b, . "— 1C-X ™" .K 29 Bibliography [ 1] DeLugish, Bruce G., A Class of Algorithms for Automatic Evaluation of Certain Elementary Functions in a Binary Computer, Ph.D. thesis, University of Illinois, June 1950; also Department of Computer Science Report No. 399- [21 Ercegovac, Milos, Radix 16 Evaluation of Some Elementary Functions, M.S. thesis in preparation at the Department of Computer Science, University of Illinois, Urbana. [3] Bracha, Amnon, private communication. [k] Bracha, Amnon, Application of Continued Fractions for Fast Evaluation of Certain Functions on a Digital Computer. [5] Trivedi, K. S., An Algorithm for the Solution of a Quadratic Equation using Continued Fractions, M.S. thesis in preparation at the Department of Computer Science, University of Illinois, Urbana. [6] Wall, H., Analytic Theory of Continued Fractions, Van Nostrand, New York, 1950. BLIOGRAPHIC DATA IEET Title and Subtitle 1. Report No. UIUCDCS-R-72-51+2 3. Recipient's Accession No. 5. Report Date August 1972 The Status of Investigations into the Use of Continued Fractions for Computer Hardware Date of issue Author(s) James E. Robertson and Kishor Trivedi 8. Performing Organization Rept. No. Performing Organization Name and Address Department of Computer Science University of Illinois Urbana, Illinois 6l801 10. Project/Task/Work Unit No. 11. Contract /Grant No. NSF GJ 813 Sponsoring Organization Name and Address National Science Foundation Washington, D. C. 13. Type of Report & Period Covered Research 14. Supplementary Notes Abstracts The purpose of this paper is to demonstrate that representations of numbers other than positional notation may lead to practical hardware realizations for the digital calculation of classes of algorithms. It is the authors' opinion that practicality of the use of continued products has been demonstrated. This paper describes current research in the use of continued fractions. Although practicality has not been demonstrated, theoretical results are promising, and the results thus far are presented as a case study of the difficulties which arise when use of a new representation is attempted. 1 Key Words and Document Analysis. 17a. Descriptors Continued Products, Continued Fractions, Computer Arithmetic, Hardware, Selection Rules, Radix, Representation of Numbers, Ricatti Equation. 3. Identifiers/Open-Ended Terms e. COSATI Field /Group Availability Statement Unlimited Release RM NTIS-3B ( 10-70) 19. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED 21. No. of Pages J2 22. Price USCOMM-DC 40329-P71 Ss P 4fc e