• About
  • Advertise
  • Privacy & Policy
  • Contact
Vidianews
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    two-suspects-arrested-for-allegedly-shooting-at-sam-altman’s-house

    Two suspects arrested for allegedly shooting at Sam Altman’s house

    inside-nicole-kidman’s-death-inspired-career-‘expansion’

    Inside Nicole Kidman’s Death-Inspired Career ‘Expansion’

    ‘temptation-island’-star-reveals-the-hardest-part-of-filming-the-show

    ‘Temptation Island’ Star Reveals the Hardest Part of Filming the Show

    lindsie-chrisley’s-boyfriend-bleeds-in-serious-assault.

    Lindsie Chrisley’s boyfriend bleeds in serious assault.

    kylie-jenner-shows-off-her-cleavage-in-a-lace-top-at-coachella

    Kylie Jenner shows off her cleavage in a lace top at Coachella

    crunchyroll’s-2026-awards-lineup-makes-it-clear-the-streaming-giant-isn’t-ready-to-accept-the-future-of-anime

    Crunchyroll’s 2026 awards lineup makes it clear the streaming giant isn’t ready to accept the future of anime

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    pragmata’s-mix-of-hacking-and-action-creates-an-explosive,-multi-layered-type-of-combat-i-didn’t-know-i-needed

    Pragmata’s mix of hacking and action creates an explosive, multi-layered type of combat I didn’t know I needed

    with

    With

    AT&T’s Sneaky Way Is Hiking Old Customers’ Rates This Month

    I ran 30 miles with 5 smart watches. This is the one you can actually trust

    half-of-american-homes-have-pfas-in-their-water.-a-filtered-pitcher-can-help

    Half of American homes have PFAS in their water. A filtered pitcher can help

    apple-reportedly-tested-four-models-of-upcoming-smart-glasses-|-techcrunch

    Apple reportedly tested four models of upcoming smart glasses | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    top-5-off-the-beaten-track-wildlife-experiences-in-latin-america

    Top 5 off-the-beaten-track wildlife experiences in Latin America

    ‘a-significant-assault-on-our-health’:-health-policymakers-condemn-trump’s-proposed-budget-–-medcity-news

    ‘A significant assault on our health’: Health policymakers condemn Trump’s proposed budget – MedCity News

    spring-cleaning-for-the-soul:-7-ways-to-get-rid-of-regrets

    Spring Cleaning for the Soul: 7 Ways to Get Rid of Regrets

    your-nervous-system-needs-a-spring-reset:-here’s-where-to-start

    Your Nervous System Needs a Spring Reset: Here’s Where to Start

    how-to-remove-spaghetti-sauce-from-clothes:-what-actually-works-|-live-better

    How To Remove Spaghetti Sauce From Clothes: What Actually Works | Live Better

    5-spring-activities-for-the-whole-family

    5 spring activities for the whole family

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    youtube-premium-increases-prices-for-the-first-time-since-2023

    YouTube Premium Increases Prices For The First Time Since 2023

    RTL Point Continues to Expand Its Role in the Global Crypto News Ecosystem – Insights Success

    Fidesz MEP László attributes the loss to low turnout of “undecided voters” and “economic stagnation” in the EU

    cnbc-daily-open:-trump-attacks-iran-and-the-pope

    CNBC Daily Open: Trump attacks Iran and the Pope

    trump-calls-pope-leo-‘weak’-and-‘terrible’-after-pontiff’s-criticism-of-iran-war

    Trump calls Pope Leo ‘weak’ and ‘terrible’ after pontiff’s criticism of Iran war

    oil-rises-back-above-$100-as-us-blocks-iranian-ports-after-peace-talks-collapse

    Oil rises back above $100 as US blocks Iranian ports after peace talks collapse

    Trending Tags

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

    Bitcoin: What I Hate, Love and Fear About Cryptocurrency

    iPhone Fold sales set to begin alongside iPhone 18 Pro and iPhone 18 Pro Max amid technical challenges

    Ethereum – What I Hate, Love and Fear About Cryptocurrency

    Dogecoin – What I Hate, Love and Fear About Cryptocurrency

    Binance – What I Hate, Love and Fear About Cryptocurrency Exchange

    iPhone 18 Pro expected to feature smaller dynamic island as Apple tests multiple design options

