Re: Precision problem

2000-07-25 Thread Fergus Henderson
On 25-Jul-2000, Julian Assange <[EMAIL PROTECTED]> wrote: > Fergus Henderson <[EMAIL PROTECTED]> writes: > > > Jon Fairbairn was talking about Haskell. MSVC is a C/C++ compiler, > > not a Haskell compiler. For C and C++, there are many many areas of > > undefined, unspecified, or implementation

Re: Precision problem

2000-07-25 Thread Julian Assange
Fergus Henderson <[EMAIL PROTECTED]> writes: > Jon Fairbairn was talking about Haskell. MSVC is a C/C++ compiler, > not a Haskell compiler. For C and C++, there are many many areas of > undefined, unspecified, or implementation-defined behaviour. If a > C or C++ program gives different behavio

Re: Precision problem

2000-07-24 Thread George Russell
Julian Assange wrote: > Microsoft VCC once (still?) suffers from this problem. Whether > it is because it accesses random, unassigned memory locations > or because the optimiser has time thesholds, is unknown. Optimisers for Intel can produce different results on floating point because floating po

Re: Precision problem

2000-07-23 Thread Fergus Henderson
On 23-Jul-2000, Julian Assange <[EMAIL PROTECTED]> wrote: > Jon Fairbairn <[EMAIL PROTECTED]> writes: > > [George Russell wrote:] > > > Surely this is obvious to Haskell programmers? > > to me, anyway. If two runs (with different flags) of the > > compiler produce programmes that give different r

Re: Precision problem

2000-07-23 Thread Ralf Muschall
Julian Assange <[EMAIL PROTECTED]> writes: > complex-tecture pov-ray picture distributed to a 56 bit IEEE machine > and a 64 bit one. The when the picture elements are stitched back Is this really due to color differences of the order of 10^-17, or rather due to different libc-inherited random n

Re: Precision problem

