• About
  • Advertise
  • Privacy & Policy
  • Contact
Vidianews
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    apple’s-next-event-is-scheduled-for-march-4

    Apple’s next event is scheduled for March 4

    bravo’s-west-wilson-shares-a-new-perspective-on-finding-love

    Bravo’s West Wilson Shares a New Perspective on Finding Love

    cynthia-erivo-responds-to-speculation-about-‘lovers’-with-ariana-grande

    Cynthia Erivo responds to speculation about ‘lovers’ with Ariana Grande

    nancy-guthrie-kidnapping-may-have-been-botched-burglary:-report

    Nancy Guthrie kidnapping may have been botched burglary: report

    nate-diaz-hopes-for-ufc-return,-wants-white-house-card

    Nate Diaz hopes for UFC return, wants White House card

    dark-winds-season-4,-episode-1-ending-explained:-who’s-hunting-billie

    Dark Winds Season 4, Episode 1 Ending Explained: Who’s Hunting Billie

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    4-of-the-best-herman-miller-office-chairs-we-have

    4 of the best Herman Miller office chairs we have

    so-many-discord-users-are-flocking-to-this-alternative-platform,-it

    So many Discord users are flocking to this alternative platform, it

    What is Skimo? Everything you need to know about the new 2026 Winter Olympic sport

    Rivian drivers will soon be able to adjust their electric vehicle’s interior from an Apple Watch

    i-tried-the-mattress-currently-at-the-olympic-training-center-in-colorado-springs

    I tried the mattress currently at the Olympic training center in Colorado Springs

    as-ai-data-centers-reach-their-power-limits,-peak-xv-supports-indian-startup-c2i-to-solve-the-bottleneck-|-techcrunch

    As AI data centers reach their power limits, Peak XV supports Indian startup C2i to solve the bottleneck | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    25-safe-summer-outfit-ideas-you-can-replicate-in-3-minutes

    25 Safe Summer Outfit Ideas You Can Replicate in 3 Minutes

    are-small-groups-or-sunday-schools-better?

    Are Small Groups or Sunday Schools Better?

    why-creativity-seems-so-hard-and-how-to-make-it-easy-again

    Why Creativity Seems So Hard and How to Make It Easy Again

    30-tips-to-keep-your-kitchen-fresh

    30 Tips To Keep Your Kitchen Fresh

    15-stunning-gothic-summer-outfits-for-plus-size-women

    15 Stunning Gothic Summer Outfits for Plus Size Women

    7-bible-verses-to-include-in-your-grandchild’s-valentine’s-day

    7 Bible Verses to Include in Your Grandchild’s Valentine’s Day

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    wendy’s-to-close-hundreds-of-restaurants-as-company-seeks-to-focus-on-value-to-increase-sales

    Wendy’s To Close Hundreds Of Restaurants As Company Seeks To Focus On Value To Increase Sales

    award-winning-pilot-and-wife-die-in-plane-crash-after-dirty-windows-cause-emergency-landing,-pet-dog-survives

    Award-Winning Pilot And Wife Die In Plane Crash After Dirty Windows Cause Emergency Landing, Pet Dog Survives

    Leaders gather for AI summit in New Delhi as warnings mount over societal risks

    here’s-how-much-2026-winter-olympics-athletes-will-receive-for-winning-medals

    Here’s how much 2026 Winter Olympics athletes will receive for winning medals

    ‘it’s-never-too-late’:-savannah-guthrie-shares-new-plea-on-instagram

    ‘It’s never too late’: Savannah Guthrie shares new plea on Instagram

    nancy-guthrie:-fbi-analyzes-recovered-glove-that-appears-to-match-those-worn-in-guthrie-suspect’s-video

    Nancy Guthrie: FBI analyzes recovered glove that appears to match those worn in Guthrie suspect’s video

    Trending Tags

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

    Elon Musk can now make an even smarter offer

    iPhone 17e Roundup: Launch Date, Expected Price in India, Specs, Features and More

    iPhone 18 Pro, iPhone 18 Pro Max will feature A20 Pro chip, smaller dynamic island and more: report

    This LinkedIn job offer does not exist

    iPhone 18 Pro expected to support 5G satellite connectivity with Apple’s C2 modem

    Apple Arcade’s March update brings Oceanhorn 3: Legend of the Shadow Sea and other titles

