• About
  • Advertise
  • Privacy & Policy
  • Contact
Vidianews
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    studies-indicate-that-the-biggest-critics-of-ai-are-those-who-use-it-the-most

    Studies Indicate That The Biggest Critics Of AI Are Those Who Use It The Most

    from-adam-driver-to-daisy-ridley:-where-are-these-‘star-wars’-stars-now?

    From Adam Driver to Daisy Ridley: Where are these ‘Star Wars’ stars now?

    olivia-wilde-insists-she’s-‘not-dead’-after-viral-comparison-to-a-‘corpse’

    Olivia Wilde insists she’s ‘not dead’ after viral comparison to a ‘corpse’

    olivia-wilde-says-she’s-not-dead-after-shocking-red-carpet-interview

    Olivia Wilde says she’s not dead after shocking red carpet interview

    jeremy-allen-white-takes-the-kids-for-a-ride-at-the-los-angeles-area-fair

    Jeremy Allen White takes the kids for a ride at the Los Angeles Area Fair

    ask.com-has-closed-its-doors,-marking-an-official-farewell-to-the-internet’s-favorite-butler

    Ask.com has closed its doors, marking an official farewell to the Internet’s favorite butler

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    i

    I

    quordle-today-–-my-advice-and-answers-for-may-4-(#1561)

    Quordle today – my advice and answers for May 4 (#1561)

    ‘marshals’-release-schedule:-when-episode-10-comes-to-paramount-plus

    ‘Marshals’ Release Schedule: When Episode 10 Comes to Paramount Plus

    tips,-answers-and-help-from-today’s-nyt-wordle-for-may-4-#1780-–-cnet

    Tips, answers and help from today’s NYT Wordle for May 4 #1780 – CNET

    this-little-magnetic-e-reader-could-stop-you-from-doomscrolling

    This little magnetic e-reader could stop you from doomscrolling

    i

    I

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    arm-&-hammer-odorbusterz-smell-killer-balls-review:-a-simple-solution-that-actually-works-–-social-lifestyle-magazine

    Arm & Hammer OdorBusterz® Smell Killer Balls Review: A Simple Solution That Actually Works – Social Lifestyle Magazine

    forget-the-5-am.-club:-here’s-what-successful-women-actually-do-in-the-morning

    Forget the 5 a.m. club: Here’s what successful women actually do in the morning

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

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

    how-one-family-is-redefining-the-safari-experience-in-st-lucia,-south-africa

    How one family is redefining the safari experience in St Lucia, South Africa

    3-ways-to-overcome-anxious-thoughts

    3 Ways to Overcome Anxious Thoughts

    18-spring-salads-that-nourish-your-inner-glow

    18 Spring Salads That Nourish Your Inner Glow

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    united-flight-carrying-221-passengers-hits-pole-and-truck-on-approach-to-newark

    United Flight Carrying 221 Passengers Hits Pole And Truck On Approach To Newark

    Nifty’s 2 pillars now face structural headwinds: Ravi Dharamshi

    J.

    mamdani-thanks-same-billionaire-he-targeted-in-tax-video-for-nypd-money

    Mamdani Thanks Same Billionaire He Targeted In Tax Video For NYPD Money

    ‘An Unforgettable Show’: Fans Gather for Free Shakira Concert on Rio’s Copacabana Beach

    upcoming-global-week:-is-“selling-in-may”-just-a-myth?

    Upcoming Global Week: Is “Selling in May” Just a Myth?

    Trending Tags

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

    What makes Christmas themed movies so popular all over the world?

    Intel ‘Wildcat Lake’ CPU Appears in Benchmark Database, Could Compete with A18 Pro Chip in MacBook Neo

    21 Tech Trends, Tips, and Things to Watch for in 2021

    Apple’s future iPhone models could arrive without MagSafe despite ecosystem growth, tipster claims

    WhatsApp delays new privacy policy, but still shares data with Facebook

    How to Prepare Your MacBook for Sale or Trade-In: A Step-by-Step Guide

No Result
View All Result
  • Home
  • Entertainment
    • All
    • Gaming
    • Movie
    studies-indicate-that-the-biggest-critics-of-ai-are-those-who-use-it-the-most

    Studies Indicate That The Biggest Critics Of AI Are Those Who Use It The Most

    from-adam-driver-to-daisy-ridley:-where-are-these-‘star-wars’-stars-now?

    From Adam Driver to Daisy Ridley: Where are these ‘Star Wars’ stars now?

    olivia-wilde-insists-she’s-‘not-dead’-after-viral-comparison-to-a-‘corpse’

    Olivia Wilde insists she’s ‘not dead’ after viral comparison to a ‘corpse’

    olivia-wilde-says-she’s-not-dead-after-shocking-red-carpet-interview

    Olivia Wilde says she’s not dead after shocking red carpet interview

    jeremy-allen-white-takes-the-kids-for-a-ride-at-the-los-angeles-area-fair

    Jeremy Allen White takes the kids for a ride at the Los Angeles Area Fair

    ask.com-has-closed-its-doors,-marking-an-official-farewell-to-the-internet’s-favorite-butler

    Ask.com has closed its doors, marking an official farewell to the Internet’s favorite butler

  • Sports
  • Tech
    • All
    • Gadget
    • Startup
    i

    I

    quordle-today-–-my-advice-and-answers-for-may-4-(#1561)

    Quordle today – my advice and answers for May 4 (#1561)

    ‘marshals’-release-schedule:-when-episode-10-comes-to-paramount-plus

    ‘Marshals’ Release Schedule: When Episode 10 Comes to Paramount Plus

    tips,-answers-and-help-from-today’s-nyt-wordle-for-may-4-#1780-–-cnet

    Tips, answers and help from today’s NYT Wordle for May 4 #1780 – CNET

    this-little-magnetic-e-reader-could-stop-you-from-doomscrolling

    This little magnetic e-reader could stop you from doomscrolling

    i

    I

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Lifestyle
    • All
    • Faith
    • Health
    • Travel
    arm-&-hammer-odorbusterz-smell-killer-balls-review:-a-simple-solution-that-actually-works-–-social-lifestyle-magazine

    Arm & Hammer OdorBusterz® Smell Killer Balls Review: A Simple Solution That Actually Works – Social Lifestyle Magazine

    forget-the-5-am.-club:-here’s-what-successful-women-actually-do-in-the-morning

    Forget the 5 a.m. club: Here’s what successful women actually do in the morning

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

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

    how-one-family-is-redefining-the-safari-experience-in-st-lucia,-south-africa

    How one family is redefining the safari experience in St Lucia, South Africa

    3-ways-to-overcome-anxious-thoughts

    3 Ways to Overcome Anxious Thoughts

    18-spring-salads-that-nourish-your-inner-glow

    18 Spring Salads That Nourish Your Inner Glow

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • News
    • All
    • Business
    • Science
    united-flight-carrying-221-passengers-hits-pole-and-truck-on-approach-to-newark

    United Flight Carrying 221 Passengers Hits Pole And Truck On Approach To Newark

    Nifty’s 2 pillars now face structural headwinds: Ravi Dharamshi

    J.

    mamdani-thanks-same-billionaire-he-targeted-in-tax-video-for-nypd-money

    Mamdani Thanks Same Billionaire He Targeted In Tax Video For NYPD Money

    ‘An Unforgettable Show’: Fans Gather for Free Shakira Concert on Rio’s Copacabana Beach

    upcoming-global-week:-is-“selling-in-may”-just-a-myth?

    Upcoming Global Week: Is “Selling in May” Just a Myth?

    Trending Tags

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

    What makes Christmas themed movies so popular all over the world?

    Intel ‘Wildcat Lake’ CPU Appears in Benchmark Database, Could Compete with A18 Pro Chip in MacBook Neo

    21 Tech Trends, Tips, and Things to Watch for in 2021

    Apple’s future iPhone models could arrive without MagSafe despite ecosystem growth, tipster claims

    WhatsApp delays new privacy policy, but still shares data with Facebook

    How to Prepare Your MacBook for Sale or Trade-In: A Step-by-Step Guide

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
daniel-duggan:-australian-citizen-and-former-us-navy-pilot-loses-extradition-appeal

Daniel Duggan: Australian citizen and former US Navy pilot loses extradition appeal

April 16, 2026
12-sweet-feminine-aesthetic-outfits-for-the-summer-season

12 Sweet Feminine Aesthetic Outfits for the Summer Season

March 13, 2026

Apple Watch Series 12 may relaunch a throwback feature, but no redesign

April 10, 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
arm-&-hammer-odorbusterz-smell-killer-balls-review:-a-simple-solution-that-actually-works-–-social-lifestyle-magazine

Arm & Hammer OdorBusterz® Smell Killer Balls Review: A Simple Solution That Actually Works – Social Lifestyle Magazine

May 4, 2026
forget-the-5-am.-club:-here’s-what-successful-women-actually-do-in-the-morning

Forget the 5 a.m. club: Here’s what successful women actually do in the morning

May 4, 2026
united-flight-carrying-221-passengers-hits-pole-and-truck-on-approach-to-newark

United Flight Carrying 221 Passengers Hits Pole And Truck On Approach To Newark

May 4, 2026
how-to-remove-butter-from-clothes:-what-actually-works-|-live-better

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

May 4, 2026

Recent News

arm-&-hammer-odorbusterz-smell-killer-balls-review:-a-simple-solution-that-actually-works-–-social-lifestyle-magazine

Arm & Hammer OdorBusterz® Smell Killer Balls Review: A Simple Solution That Actually Works – Social Lifestyle Magazine

May 4, 2026
forget-the-5-am.-club:-here’s-what-successful-women-actually-do-in-the-morning

Forget the 5 a.m. club: Here’s what successful women actually do in the morning

May 4, 2026
united-flight-carrying-221-passengers-hits-pole-and-truck-on-approach-to-newark

United Flight Carrying 221 Passengers Hits Pole And Truck On Approach To Newark

May 4, 2026
how-to-remove-butter-from-clothes:-what-actually-works-|-live-better

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

May 4, 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

arm-&-hammer-odorbusterz-smell-killer-balls-review:-a-simple-solution-that-actually-works-–-social-lifestyle-magazine

Arm & Hammer OdorBusterz® Smell Killer Balls Review: A Simple Solution That Actually Works – Social Lifestyle Magazine

May 4, 2026
forget-the-5-am.-club:-here’s-what-successful-women-actually-do-in-the-morning

Forget the 5 a.m. club: Here’s what successful women actually do in the morning

May 4, 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