On 1/11/2012 4:06 AM,
nm...@cam.ac.uk wrote:
> In article<gu6Pq.25710$Uj1....@newsfe20.iad>,
> Robert Myers<
rbmye...@gmail.com> wrote:
>>
>> Since computers doing credible numerical analysis are going to spend
>> most of their time waiting for data to arrive from the other side of the
>> universe, perhaps we can find a way to keep exotic CPU's busy while waiting.
>
> There are lots out there, of which this is one.
>
>> Would anyone care to speculate on the possibility of using (recursively
>> computable) continued fractions to do arithmetic with actual real
>> numbers, as opposed to rational approximations to real numbers?
>
> That's a deluded dichotomy - sorry. You need to compare like with
> like. A continued fraction representation has been studied in the
> past, and so has the representation of numbers as lazy functions
> (i.e. where you can call and recall them, asking for as many bits
> as you want). But those are entirely different!
>
Perhaps I misused terminology. It is easy to imagine continued
fractions for which there is no substantially shorter representation
than actually writing the fraction out until you run out of room or
tired to write. For such continued fractions, there is no advantage to
continued fractions over arbitrary precision arithmetic. You get as
much as you pay for by way of precision. No more, and no less.
For some useful continued fractions, a rule would suffice for forward
computation of as many terms of the fraction as you might desire. You
may, in some cases of interest, be able to do computation by
manipulating the rules, rather than by manipulating the continued
fraction itself. In some cases a finite continued fraction
representation of a real number might offer advantages over a rational
approximation, but that is not what I am proposing. I am proposing
manipulating the continued fraction as you would infinite series--where
it is possible to do so, as in the case of exp (i * theta) = cos (theta)
+ i sin (theta).
>> Unless you throw sand in the gears by deliberately introducing
>> pathological real numbers (e.g. ones whose continued fraction
>> representation would involve frequent primality testing), I don't think
>> that computers are likely to produce real numbers that do not have a
>> recursively computable continued fraction representation.
>
> I am too rusty to remember the theory, but am not sure of that,
> though it's probably true.
>
Well, I don't know either.
> Anyway, back to our muttons. The problem is that there are a lot
> of practical calculations where the error of intermediate values
> builds up super-exponentially, but where the final result can be
> reliable. It doesn't matter WHAT form of lazy function you use,
> those calculations are always going to knacker such approaches.
>
> A simple language using lazy evaluation would be very useful for
> some specialist purposes, such as calculating the constants for
> special functions, but I don't see much scope in general.
>
I wasn't proposing anything that I thought actually *useful* in any
general sense. Are denormals useful in any general sense? ;-)
Even though it has clearly occurred to others before, it had not
occurred to me that there was any way to manipulate real numbers (as
opposed to rational approximations to real numbers) on a computer.
Robert.