• About
  • Advertise
  • Privacy & Policy
  • Contact
Vidianews
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    bytedance-reportedly-pauses-global-rollout-of-its-new-ai-video-generator

    ByteDance reportedly pauses global rollout of its new AI video generator

    what-kandi-burruss-told-riley-not-to-let-happen-on-‘next-gen:-nyc’

    What Kandi Burruss Told Riley Not to Let Happen on ‘Next Gen: NYC’

    oprah-responds-to-ozempic’s-claims-after-paris-fashion-week

    Oprah responds to Ozempic’s claims after Paris Fashion Week

    oprah-winfrey-applauds-trolls-during-paris-fashion-week-viral-walk

    Oprah Winfrey applauds Trolls during Paris Fashion Week viral walk

    georgia-teen-was-driving-carefully-when-he-killed-his-teacher,-lawyer-says

    Georgia teen was driving carefully when he killed his teacher, lawyer says

    steam-players-have-24-hours-to-claim-and-keep-a-classic-free-game

    Steam players have 24 hours to claim and keep a classic free game

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    nyt-strands-today-–-my-tips-and-answers-for-march-16-(#743)

    NYT Strands today – my tips and answers for March 16 (#743)

    i-tried-chatgpt’s-new-visual-math-explanations-and-now-the-equations-add-up

    I tried ChatGPT’s new visual math explanations and now the equations add up

    Peacock hopes an Andy Cohen avatar will keep you hooked on reality TV

    “marshals”:-​​when-will-episode-3-air-on-paramount-plus?

    “Marshals”: ​​When will episode 3 air on Paramount Plus?

    our-favorite-red-light-hair-growth-device-is-on-sale-now

    Our favorite red light hair growth device is on sale now

    us-military-announces-anduril-contract-worth-up-to-$20-billion-|-techcrunch

    US military announces Anduril contract worth up to $20 billion | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    15-colorful-outfit-ideas-for-women-over-40

    15 Colorful Outfit Ideas for Women Over 40

    encouragement-for-the-mom-who-needs-a-sweet-friend

    Encouragement for the mom who needs a sweet friend

    from-saying-yes-to-everything-to-selective-living-with-kornelija-collins

    From Saying Yes to Everything to Selective Living with Kornelija Collins

    how-to-design-a-guest-bedroom-so-everyone-feels-at-home

    How to design a guest bedroom so everyone feels at home

    15-beautiful-abstract-summer-nail-design-ideas-to-copy

    15 Beautiful Abstract Summer Nail Design Ideas to Copy

    the-anti-route-safari

    The anti-route safari

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    dolly-parton-opens-dollywood’s-41st-season,-promises-more-projects-to-come:-‘i’m-not-almost-done’

    Dolly Parton Opens Dollywood’s 41st Season, Promises More Projects To Come: ‘I’m Not Almost Done’

    spring-break-flyers-warn-of-massive-tsa-lines-as-closure-drains-airport-staff

    Spring Break Flyers Warn Of Massive TSA Lines As Closure Drains Airport Staff

    Iranian strikes and Hezbollah rockets make normal life in Israel ‘simply impossible’

    doj-to-appeal-block-on-fed-subpoenas-in-jerome-powell-criminal-investigation

    DOJ to appeal block on Fed subpoenas in Jerome Powell criminal investigation

    trump-says-iran-ready-to-negotiate-ceasefire,-but-not-ready-to-make-deal

    Trump says Iran ready to negotiate ceasefire, but not ready to make deal

    chess:-the-content-creators-who-are-bringing-the-ancient-game-into-the-digital-age.

    Chess: the content creators who are bringing the ancient game into the digital age.

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Business
  • Politics
  • World
  • Review

    MacBook Neo teardown suggests it could be Apple’s most repairable laptop in several years

    Why I’m bullish on Ether for 2022

    Apple’s foldable model expected to launch as ‘iPhone Ultra’; Leaked price and memory configurations

    Why I’m optimistic about Terra for 2022

    iPhone Fold would feature an iPad-style UI and support split-screen apps

    Why I’m bullish on Polkadot for 2022

No Result
View All Result
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    bytedance-reportedly-pauses-global-rollout-of-its-new-ai-video-generator

    ByteDance reportedly pauses global rollout of its new AI video generator

    what-kandi-burruss-told-riley-not-to-let-happen-on-‘next-gen:-nyc’

    What Kandi Burruss Told Riley Not to Let Happen on ‘Next Gen: NYC’

    oprah-responds-to-ozempic’s-claims-after-paris-fashion-week

    Oprah responds to Ozempic’s claims after Paris Fashion Week

    oprah-winfrey-applauds-trolls-during-paris-fashion-week-viral-walk

    Oprah Winfrey applauds Trolls during Paris Fashion Week viral walk

    georgia-teen-was-driving-carefully-when-he-killed-his-teacher,-lawyer-says

    Georgia teen was driving carefully when he killed his teacher, lawyer says

    steam-players-have-24-hours-to-claim-and-keep-a-classic-free-game

    Steam players have 24 hours to claim and keep a classic free game

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    nyt-strands-today-–-my-tips-and-answers-for-march-16-(#743)

    NYT Strands today – my tips and answers for March 16 (#743)

    i-tried-chatgpt’s-new-visual-math-explanations-and-now-the-equations-add-up

    I tried ChatGPT’s new visual math explanations and now the equations add up

    Peacock hopes an Andy Cohen avatar will keep you hooked on reality TV

    “marshals”:-​​when-will-episode-3-air-on-paramount-plus?

    “Marshals”: ​​When will episode 3 air on Paramount Plus?

    our-favorite-red-light-hair-growth-device-is-on-sale-now

    Our favorite red light hair growth device is on sale now

    us-military-announces-anduril-contract-worth-up-to-$20-billion-|-techcrunch

    US military announces Anduril contract worth up to $20 billion | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    15-colorful-outfit-ideas-for-women-over-40

    15 Colorful Outfit Ideas for Women Over 40

    encouragement-for-the-mom-who-needs-a-sweet-friend

    Encouragement for the mom who needs a sweet friend

    from-saying-yes-to-everything-to-selective-living-with-kornelija-collins

    From Saying Yes to Everything to Selective Living with Kornelija Collins

    how-to-design-a-guest-bedroom-so-everyone-feels-at-home

    How to design a guest bedroom so everyone feels at home

    15-beautiful-abstract-summer-nail-design-ideas-to-copy

    15 Beautiful Abstract Summer Nail Design Ideas to Copy

    the-anti-route-safari

    The anti-route safari

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    dolly-parton-opens-dollywood’s-41st-season,-promises-more-projects-to-come:-‘i’m-not-almost-done’

    Dolly Parton Opens Dollywood’s 41st Season, Promises More Projects To Come: ‘I’m Not Almost Done’

    spring-break-flyers-warn-of-massive-tsa-lines-as-closure-drains-airport-staff

    Spring Break Flyers Warn Of Massive TSA Lines As Closure Drains Airport Staff

    Iranian strikes and Hezbollah rockets make normal life in Israel ‘simply impossible’

    doj-to-appeal-block-on-fed-subpoenas-in-jerome-powell-criminal-investigation

    DOJ to appeal block on Fed subpoenas in Jerome Powell criminal investigation

    trump-says-iran-ready-to-negotiate-ceasefire,-but-not-ready-to-make-deal

    Trump says Iran ready to negotiate ceasefire, but not ready to make deal

    chess:-the-content-creators-who-are-bringing-the-ancient-game-into-the-digital-age.

    Chess: the content creators who are bringing the ancient game into the digital age.

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Business
  • Politics
  • World
  • Review

    MacBook Neo teardown suggests it could be Apple’s most repairable laptop in several years

    Why I’m bullish on Ether for 2022

    Apple’s foldable model expected to launch as ‘iPhone Ultra’; Leaked price and memory configurations

    Why I’m optimistic about Terra for 2022

    iPhone Fold would feature an iPad-style UI and support split-screen apps

    Why I’m bullish on Polkadot for 2022

No Result
View All Result
Vidianews
No Result
View All Result
Home General

The mathematical mystery of legendary 90s shooter Quake 3

Julie Bort by Julie Bort
February 16, 2026
in General, World
0
the-mathematical-mystery-of-legendary-90s-shooter-quake-3

The mathematical mystery of legendary 90s shooter Quake 3

0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

Game developers didn’t have it easy in the 1990s. Because they had extremely limited computing power, they had to write their code as efficiently as possible. Take the first-person shooter Quake III Arena, usually called Quake 3, for example: players were navigating a three-dimensional world, so programmers had to find the smartest ways to handle 3D graphics and associated calculations.

Quake 3 was released in 1999 and is considered one of the best computer games of its time. This had a lasting impact on the industry. This legacy wasn’t so much due to the story, but rather the fact that Quake 3 was one of the first multiplayer first-person shooters. Players could connect their computers via network cables or the Internet to compete in real time.

The game code also left a mark. It included an extremely efficient algorithm that still amazes experts and arouses the curiosity of scientists.


On supporting science journalism

If you enjoy this article, please consider supporting our award-winning journalism by subscribe. By purchasing a subscription, you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


A strange code

To mathematically determine the orientations of objects, characters, or other players in three-dimensional space, you create a vector, which is essentially an arrow that indicates direction. To compare vectors, they need to be normalized to the same length, so you need to scale them accordingly. And that’s where a tricky calculation comes in: the inverse square root, which is one divided by the square root of a number.

If I asked you to calculate the inverse square root of 26 without a calculator, you’d probably be stuck for a while – and honestly, so would I. In the 1990s, computers faced the same challenge. Even if they could analyze the numbers, the process required a lot of processing power, which could mean the calculation took a long time. One problem was the square root itself; another was division. That’s why Quake 3 programmers looked for a better way to find this inverse square root. And in fact, their source code revealed an ingenious solution.

What’s fascinating is that the developers never announced their trick. If Quake 3’s source code hadn’t become open source, their method might have remained hidden forever. But as soon as it was released, curious enthusiasts took notice. When they discovered the code snippet for calculating the inverse square root, they were baffled: it was difficult to follow, and the developer comments that came with it weren’t particularly helpful. But little by little, people understood how the code worked.

There is today many tutorials which guide you step by step through the program code. These walkthroughs exploit special features of the C programming language. For example, numbers are stored in computer locations called memory addresses, which are then manipulated. This is a clever way to avoid computationally intensive operations like division. “Think of it like putting the wrong label on something in the store and it convinces the employee, but here it’s C, we’re fools,” explained computer scientist Daniel Harrington of the University of Toronto in a presentation.

From a mathematical point of view, the code is easily explained. To determine the inverse square root, you must first guess the solution (which is usually incorrect) and then refine that guess through a defined procedure. In this way, we gradually arrive at better solutions.

None of this is revolutionary or new. What’s impressive, however, is that it typically takes four to five iterations of the process before the result is close enough to an actual solution. This process requires a lot of computing power. In Quake 3, the seed, i.e. the estimated number used in the first step of the process, has been chosen so intelligently that only one optimization step is necessary.

Looking for a magic number

The optimization steps correspond using the so-called Newton-Raphson methodwhich approximates the values ​​at which a function produces an output of 0, or the root of functions, over many iterations. This may seem counterintuitive at first, since we want to calculate the inverse square root and not just any zero. But programmers employ a trick: they define the function to be approximated as the difference between the initial estimated value and the actual result. Thanks to the Newton-Raphson method, the error gradually becomes reduced, making it possible to get ever closer to the exact solution.

To think about it, imagine that you want to calculate the inverse square root of 2.5. The algorithm starts with a certain assumption: let’s say 3.1. To determine the difference from the actual solution, you square the initial value and divide one by the result. If 3.1 were really the inverse square root of 2.5, then 1 divided by 3.1 squared would be 2.5. The actual result is 0.1. The difference is therefore 2.4.

The Newton-Raphson method reduces this gap with each iteration to gradually get closer to the exact value. Generally, four to five of these steps are necessary to achieve a reliable result. Still, Quake 3 drastically reduced iterations.

The key lies in how the starting value of Newton’s steps is calculated. The method’s algorithm essentially works in three steps:

  1. Take the given number whose inverse square root is to be calculated and convert it to a corresponding memory address (a location in the computer’s stored data).

  2. This value is divided by two and subtracted from the hexadecimal value 0x5f3759df. This is the starting value of Newton’s method.

  3. Next, perform a Newton step.

Particularly mysterious is the enigmatic string 0x5f3759df, which has since gone down in computing history as the “magic number.” This is why only one iteration is required to obtain an approximate inverse square root solution that produces an error of no more than 0.175 percent.

As soon as the program’s code was made available as open source, experts wondered about the origin of this magic number. In a technical article published in 2003, computer scientist Chris Lomont wrote: “Where does this value come from and why does the code work?”

The hexadecimal number 0x5f3759df corresponds to 1,597,463,007 in decimal notation. By breaking down the different steps of the program code, Lomont realized that he could obtain 1,597,463,007 through some calculations. To simplify this calculation, here is a way of representing the calculation involved:

Three halves times two to the power of 23 times open bracket 127 minus 0.0450465 closed bracket

Values 3⁄2223 and 127 come from the conversion of numerical representations in C. But the origin of 0.0450465 is less obvious.

Lomont studied mathematically which value gives an optimal result for different inputs. In other words: which starting value best approximates the inverse square root and should therefore lead to the smallest error? It arrived at a value of 1,597,465,647, or approximately:

Three halves times two to the power of 23 times open bracket 127 minus 0.04483 closed bracket

This matches the values ​​found in the Quake 3 source code. The result is quite close to the values ​​found here.

When Lomont compared his results with those of the original, he was surprised. In two steps of the Newton-Raphson method, its calculated constant actually worked better: the maximum possible error was smaller than with the original code value. “And yet, surprisingly, after one Newton iteration, the maximum relative error is higher,” Lomont writes. “Which again begs the question: how was the constant in the original code derived?”

In his calculation, the computer scientist only considered which number would theoretically give the best possible value, neglecting the number of Newton steps. In search of a better constant, Lomont repeated his calculation and optimized it to obtain the best possible solution for a single Newton step. It arrived at a value of 1,597,463,174, or approximately:

Three halves times two to the power of 23 times open bracket 127 minus 0.045033 closed bracket

When he put this to a practical test, it actually performed slightly better than the magic number in Quake 3’s code.

Lomont noted in his paper that since both constants are approximations, either is a good option in practice. He added that he hoped to meet the original author of the constant to find out how he derived the magic number.

Online communities have embarked on a never-ending search for this mysterious person. Special effort has been devoted to this effort Rys Sommefeldt, computer scientistwho first contacted John Carmack, the lead developer of Quake 3. Carmack was unsure who coded this snippet and could only offer guesses.

Sommefeldt contacted some of the most prominent developers of the 1990s, who each suggested other possible authors without claiming authorship. It now appears that Greg Walsh, who worked for computer maker Ardent Computer in the late 1980s, introduced the magic number into the inverse square root algorithm. He then found his way into the Quake 3 algorithm via several other individuals. But exactly how the magic number was determined remains unclear to this day.

This is not a particularly satisfying conclusion. Nonetheless, the story of Quake 3’s code – or at least the part that revolves around the inverse square root – is extremely fascinating. It’s amazing how much effort and intelligence went into efficient software programming back then – a trend that is often overlooked today due to today’s computing power.

This article was originally published in spectrum of science and has been reproduced with permission.

Related

Julie Bort

Julie Bort

Stay Connected

  • 99 Subscribers
  • Trending
  • Comments
  • Latest
european-markets-in-mixed-territory-after-a-positive-start

European markets in mixed territory after a positive start

January 26, 2026
nascar-driver-denny-hamlin-breaks-silence-after-father-dies-in-house-fire

NASCAR driver Denny Hamlin breaks silence after father dies in house fire

December 31, 2025
fivio-foreign-checks-himself-into-a-$10,000-rehab-center-to-get-his-mind-straight

Fivio Foreign checks himself into a $10,000 rehab center to get his mind straight

December 31, 2025
tcl-lost-a-lawsuit-claiming-its-qled-tvs-are-not

TCL lost a lawsuit claiming its QLED TVs are not

March 13, 2026
hansmaker-presents-the-d1-ultra:-a-dual-laser-engraver-designed-for-each-material-–-techenger

Hansmaker presents the D1 Ultra: a dual laser engraver designed for each material – Techenger

0
nascar-driver-denny-hamlin-breaks-silence-after-father-dies-in-house-fire

NASCAR driver Denny Hamlin breaks silence after father dies in house fire

0
fivio-foreign-checks-himself-into-a-$10,000-rehab-center-to-get-his-mind-straight

Fivio Foreign checks himself into a $10,000 rehab center to get his mind straight

0
david-beckham-leaves-brooklyn-for-his-2025-instagram-tribute-amid-family-feud

David Beckham leaves Brooklyn for his 2025 Instagram tribute amid family feud

0
2026-ncaa-tournament-projections:-florida-still-no.-1-seed?-miami-(oh)-in-or-out?

2026 NCAA Tournament Projections: Florida Still No. 1 Seed? Miami (OH) in or out?

March 15, 2026
dolly-parton-opens-dollywood’s-41st-season,-promises-more-projects-to-come:-‘i’m-not-almost-done’

Dolly Parton Opens Dollywood’s 41st Season, Promises More Projects To Come: ‘I’m Not Almost Done’

March 15, 2026
scientists-revive-brain-activity-in-frozen-mice-for-the-first-time

Scientists revive brain activity in frozen mice for the first time

March 15, 2026
spaceflight-enhances-the-ability-of-viruses-to-infect-bacteria

Spaceflight enhances the ability of viruses to infect bacteria

March 15, 2026

Recent News

2026-ncaa-tournament-projections:-florida-still-no.-1-seed?-miami-(oh)-in-or-out?

2026 NCAA Tournament Projections: Florida Still No. 1 Seed? Miami (OH) in or out?

March 15, 2026
dolly-parton-opens-dollywood’s-41st-season,-promises-more-projects-to-come:-‘i’m-not-almost-done’

Dolly Parton Opens Dollywood’s 41st Season, Promises More Projects To Come: ‘I’m Not Almost Done’

March 15, 2026
scientists-revive-brain-activity-in-frozen-mice-for-the-first-time

Scientists revive brain activity in frozen mice for the first time

March 15, 2026
spaceflight-enhances-the-ability-of-viruses-to-infect-bacteria

Spaceflight enhances the ability of viruses to infect bacteria

March 15, 2026
Vidianews

Trusted news coverage delivering accurate reporting, breaking headlines, and insightful analysis on global events, business, politics, and tech.

Follow Us

Browse by Category

  • Business
  • Entertainment
  • Faith
  • Gadget
  • Gaming
  • General
  • Health
  • Lifestyle
  • Movie
  • News
  • Politics
  • Review
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

2026-ncaa-tournament-projections:-florida-still-no.-1-seed?-miami-(oh)-in-or-out?

2026 NCAA Tournament Projections: Florida Still No. 1 Seed? Miami (OH) in or out?

March 15, 2026
dolly-parton-opens-dollywood’s-41st-season,-promises-more-projects-to-come:-‘i’m-not-almost-done’

Dolly Parton Opens Dollywood’s 41st Season, Promises More Projects To Come: ‘I’m Not Almost Done’

March 15, 2026
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© © Copyrights 2026 Vidianews. All Rights Reserved. Designed by Vidianews

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In

Add New Playlist

No Result
View All Result

© © Copyrights 2026 Vidianews. All Rights Reserved. Designed by Vidianews

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
Go to mobile version