Home     About     Download     Resources     Contact us

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at ocaml.org.

Browse thread
FP Computations
• David McClain
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
 Date: 1999-09-06 (08:26) From: David McClain Subject: FP Computations
```Ohmygosh! I just ran a simple proof checker in Mathematica against the IEEE
FP spec with distinct (+0.0) and (-0.0). Do you realize that subtraction no
longer anti-commutes?

That is, in general there is no way to perform (a -. b) as a correction to
(b -. a). Subtraction almost anti-commutes, except when a = b. In that case
(a -. b) = +0.0, and (b -. a) = +0.0 also!  Hence we cannot expect that
(a -. b) = -. (b -. a).

Also can't use (-0.0) -. (b -. a) since that's exactly the same as direct
negation with FCHS.

Can't use (+0.0) -. (b -. a) since a might be -0.0 and b might be +0.0 in
which case (a -. b) = -0.0 and (b -. a) = (+0.0), and hence (+0.0) -. (b -.
a) = (+0.0) -. (+0.0) = (+0.0).

We're stuck! We MUST evaluate (a -. b) in the order indicated because there
is in general no way to correct the reverse order. Yikes!

- DM

```