[Haskell-cafe] strictness and the simple continued fraction
Simon Peyton-Jones
simonpj at microsoft.com
Tue Oct 12 03:48:27 EDT 2004
If you are interested in arbitrary precision arithmetic using continued
fractions, you may want to check out the work of David Lester. And
Peter Potts et al. Just type "exact real arithmetic" into Google.
Simon
| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of
| William Lee Irwin III
| Sent: 12 October 2004 04:53
| To: Scott Turner
| Cc: haskell-cafe at haskell.org
| Subject: Re: [Haskell-cafe] strictness and the simple continued
fraction
|
| On Mon, Oct 11, 2004 at 09:53:16PM -0400, Scott Turner wrote:
| > I tried using continued fractions in a "spiffy lazy list"
implementation a
| > while ago. Never got them working as well as expected.
| > Evenutally I realized that calculating with lazy lists is not as
| > smooth as you might expect.
| > For example, the square root of 2 has a simple representation
| > as a lazy continued fraction, but if you multiply the square root of
2 by
| > itself, your result lazy list will never get anywhere. The
calculation will
| > keep trying to determine whether or not the result is less than 2,
this being
| > necessary to find the first number in the representation. But every
finite
| > prefix of the square root of 2 leaves uncertainty both below and
above, so
| > the determination will never be made.
| > Your problems may have some other basis, but I hope this helps.
|
| I hit that one, too. That's nasty enough it may be best to give up on
| the infinite case, at least. I can't think of a way to salvage all
this.
|
|
| -- wli
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list