Slashdot Mirror


Where Intel Processors Fail At Math (Again)

rastos1 writes: In a recent blog, software developer Bruce Dawson pointed out some issues with the way the FSIN instruction is described in the "Intel® 64 and IA-32 Architectures Software Developer's Manual," noting that the result of FSIN can be very inaccurate in some cases, if compared to the exact mathematical value of the sine function.

Dawson says, "I was shocked when I discovered this. Both the fsin instruction and Intel's documentation are hugely inaccurate, and the inaccurate documentation has led to poor decisions being made. ... Intel has known for years that these instructions are not as accurate as promised. They are now making updates to their documentation. Updating the instruction is not a realistic option."

Intel processors have had a problem with math in the past, too.

6 of 239 comments (clear)

  1. Exact mathematical value isn't the ideal by i+kan+reed · · Score: 4, Insightful

    The main goal for Floating Point coprocessor sine calculations is to get a good enough result in a set number of cycles.

    Given that fully approximating sine takes about as many concrete operations as bits in the value, getting it exactly right isn't usually a trade off people want to make.

    There's a reason the C standard specifies that mathematical trig functions are platform dependent. If you want it precise, do it yourself to the level of precision you need.

    1. Re:Exact mathematical value isn't the ideal by TWX · · Score: 5, Insightful

      From what I gather, the problem is that Intel didn't acknowledge in documentation how poor the instruction was for scientific use though. This is fine for home and probably most general-purpose business use, but becomes a problem when it's more critical. If those that develop software that relies on sine functionality don't know about this then error in the results of their programs will actually matter.

      This won't matter to a gamer playing some first-person shooter.

      --
      Do not look into laser with remaining eye.
  2. Re:What this mean... by Austerity+Empowers · · Score: 3, Insightful

    I would test that theory first. I have a hunch some GPUs are going to take shortcuts with math that someone like the guy who wrote this article will object to.

  3. Re:What this mean... by rasmusbr · · Score: 4, Insightful

    AMD CPU:s reportedly return exactly the same values as Intel CPU:s. I'm guessing they do so for compatibility reasons, so that any workarounds that software developers have implemented work as expected.

  4. Re:did you even bother looking it up? by Anonymous Coward · · Score: 2, Insightful

    .Net has a native data type called decimal [microsoft.com] that does uses decimal floating point and is accurate to 28 or 29 digits, which makes it a great thing to use when dealing with money. I wish more languages would support something similar.

    They do:
    https://docs.python.org/2/library/decimal.html
    http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic

    Just because your world is limited to .NET it does not mean there aren't other things out there... Did you even bother looking up?

  5. Re: Intel Common Core i7 by iggymanz · · Score: 4, Insightful

    what's the problem, 8 + 5 = 10, absolutely true in base 13