Slashdot Mirror


Origin of Quake3's Fast InvSqrt()

geo writes "Beyond3D.com's Ryszard Sommefeldt dons his seersucker hunting jacket and meerschaum pipe to take on his secret identity as graphics code sleuth extraordinaire. In today's thrilling installment, the origins of one of the more famous snippets of graphics code in recent years is under the microscope — Quake3's Fast InvSqrt(), which has been known to cause strong geeks to go wobbly in the knees while contemplating its simple beauty and power." From the article: ""

17 of 402 comments (clear)

  1. A famous quote by ArchieBunker · · Score: 5, Funny

    "English motherfucker, do you speak it?" Anyone care to explain what that function does?

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
    1. Re:A famous quote by Trigun · · Score: 5, Funny

      But faster!

    2. Re:A famous quote by mogrify · · Score: 5, Funny

      (x^(1/2))^2 != 1

      Interesting smiley... is that a dead man with a fraction in his mouth and a prominent Adam's Apple, wearing a bow tie and a dress and standing on a toy race car?

      What's your point, man?

      --
      perl -e 'foreach(values %SIG){$_="IGNORE";}while(){}'
    3. Re:A famous quote by ebyrob · · Score: 3, Funny

      If this doesn't make your head swim:

      int i = *(int*)&x;
      i = 0x5f3759df - (i >> 1);


      Then I'm afraid the whole article is going to be lost on you...

      We've got a floating point being operated on as an integer.
      We've got a mysterious constant.
      We've got a two's complement sign-flip combined with a bit-shift.

      The only thing missing from this party is hookers and beer.

  2. I know who wrote it by circletimessquare · · Score: 4, Funny

    I have a truly marvelous proof of who wrote this code which this comment box is too narrow to contain.

    --
    intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
  3. Re:And so why do we care? by From+A+Far+Away+Land · · Score: 4, Funny

    " Fast InvSqrt(), which has been known to cause strong geeks to go wobbly in the knees "

    I was a little worried when Slashdot posted the Britney Spears beaver pictures, but they now have their credibility back as the home of "News for Nerds".

  4. Obviously SCO's intellectual property! by gukin · · Score: 4, Funny

    Anyone who has ever played a computer game should pay up.

  5. Re:And so why do we care? by Anonymous Coward · · Score: 5, Funny

    Britney Spears beaver pictures Link please.

  6. Old and busted: Duff's device by Stavr0 · · Score: 3, Funny
    New hotness: Fast InvSqrt()

    Naah, just kidding. They both deserve a spot in the Clever Hacks Hall of Fame

  7. Re:And so why do we care? by Pollardito · · Score: 4, Funny
    The pic links are all over - check at foobies.com or similar.

    However, if it really did get posted to /., I'd like a link so I can read the comments...
    i imagine it'd be all sorts of variations of "what's that?", "it might be a tribble", and "it's like a wookie, but smaller"
  8. It Was Obviously... by eno2001 · · Score: 3, Funny

    ...the work of John Romero. Apparently he was going to call it the MakeYouMyBitch() function. ;P

    --
    -"...bad old ideas look confusingly fresh when they are packaged as technology" - Jaron Lanier (Digital Maoism on Edge.o
    1. Re:It Was Obviously... by Chris+Burke · · Score: 4, Funny

      He calls every function that. Have you seen his code? Freaking unreadable.

      int MakeYouMyBitch7 () {
          int my_bitch = MakeYouMyBitch() * MakeYouMyBitch2();
          return MakeYouMyBitch36(my_bitch);
      }

      Just terrible.

      --

      The enemies of Democracy are
  9. Re:This paper seems to have the info by Toasty16 · · Score: 4, Funny

    Ohhhhhh, now I get it... [Looks furtively around to see if anyone knows he doesn't get it]

  10. Re:Poor function name by truedfx · · Score: 3, Funny
    x^(-1/2) != x^(2).
    Er... no. It's entirely possible for x^(-1/2) and x^(2) to be equal. This happens when x=1. (I know what you meant, but what you posted is very different.)
  11. Error! by jrmiller84 · · Score: 3, Funny

    float InvSqrt(float x) { float xhalf = 0.5f*x; int i = *(int*) i = 0x5f3759df - (i >> 1); x = *(float*) x = x*(1.5f - xhalf*x*x); return x; } Asking John whether it was him or Michael returned a "not quite". But it's supposed to return a float!

    --
    I will forever be a student.
  12. Re:And so why do we care? by JabberWokky · · Score: 4, Funny
    Clearly you haven't seen the pictures. It looks much more like a Deltan.

    --
    Evan

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  13. Re:It may in part be related to something I did .. by tknd · · Score: 3, Funny

    (I'm (sorry))

    You don't (happen to (program (lisp))) do you?