2000-07-22 Thread Lennart Augustsson
Julian Assange wrote: > [EMAIL PROTECTED] (Carl R. Witty) writes: > > > Fergus that this behavior is undesirable and should be avoided for > > Haskell, unless a flag like "-funsafe-fast-math" is provided. > > > > double inverse(double val) { > > if (val == 0) { > > printf("Oops! divided by

Re: Precision problem

2000-07-22 Thread Julian Assange
[EMAIL PROTECTED] (Carl R. Witty) writes: > Fergus that this behavior is undesirable and should be avoided for > Haskell, unless a flag like "-funsafe-fast-math" is provided. > > double inverse(double val) { > if (val == 0) { > printf("Oops! divided by zero\n"); > abort(); > } else

Re: Precision problem

2000-07-22 Thread Julian Assange
Fergus Henderson <[EMAIL PROTECTED]> writes: > but nevertheless, Haskell or any other language which aims to be > referentially transparent, for any given program execution the sum > should be the same each time in that program execution. While that's theortically nice, I'm not sure that stateme

Re: Precision problem

2000-07-22 Thread Julian Assange
Jon Fairbairn <[EMAIL PROTECTED]> writes: > to me, anyway. If two runs (with different flags) of the > compiler produce programmes that give different results, > then one of them isn't adhering to the standard, (and so > should be noted as such). Microsoft VCC once (still?) suffers from this pr

Re: Precision problem

2000-07-19 Thread Marcin 'Qrczak' Kowalczyk
Tue, 18 Jul 2000 14:48:36 +0200 (MET DST), Wilhelm B. Kloke <[EMAIL PROTECTED]> pisze: > If you mind that this could be exploited to create side-effects, > you have to wrap FP into a monad. Not side effects but "unstable" values. IMHO it would be too pedantic, although theoretically necessary.

Re: Precision problem

2000-07-19 Thread George Russell
Sven Panne wrote: > (As an aside: I *hate* standards which are not freely > available, I've never seen a real IEEE-754 document. A $4000 annual > subscription price for a single person is ridiculous, and I would probably > have slight problems persuade my company to buy the $40.000 enterprise > su

Re: Precision problem

2000-07-18 Thread Julz
> Keith Wansbrough wrote: > > GHC is no different from any other compiler for any other language in > > this respect. Floating-point values are *not* the mathematical `real > > numbers', and should not be treated as such. This is second-year CS > > course material. > One should not have to ad

Re: Precision problem

2000-07-18 Thread Carl R. Witty
Fergus Henderson <[EMAIL PROTECTED]> writes: > Yes, but for any given Haskell program execution, the sum of any two > floating-point values should be the same every time you compute it. > In general it need not be the same as the sum of the equivalent real > numbers, because floating point number

Re: Precision problem

2000-07-18 Thread Fergus Henderson
On 18-Jul-2000, Sven Panne <[EMAIL PROTECTED]> wrote: > > Nevertheless, there seems to be some consensus that optimization should > not change the outcome of a computation. Note that GCC's -O flag *does* > change it, at least if -ffloat-store is not given in addition. The newly > introduced GHC o

Re: Precision problem

2000-07-18 Thread Fergus Henderson
On 18-Jul-2000, Keith Wansbrough <[EMAIL PROTECTED]> wrote: > > IMHO GHC's documentation should clearly warn that programmers should > > not depend on even basic stability and exactness of floating point > > computations, and only stability is provided by -fstrictfp. > > GHC is no different from

Re: Precision problem

2000-07-18 Thread Sven Panne
Hmmm, I've never thought that two simple additions would lead to such a riot... :-) First of all: Even after re-reading the report I can't see that IEEE arithmetic is *required* by it. The representation of floating point values is explicitly stated as "implementation-defined", only the range an

Re: Precision problem

2000-07-18 Thread George Russell
"Wilhelm B. Kloke" wrote: > IMHO you are not right in this. See W. Kahan on the ridiculous Java > restriction in FP reproducibility. We are getting into deep waters here but I think I _am_ right in this case. Kahan's point (I presume you are referring to his excellent (online) paper "How JAVA's Fl

Re: Precision problem

2000-07-18 Thread Wilhelm B. Kloke
In article [EMAIL PROTECTED]>, George Russell <[EMAIL PROTECTED]> wrote: >No, but they ARE, assuming IEEE arithmetic, discrete mathematical >objects with an arithmetic as well defined as that on the integers. >To do constant folding according to different rules is, IMHO, >outrageous. One should

Re: Precision problem

2000-07-18 Thread Jon Fairbairn
> No, but they ARE, assuming IEEE arithmetic, which is what the Report says, isn't it. > discrete mathematical objects with an arithmetic as well > defined as that on the integers. To do constant folding > according to different rules is, IMHO, outrageous. yes > Surely this is obvious to Has

Re: Precision problem

2000-07-18 Thread George Russell
Keith Wansbrough wrote: > GHC is no different from any other compiler for any other language in > this respect. Floating-point values are *not* the mathematical `real > numbers', and should not be treated as such. This is second-year CS > course material. No, but they ARE, assuming IEEE arithmet

Re: Precision problem

2000-07-18 Thread Marcin 'Qrczak' Kowalczyk
Tue, 18 Jul 2000 12:19:32 +0100, Keith Wansbrough <[EMAIL PROTECTED]> pisze: > > IMHO GHC's documentation should clearly warn that programmers should > > not depend on even basic stability and exactness of floating point > > computations, and only stability is provided by -fstrictfp. > > GHC is

Re: Precision problem

2000-07-18 Thread Keith Wansbrough
> IMHO GHC's documentation should clearly warn that programmers should > not depend on even basic stability and exactness of floating point > computations, and only stability is provided by -fstrictfp. GHC is no different from any other compiler for any other language in this respect. Floating

Re: Precision problem

2000-07-17 Thread Marcin 'Qrczak' Kowalczyk
17 Jul 2000 18:24:54 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze: > >* If the -fstrictfp Option is given, *all* calculations (at > > compile time and runtime) are done with the precision/range > > of the type in question. > Wouldn't it be simpler [...] I did not reali

Re: Precision problem

2000-07-17 Thread Marcin 'Qrczak' Kowalczyk
Mon, 17 Jul 2000 19:27:05 +0200, Sven Panne <[EMAIL PROTECTED]> pisze: >* If the -fstrictfp Option is given, *all* calculations (at > compile time and runtime) are done with the precision/range > of the type in question. > >* If the option is not given, you can sometimes have

Re: Precision problem

2000-07-17 Thread Sven Panne
[ Redirected to Haskell list ] Michael Marte wrote: > When adding the three double numbers > 0.7, 0.2, and 0.1, a ghc 4.07-compiled program (compilation flag -O) > yields 0.. Whatever this string stands for, [...] The closest thing the addition of those numbers can give you with