No Result
View All Result
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    apple’s-next-event-is-scheduled-for-march-4

    Apple’s next event is scheduled for March 4

    bravo’s-west-wilson-shares-a-new-perspective-on-finding-love

    Bravo’s West Wilson Shares a New Perspective on Finding Love

    cynthia-erivo-responds-to-speculation-about-‘lovers’-with-ariana-grande

    Cynthia Erivo responds to speculation about ‘lovers’ with Ariana Grande

    nancy-guthrie-kidnapping-may-have-been-botched-burglary:-report

    Nancy Guthrie kidnapping may have been botched burglary: report

    nate-diaz-hopes-for-ufc-return,-wants-white-house-card

    Nate Diaz hopes for UFC return, wants White House card

    dark-winds-season-4,-episode-1-ending-explained:-who’s-hunting-billie

    Dark Winds Season 4, Episode 1 Ending Explained: Who’s Hunting Billie

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    4-of-the-best-herman-miller-office-chairs-we-have

    4 of the best Herman Miller office chairs we have

    so-many-discord-users-are-flocking-to-this-alternative-platform,-it

    So many Discord users are flocking to this alternative platform, it

    What is Skimo? Everything you need to know about the new 2026 Winter Olympic sport

    Rivian drivers will soon be able to adjust their electric vehicle’s interior from an Apple Watch

    i-tried-the-mattress-currently-at-the-olympic-training-center-in-colorado-springs

    I tried the mattress currently at the Olympic training center in Colorado Springs

    as-ai-data-centers-reach-their-power-limits,-peak-xv-supports-indian-startup-c2i-to-solve-the-bottleneck-|-techcrunch

    As AI data centers reach their power limits, Peak XV supports Indian startup C2i to solve the bottleneck | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    25-safe-summer-outfit-ideas-you-can-replicate-in-3-minutes

    25 Safe Summer Outfit Ideas You Can Replicate in 3 Minutes

    are-small-groups-or-sunday-schools-better?

    Are Small Groups or Sunday Schools Better?

    why-creativity-seems-so-hard-and-how-to-make-it-easy-again

    Why Creativity Seems So Hard and How to Make It Easy Again

    30-tips-to-keep-your-kitchen-fresh

    30 Tips To Keep Your Kitchen Fresh

    15-stunning-gothic-summer-outfits-for-plus-size-women

    15 Stunning Gothic Summer Outfits for Plus Size Women

    7-bible-verses-to-include-in-your-grandchild’s-valentine’s-day

    7 Bible Verses to Include in Your Grandchild’s Valentine’s Day

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    wendy’s-to-close-hundreds-of-restaurants-as-company-seeks-to-focus-on-value-to-increase-sales

    Wendy’s To Close Hundreds Of Restaurants As Company Seeks To Focus On Value To Increase Sales

    award-winning-pilot-and-wife-die-in-plane-crash-after-dirty-windows-cause-emergency-landing,-pet-dog-survives

    Award-Winning Pilot And Wife Die In Plane Crash After Dirty Windows Cause Emergency Landing, Pet Dog Survives

    Leaders gather for AI summit in New Delhi as warnings mount over societal risks

    here’s-how-much-2026-winter-olympics-athletes-will-receive-for-winning-medals

    Here’s how much 2026 Winter Olympics athletes will receive for winning medals

    ‘it’s-never-too-late’:-savannah-guthrie-shares-new-plea-on-instagram

    ‘It’s never too late’: Savannah Guthrie shares new plea on Instagram

    nancy-guthrie:-fbi-analyzes-recovered-glove-that-appears-to-match-those-worn-in-guthrie-suspect’s-video

    Nancy Guthrie: FBI analyzes recovered glove that appears to match those worn in Guthrie suspect’s video

    Trending Tags

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

    Elon Musk can now make an even smarter offer

    iPhone 17e Roundup: Launch Date, Expected Price in India, Specs, Features and More

    iPhone 18 Pro, iPhone 18 Pro Max will feature A20 Pro chip, smaller dynamic island and more: report

    This LinkedIn job offer does not exist

    iPhone 18 Pro expected to support 5G satellite connectivity with Apple’s C2 modem

    Apple Arcade’s March update brings Oceanhorn 3: Legend of the Shadow Sea and other titles

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
the-best-warhammer-game-i-have

The best Warhammer game I have

January 21, 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
ice-shames-america

ICE shames America

February 16, 2026
wendy’s-to-close-hundreds-of-restaurants-as-company-seeks-to-focus-on-value-to-increase-sales

Wendy’s To Close Hundreds Of Restaurants As Company Seeks To Focus On Value To Increase Sales

February 16, 2026
the-mathematical-mystery-of-legendary-90s-shooter-quake-3

The mathematical mystery of legendary 90s shooter Quake 3

February 16, 2026
astronomers-spot-one-of-the-largest-rotating-structures-in-the-universe

Astronomers spot one of the largest rotating structures in the universe

February 16, 2026

Recent News

ice-shames-america

ICE shames America

February 16, 2026
wendy’s-to-close-hundreds-of-restaurants-as-company-seeks-to-focus-on-value-to-increase-sales

Wendy’s To Close Hundreds Of Restaurants As Company Seeks To Focus On Value To Increase Sales

February 16, 2026
the-mathematical-mystery-of-legendary-90s-shooter-quake-3

The mathematical mystery of legendary 90s shooter Quake 3

February 16, 2026
astronomers-spot-one-of-the-largest-rotating-structures-in-the-universe

Astronomers spot one of the largest rotating structures in the universe

February 16, 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

ice-shames-america

ICE shames America

February 16, 2026
wendy’s-to-close-hundreds-of-restaurants-as-company-seeks-to-focus-on-value-to-increase-sales

Wendy’s To Close Hundreds Of Restaurants As Company Seeks To Focus On Value To Increase Sales

February 16, 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