No Result
View All Result
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    two-suspects-arrested-for-allegedly-shooting-at-sam-altman’s-house

    Two suspects arrested for allegedly shooting at Sam Altman’s house

    inside-nicole-kidman’s-death-inspired-career-‘expansion’

    Inside Nicole Kidman’s Death-Inspired Career ‘Expansion’

    ‘temptation-island’-star-reveals-the-hardest-part-of-filming-the-show

    ‘Temptation Island’ Star Reveals the Hardest Part of Filming the Show

    lindsie-chrisley’s-boyfriend-bleeds-in-serious-assault.

    Lindsie Chrisley’s boyfriend bleeds in serious assault.

    kylie-jenner-shows-off-her-cleavage-in-a-lace-top-at-coachella

    Kylie Jenner shows off her cleavage in a lace top at Coachella

    crunchyroll’s-2026-awards-lineup-makes-it-clear-the-streaming-giant-isn’t-ready-to-accept-the-future-of-anime

    Crunchyroll’s 2026 awards lineup makes it clear the streaming giant isn’t ready to accept the future of anime

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    pragmata’s-mix-of-hacking-and-action-creates-an-explosive,-multi-layered-type-of-combat-i-didn’t-know-i-needed

    Pragmata’s mix of hacking and action creates an explosive, multi-layered type of combat I didn’t know I needed

    with

    With

    AT&T’s Sneaky Way Is Hiking Old Customers’ Rates This Month

    I ran 30 miles with 5 smart watches. This is the one you can actually trust

    half-of-american-homes-have-pfas-in-their-water.-a-filtered-pitcher-can-help

    Half of American homes have PFAS in their water. A filtered pitcher can help

    apple-reportedly-tested-four-models-of-upcoming-smart-glasses-|-techcrunch

    Apple reportedly tested four models of upcoming smart glasses | TechCrunch

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    top-5-off-the-beaten-track-wildlife-experiences-in-latin-america

    Top 5 off-the-beaten-track wildlife experiences in Latin America

    ‘a-significant-assault-on-our-health’:-health-policymakers-condemn-trump’s-proposed-budget-–-medcity-news

    ‘A significant assault on our health’: Health policymakers condemn Trump’s proposed budget – MedCity News

    spring-cleaning-for-the-soul:-7-ways-to-get-rid-of-regrets

    Spring Cleaning for the Soul: 7 Ways to Get Rid of Regrets

    your-nervous-system-needs-a-spring-reset:-here’s-where-to-start

    Your Nervous System Needs a Spring Reset: Here’s Where to Start

    how-to-remove-spaghetti-sauce-from-clothes:-what-actually-works-|-live-better

    How To Remove Spaghetti Sauce From Clothes: What Actually Works | Live Better

    5-spring-activities-for-the-whole-family

    5 spring activities for the whole family

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    youtube-premium-increases-prices-for-the-first-time-since-2023

    YouTube Premium Increases Prices For The First Time Since 2023

    RTL Point Continues to Expand Its Role in the Global Crypto News Ecosystem – Insights Success

    Fidesz MEP László attributes the loss to low turnout of “undecided voters” and “economic stagnation” in the EU

    cnbc-daily-open:-trump-attacks-iran-and-the-pope

    CNBC Daily Open: Trump attacks Iran and the Pope

    trump-calls-pope-leo-‘weak’-and-‘terrible’-after-pontiff’s-criticism-of-iran-war

    Trump calls Pope Leo ‘weak’ and ‘terrible’ after pontiff’s criticism of Iran war

    oil-rises-back-above-$100-as-us-blocks-iranian-ports-after-peace-talks-collapse

    Oil rises back above $100 as US blocks Iranian ports after peace talks collapse

    Trending Tags

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

    Bitcoin: What I Hate, Love and Fear About Cryptocurrency

    iPhone Fold sales set to begin alongside iPhone 18 Pro and iPhone 18 Pro Max amid technical challenges

    Ethereum – What I Hate, Love and Fear About Cryptocurrency

    Dogecoin – What I Hate, Love and Fear About Cryptocurrency

    Binance – What I Hate, Love and Fear About Cryptocurrency Exchange

    iPhone 18 Pro expected to feature smaller dynamic island as Apple tests multiple design options

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
“we-are-on-the-edge-of-a-battlefield”:-reports-bbc-near-the-strait-of-hormuz

“We are on the edge of a battlefield”: reports BBC near the Strait of Hormuz

April 6, 2026
tcl-lost-a-lawsuit-claiming-its-qled-tvs-are-not

TCL lost a lawsuit claiming its QLED TVs are not

March 13, 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
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
advances-in-ai-and-technology-could-soon-make-it-possible-to-talk-with-animals

Advances in AI and technology could soon make it possible to talk with animals

April 13, 2026
person-functionally-cured-of-hiv-after-bone-marrow-transplant-from-a-sibling

Person functionally cured of HIV after bone marrow transplant from a sibling

April 13, 2026
will-the-dream-chaser-space-plane-ever-fly-in-space?

Will the Dream Chaser space plane ever fly in space?

April 13, 2026
running-empty

Running empty

April 13, 2026

Recent News

advances-in-ai-and-technology-could-soon-make-it-possible-to-talk-with-animals

Advances in AI and technology could soon make it possible to talk with animals

April 13, 2026
person-functionally-cured-of-hiv-after-bone-marrow-transplant-from-a-sibling

Person functionally cured of HIV after bone marrow transplant from a sibling

April 13, 2026
will-the-dream-chaser-space-plane-ever-fly-in-space?

Will the Dream Chaser space plane ever fly in space?

April 13, 2026
running-empty

Running empty

April 13, 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

advances-in-ai-and-technology-could-soon-make-it-possible-to-talk-with-animals

Advances in AI and technology could soon make it possible to talk with animals

April 13, 2026
person-functionally-cured-of-hiv-after-bone-marrow-transplant-from-a-sibling

Person functionally cured of HIV after bone marrow transplant from a sibling

April 13, 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