Function philosophy (was Re: fp equality)

uunet!cwi.nl!Dik.Winter uunet!cwi.nl!Dik.Winter
Wed Dec 1 17:31:36 PST 1993


 ... [taking a "a float is a representative of an interval" view] ...
 > So, e.g., cosine(1.0e30) can return anything whatsoever in [-1.0,1.0]?
There are systems that do exactly that.  And I prefer that over systems
that punt in a way that can not be caught, and happily abort the program.
(And, SIG_FPE is not really a solution as that can mean so many things.)

 > So I extended the domain to all finites, doing "as if infinite precision"
 > reduction throughout.
That is indeed the way DEC has gone for its compilers a large number of
years ago.  (Something about it has been published in the SigNum Newsletter,
one of the co-authors was Mary Payne I think.  They describe precisely
how the range reduction is done.)

 >                        I must say I'm very happy with that, and very
 > unhappy with all the alternatives; there's a ~100-cycle penalty for using
 > arguments > 2048*pi, but I figure nobody who knows what they're doing
 > uses such large arguments anyway (&, no, the FCVS tests often don't know
 > what they're doing).
That validation suites do not know what they are doing is well known, but
perhaps that user is just trying to integrate a function like x.sin(1/x)
close to the origin using an off-the-shelf integrator?

 > > I know of one system where (on good mathematical grounds)
 > This is a meaning of "good" with which I was previously unacquainted <wink>.
Lets say argued.  I must stay put, because it was the system designed and
built at my institute back in 1964 (the Electrologica X8 at the (then)
Mathematical Centre, under van Wijngaarden and Dijkstra amongst others),
although I was not there at that time; that came 5 years later.

 > >                                                     And I have heard
 > > numerical analysts complain that sin(1000 * pi) was not zero on their
 > > system.
 > Name 37 <grin>.
Nope, I protect the guilty.

 >                                     I recently saw a Fortran benchmark in
 > which the author expected SIGN, in
 >         DO I = 1, A_VERY_LARGE_INTEGER
 >            SIGN = COS(I*PI)
 >            ...
 > to cycle between -1.0 and 1.0 (exactly) on successive iterations.
I like that one.  There are systems where |cos(x)|<=1.0 is not guaranteed.
Check Cody and Waite, their routine does not guarantee that cos(0.0) = 1.0
or even that cos(0.0) <= 1.0.

 > Etc.  I've heard complaints about these kinds of "failures" too, but at
 > some point people using conventional floating-point arithmetic just have
 > to accept that it's not what they wish it was.  We can't hide it, either,
 > and the grouchier I get in old age, the less willing I am to waste my
 > time trying.
Yup.  And I definitely prefer myself routines that can be seen as black
boxes that think their arguments are exact and do the best possible.

 > btw-agreeing-that-fp-equality-is-useful-but-it's-no-fun-
 >    agreeing<smile>-ly y'rs  - tim
Agreeing twice in a single word?

dik; outlaw disclaimers
--
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland
home: bovenover 215, 1025 jn  amsterdam, nederland; e-mail: dikacwi.nl



More information about the Numeric-interest mailing list