back to article Intel 'underestimates error bounds by 1.3 QUINTILLION'

Sharp-eyed and mathematically-savvy coder and blogger Bruce Dawson has spotted something interesting: the fsin instruction in x86/x64 chippery can produce a “worst-case error [of] 1.37 quintillion units in the last place”. That's not helpful because Intel's documentation suggests far smaller errors are the norm. And because a …

  1. jake Silver badge

    A couple dozen in a quintillion ...

    ... is unlikely to affect me & mine.

    That said, shame on Intel. That's an 'orrible documentation error.

    1. JeffyPoooh
      Pint

      Missed opportunity

      We should've gone with π = 3.2 back when we had the chance.

  2. EddieD

    Transcendental Instruction Accuracy

    Why do I get a vision of some OCD guru?

  3. Neil Barnes Silver badge
    Boffin

    Ulp!

    Planes don't fall out of the sky - but you might miss Mars...

    1. ElReg!comments!Pierre

      Re: Ulp!

      > you might miss Mars

      If you did not have a way to correct trajectory as you get closer, true. But that would make you more vulnerable to a fly's fart on the launchpad than to this error...

    2. Rol Silver badge

      Re: Ulp!

      My carpenter mate is adamant that 22/7 is pi, which while I would happily trust him to knock up a decent spiral staircase, I shudder to think what he would have made of the Millennium Dome

      1. Natalie Gritpants Silver badge

        Re: Ulp!

        Well, it would have been made of wood since he is a carpenter. No problem adjusting wood to fit. Might have been more useful too.

        1. Trigonoceps occipitalis Silver badge

          Re: Ulp!

          You could also wait for a change in the weather when the wood would change shape.

      2. ElReg!comments!Pierre

        Re: Ulp!

        > I shudder to think what he would have made of the Millennium Dome

        indeed!

        http://cjoint.com/14oc/DJkl4hLHRQI_millennium.jpg

      3. Dan Paul

        Re: Ulp! (In a way he's right)

        22 divided by 7 is 3.142857.

        Pi is 3.14159 for all practical purposes. Both numbers round to 3.142 or 3.143 when you consider what the significant digits become.

        7 times 3.14159 equals 21.99114858

        That's close enough for carpentry, masonry, sheet metal layout, horseshoes and hand grenades.

        The error from using that useful fractional version of Pi would hardly be noticeable unless you were using a diameter of several miles.

  4. Anonymous Coward
    Anonymous Coward

    Isn't this obvious?

    Whatever the documentation says, you wouldn't really expect an accurate result for sin(1e99), would you? (By "1e99" I mean a binary floating-point approximation of 1e99.)

    1. Primus Secundus Tertius

      Re: Isn't this obvious?

      You would not and I would not, but then I think of some of the people I worked with...

      Back in the days of hand reckoning or electromechanical machines, numerical analysis was seriously taught. Nowadays it is brute electronic force and ignorance.

    2. livefree

      Re: Isn't this obvious?

      Yes, but even that is an order of magnitude less than a googol.

    3. Michael Wojcik Silver badge

      Re: Isn't this obvious?

      you wouldn't really expect an accurate result for sin(1e99), would you?

      There's no reason why that input can't be range-reduced.

      In any case, the problem is that Intel's fsin is inaccurate for values close to π. That's a bit more of an issue. Try reading Dawson's post.

  5. Natalie Gritpants Silver badge

    God, keep me from harm and working on FPUs

    The problem lies in guys like me having to make transistors give you an answer in a small amount of time and guys like him expecting results regardless of how long it would take. Intel have now sensibly fixed the documentation to explain what really happens.

    Intel's PI is 66 bits and Bruce is asking for sin(0.0000001) where the number of zeroes is about 80 bits. Not suprisingly the answer is correct to 0.000001 (65 bits of zero) but huge relative to 0.00001(80 bits of zero)

    1. ElReg!comments!Pierre

      Re: God, keep me from harm and working on FPUs

      You're being a bit unfair there. He's just complaining that Intel oversold the precision. He did not seem so upset about the precision itself, but about the fact that if you rely on the doc you'll assume that your result is more accurate than it actually is, and thus rely on it instead of doing things another way.

      I bet he's perfectly happy with Intel's response of fixing the doc to fit the code.

    2. Roo
      Windows

      Re: God, keep me from harm and working on FPUs

      "The problem lies in guys like me having to make transistors give you an answer in a small amount of time and guys like him expecting results regardless of how long it would take."

      No, the problem here is the quality of Intel's documentation.

      In the 80s at least one chip vendor managed to come up with formal specs for floating point instructions and then prove that the hardware meets them so no one gets any unpleasant surprises. By contrast Intel's published documentation has a habit of specifying complex behavior using ambiguous waffle, so it's hardly a surprise that the hardware fails to match expectations of software developers.

      1. phil dude
        Boffin

        Re: God, keep me from harm and working on FPUs

        And this is the reason why benchmarks like LINPACK have become very important - mathematically consistent for a system.

        Anyone out there know if the microcode that gets loaded can fix this?

        P.

    3. Brewster's Angle Grinder Silver badge

      Re: God, keep me from harm and working on FPUs

      And if your read the post, fsin et al are not worth the transistors; every library is using their own version. For those of us doing sums using a large number of sins given to us by mathematicians with no idea of the limits of practical hardware, these things matter.

  6. Anonymous Coward
    Anonymous Coward

    I noticed this years ago and thought it was intentional...

    ...so as to identify when people had ripped the FPU technology. This is can seen when comparing integer against float methods for drawing circles, the intel trig functions produce a stepped rather than smooth edge to the circle at certain angles and zoom

  7. Ugotta B. Kiddingme

    obligatory

    We are Pentium of Borg. Division is futile. You will be approximated.

    1. John Smith 19 Gold badge
      Thumb Up

      Re: obligatory

      "We are Pentium of Borg. Division is futile. You will be approximated."

      Neat.

      1. Philip Hodges

        Re: obligatory

        No, just neatish.

  8. HildyJ Silver badge

    This is what happens when "scientists" reject the bible which clearly says that pi = 3.

    http://www.nmsr.org/alabama.htm#original

  9. John Savard Silver badge

    How Can This Be?

    With a function like the sine, a conventional implementation which is very accurate for values between plus and minus pi/2 (plus and minus 90 degrees) can still go wrong if you try to take the sine of a very big number.

    While the sine of a big number still has a mathematically exact value, usually errors in that case don't matter, because floating-point numbers have limited precision, and usually their accuracy is not greater than their precision. So if you try to take the sine of 3.52 times 10 to the 52nd power, the entire range of the sine function can be produced by just changing stuff beyond the least significant bit.

    Using a copy of pi to an enormous precision allows such cases to be taken care of accurately, but that's a waste of time for the normal purposes to which trig functions are put.

  10. khbkhb

    News?

    Very old news. Solved long ago in "fdlibm" see http://www.validlab.com/arg.pdf for a write-up of the algorithm. Earlier versions of the same paper appeared in "SunProgrammer" RIP

  11. PeterM42
    Mushroom

    It very much sounds like the sort of error.....

    .....that might make someone believe in "global warming" (or is that cooling?)

    Could be either, Call it "climate change" and invent a scam called "carbon trading".

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2021