caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David McClain" <dmcclain@azstarnet.com>
To: <caml-list@inria.fr>
Subject: Re: Undefined evaluation order
Date: Fri, 13 Oct 2000 18:42:26 -0700	[thread overview]
Message-ID: <001201c03580$04423df0$210148bf@dylan> (raw)

Dave Berry writes:

> Are you saying that if (a * b) would result in a NaN
>then you always want (a * b * 0.0) to return a NaN, so that you are aware
> of the potential problem?

Yes! That is indeed the case. This is what the IEEE floating point spec
calls for. There are two kinds of Nan's -- signaling and non-signaling. The
signaling ones can potentially raise an exception, while the non-signaling
ones simply represent "Not-A-Number" values. One might use signaling Nan's
to initialize arrays, in some languages (i.e., Fortran) so that one could
catch the use of uninitialized variables...

I don't really distinguish the two in most of my work... Indeed, on the
Alpha architecture, you have to explicitly check for such errors by
inserting trap barrier instructions into the instruction stream. Hence, all
you can know is whether or not an exception has occured since the last time
you checked. The IEEE floating point spec allows for this kind of behavior
in the readily available FPU architectures as well (i.e., Pentium)

Most of my work involves signal and image processing on vast collections of
numbers, frequently in real-time environments. While the numerical analysts
might like to know about Nan signaling to help them write more sophisticated
(mathematical) function evaluators, nearly all of my math routines have to
be quick and not so exacting. In physics and measurement environments we
rarely have more than 3 significant digits in our data. Of course the work
of Prof. William Kahan, UC Berkeley, shows the need to carry many more
significant digits during intermediate calculations, but mathematical
refinement is not generally our concern. As I mentioned previously, if an
anomalous computation occurs in one or a few cases out of the billions that
we stream then we just drop it (them) on the floor and keep running...

- DM





             reply	other threads:[~2000-10-14 12:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-14  1:42 David McClain [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-10-20 14:59 Gerard Huet
2000-10-13 13:56 Dave Berry
2000-10-12 17:06 David McClain
2000-10-12 11:32 Greg Morrisett
2000-10-12  9:53 Dave Berry
2000-10-11 12:22 Greg Morrisett
2000-10-11 20:35 ` Pierre Weis
2000-10-13  7:05   ` Judicael Courant
2000-10-13 14:21     ` Markus Mottl
2000-10-16  8:38       ` Christophe Raffalli
2000-10-16 15:48         ` Brian Rogoff
2000-10-16 16:29           ` Christophe Raffalli
2000-10-17  9:19             ` Ralf Treinen
2000-10-10 19:23 David McClain
2000-10-10 18:55 John R Harrison
2000-10-10 12:46 Greg Morrisett
2000-10-05 18:14 Brian Rogoff
2000-10-06  2:02 ` Ken Wakita
2000-10-06 11:18   ` Pierpaolo BERNARDI
2000-10-07  6:46     ` Ken Wakita
2000-10-08 15:43 ` David Mentré
2000-10-08 22:47   ` Brian Rogoff
2000-10-10 12:47     ` Thorsten Ohl
2000-10-10 20:52       ` Brian Rogoff
2000-10-10 19:26     ` Stefan Monnier
2000-10-09 12:45 ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001201c03580$04423df0$210148bf@dylan' \
    --to=dmcclain@azstarnet.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).