[racket] Possible bug with sine and cosine (simple floating-point issue?)

From: Hugh Myers (hsmyers at gmail.com)
Date: Fri Jan 7 01:14:26 EST 2011

Glad I could add to the discussion. I've been entangled in the world
of floating point for a very long time and as has been mentioned, it
can certainly surprise you, particularly if you don't know the ins and
especially the outs! In the mid 80s I was one of the first to bring
fractals to commercial software and I can tell you that surprise
doesn't even begin to cover the reaction when the beautiful image you
are working on turns to squares and stripes and other obvious
artifacts right before your eyes :) All of us working on 'pretty
pictures' soon learned to build tool kits with integer, floating
point, fixed and extended precision (except by memory) arithmetic
models. Interestingly enough my first such package was infinite
rationals written in MuLisp. Should anyone be interested in such
things and not being happy with existing libraries (there are more
than a few) then I would recommend Knuth's Semi-Numerical Algorithms.
Remember that while Lisp has these built in, sometimes building your
own is the best path to understanding...

On Fri, Jan 7, 2011 at 5:11 AM, prad <prad at towardsfreedom.com> wrote:
> Hugh Myers <hsmyers at gmail.com> writes:
>
>> The classic paper is
>> http://docs.sun.com/source/806-3568/ncg_goldberg.html entitled What
>> every computer programmer/scientist should know about floating
>> point... I've been involved with computer math since math chips were a
>> new idea and came on S100 boards for 8-bit machines--- this paper
>> would have saved me a great deal of frustration had I had it available
>> to me in the long ago...
>>
> this is great stuff hugh! bookmarked and saved!
> i've forgotten most of this, but just dug a couple of books on computer
> organization from the 70s (though neither have things in this detailed
> explanation or proofs!) and am looking forward to going through the
> paper in the future.
>
> --
> in friendship,
> prad
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.