[Pkg-octave-devel] Unit test bug in octave-signal

Sébastien Villemot sebastien at debian.org
Mon Nov 13 15:26:23 UTC 2017

On Mon, Nov 13, 2017 at 04:04:38PM +0100, Sébastien Villemot wrote:

> This has already been said several times on this list, but it is important to
> remember that it is normal to get slightly different numerical results on i386.
> The reason is that in i386, numerical computations are done with the x87 FPU,
> which internally stores double-floats with extra precision (80-bits), which
> means that when several consecutive mathematical operations are done within FPU
> registers, they do not conform to the IEEE 754 standard for double floats.
> On the contrary, amd64 uses SSE2 registers, which are 64-bit wide, and
> therefore conformant to the IEEE standard.

And I forgot to add that the easy workaround is to add the -ffloat-store option
to gcc. With this option, the result of every floating point operation is
copied back into memory (and read again) before moving to the next operation.
Therefore, every intermediate result gets truncated to 64-bit double float. As
a consequence, one gets exactly the same results as on amd64. But this has an
obvious performance cost (many additional memory read/writes, as many as there
are intermediate results). So one has to ponder carefully before using this option.

⢀⣴⠾⠻⢶⣦⠀  Sébastien Villemot
⣾⠁⢠⠒⠀⣿⡁  Debian Developer
⢿⡄⠘⠷⠚⠋⠀  http://sebastien.villemot.name
⠈⠳⣄⠀⠀⠀⠀  http://www.debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-octave-devel/attachments/20171113/382e5f68/attachment.sig>

More information about the Pkg-octave-devel mailing list