Hi Racketeers, I'm working on a continued fraction arithmetic package for arbitrary precision arithmetic. I have the basics implemented and functioning and would like to know which features people would like available as an interface, and I'll see if I can provide it.
What you can already expect I will provide: 1) continued fractions as sequences 2) construction of arbitrary continued fractions, rational (finite) or irrational* 3) addition, subtraction, multiplication, division of continued fractions as sequence->sequence procedures; e.g. (cf-times pi pi) -> sequence 4) precision control, via a parameter, to not generate more terms than a given precision** 5) rational functions for sine, cosine, tangent, exp, natural log, rational exponents of rational numbers 6) emission of terms in "simple continued fraction form" i.e. terms are the sequence of denominators, assuming 1 is a numerator 7) emission of terms of an arbitrary base >= 2*** Note: continued fraction arithmetic is compositional but irrational arguments to irrational functions are not compositional without computationally major backtracking, so you can have pi to arbitrary precision and sine functions to arbitrary precision but I do not know how to straightforwardly compute general expressions like sin(pi/3) to arbitrary precision. If there is a way someone can point me to I would love them forever, but my guess is that it is not possible except for preconceived expressions for which one has calculated propagation of error formulas. Also note: computations which take irrational arguments but would yield a rational answer will spin forever, so there is a limit (as a parameter) which forbids such infinite loops and will spit out something. These are the main features I would intend as a single collection. This is my second pass at such a library, made so that it is much faster than its original form I worked on a few years ago. If there is interest I would be happy to re-implement and release features I've used in my first library, like conversion between arbitrary number bases with user-supplied alphabets (fun for finding all the words in the expansion of pi if this suits your fancy). If so, then I'd likely release this as a multi-collection package so this feature is optional. Deren * Truly arbitrary continued fractions will necessarily and unavoidably invalidate precision bounds due the behavior of suddenly-negative terms or zeros which do not occur normally; and, for that matter, the convergence of general continued fractions is an unsolved problem. Those continued fractions or functions which produce continued fractions which will be provided by the library will always be "well-behaved." ** These are currently implemented like "odd streams" in that inner sequences are one-ahead from the main sequence; also, this precision is up to a factor and therefore never worse but likely better than requested *** Since there is no natural separator in a sequence of terms, the integer part is emitted without respecting base; subsequent terms will always be base-n terms. This is definitely negotiable if an adequate representation can be found that doesn't overly complicate their use as sequences. I couldn't think of one, so I didn't try anything for the sake of it. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.