--- slug: fast-inverse-sqrt passed: 2026-11-01 by: the assay line (research/assay-line/claude-1101/), Claude fixer (claude-opus-5-5) directed by claude-assaying-boyle-1014; source record by a Claude agent (claude-sonnet-5-5), checked by a Claude agent (claude-opus-5-5) checked: 96 confirmed: 83 wrong: 8 unverifiable: 1 observed: 4 stale: 0 --- This was the claude-1101 tier B decide-and-fix pass on fast-inverse-sqrt, read at ab36da5554. A Claude agent (claude-sonnet-5-5) wrote the N1 source record; a Claude agent (claude-opus-5-5) checked all 96 claims against their sources (research/assay-line/claude-1101/fast-inverse-sqrt/N2-claude.md), finding 8 WRONG lines (seven distinct errors), 13 MINOR, 1 UNVERIFIABLE and no STALE claim. The fixer decided all 21 triage items in triage.json before touching the page, re-reading the evidence for every WRONG item: it re-ran the layer's verifier, recomputed the error basin with the verifier's own functions, re-fetched both Beyond3D articles, Kadlec's home page in the Wayback Machine and his article, Wikipedia's Fast inverse square root and Logarithm articles, Lomont's 2003 PDF, Moler's 2012 blog reply (Wayback) and fdlibm's e_sqrt.c. All seven errors were fixed on public/strata/fast-inverse-sqrt/index.html with one dated Corrected line (mirrored at the end of the markdown body), and the two MINOR items that share a fixed sentence were fixed with them; the other eleven MINOR items are declined under the tier B rule. MINOR lines are counted with confirmed. The CONFIRMED, UNVERIFIABLE and OBSERVED lines carry the checker's readings forward. The companion film was not re-rendered: it and its poster frame still say "subtracting their logs", and its record caption still credits the Kahan and Ng link to Sommefeldt (held open below; the repair worker found the poster and caption copies). ## Claims - CONFIRMED | [dek-divide-by-length] To draw a 3D world you divide by the length of a vector thousands of times a frame, and every length is a square root, once the slowest arithmetic a chip could do. | https://en.wikipedia.org/wiki/Fast_inverse_square_root | Motivation: "Programs such as Quake III: Arena must perform a large number of these calculations every second". "Thousands of times a frame" and "slowest" are unsourced order-of-magnitude rhetoric, consistent with the source; not a fault. - CONFIRMED | [dek-q3-shipped] In 1999 the code for Quake III Arena shipped with a way around it | https://en.wikipedia.org/wiki/Quake_III_Arena | "Quake III Arena was shipped to retailers on December 2, 1999". - CONFIRMED | [dek-recipe-3p4] land within 3.4% of 1/√x, with no division and no root | research/fast-inverse-sqrt/verify.mjs | Ran at pin: "3.4376% at x=0.9324". My exhaustive float32 scan of [1,4): 3.43758%. - CONFIRMED | [dek-recipe-3p4-lomont] land within 3.4% of 1/√x | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read (tool said UNREADABLE): table row "0x5f3759df 3.43758 3.43756 0.175228 4.66e-004", "maximal relative error percentages", "Each test is over all floating point values". - CONFIRMED | [dek-bits-are-log] the integer you get by relabelling its bits IS approximately log₂x, and halving-and-subtracting a log is exactly how you compute an inverse square root | http://rrrola.wz.cz/inv_sqrt.html | "Aliasing float x as an integer gives a nice approximation of p + q log2 x ... 1.5p − (p + q log2 x) / 2". - CONFIRMED | [dek-newton-3p4-to-0p175] One Newton step then cleans 3.4% down to 0.175%. | research/fast-inverse-sqrt/verify.mjs | Ran: "0.17522%". Exhaustive [1,4): 0.175234%. - CONFIRMED | [dek-newton-lomont] One Newton step then cleans 3.4% down to 0.175%. | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: 1 Iteration column 0.175228. - CONFIRMED | [dek-instrument] drag the magic constant to watch 0x5f3759df settle into the bottom of the error basin | public/strata/fast-inverse-sqrt/index.html | Instrument 3 exists (#cslider, step 2048, #errcv); instruments 1 and 2 run the pipeline and draw I/2^23 − 127 on log₂x. Quake is near, not at, the 1-Newton minimum (0x5f375a86 is 167 above it, below slider resolution); the body says "near the bottom". - CONFIRMED | [dek-carmack-denied] John Carmack didn't write it (he said so) | https://www.beyond3d.com/content/articles/8/ | Carmack e-mail 26 April 2004: "Not me, and I don't think it is Michael. Terje Matheson perhaps?" - CONFIRMED | [dek-trail] the trail runs through Greg Walsh at Ardent, Cleve Moler, and Kahan & Ng at Berkeley | https://en.wikipedia.org/wiki/Fast_inverse_square_root | History: Kahan and Ng 1986; "Cleve Moler at Ardent Computer learned about this technique ... passed it along to his coworker Greg Walsh". - MINOR | [dek-author-unproven] but the exact author is unproven | https://www.beyond3d.com/content/articles/15/ | Part Two: "the real author say hello and own up to it ... Step forward, Greg Walsh"; "we can rightfully name Cleve as the inspiration and Greg as the author". Wikipedia History: "The authorship question was resolved in 2006 when Greg Walsh, the original author, contacted Beyond3D". "Unproven" is defensible (a self-report, no document; Tarolli "may have tweaked the hex constant"), but the page never says Walsh came forward and claimed it, which both sources treat as settling it. Triage K1 (author-unproven-omits-walsh-claim): list, listed, not edited. MINOR stands, decided from the checker's note: 'unproven' is defensible (Walsh's 2006 claim is a self-report and no dated artifact has surfaced) but the page never says Walsh came forward. Loose, not false. Tier B and no WRONG item shares the dek sentence, so listed. - CONFIRMED | [dek-obsolete] the whole trick has been obsolete since chips got an rsqrt instruction | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "Subsequent additions by hardware manufacturers have made this algorithm redundant for the most part. For example, on x86, Intel introduced the SSE instruction rsqrtss in 1999." - CONFIRMED | [dek-13of13] Every figure recomputed live in float32; research/fast-inverse-sqrt/verify.mjs, 13/13 green. | research/fast-inverse-sqrt/verify.mjs | Ran at pin and the published copy: "✓ 13/13 checks green", exit 0; 13 ok lines counted. - OBSERVED | [dek-13of13-log] research/fast-inverse-sqrt/verify.mjs, 13/13 green. | git show e65befa3bb:memory/log.d/2026-07-01T1815Z-fast-inverse-sqrt.md | Log: "13/13 green, reproducing the exact float32 arithmetic"; recreated: node verify.mjs, 13/13. - WRONG | [hdek-fraction-of-percent] read a decimal number's raw bits as if they were an integer, subtract that from one strange hexadecimal constant, read the bits back as a decimal, and - with no division and no square root - you are within a fraction of a percent of 1/√x. | research/fast-inverse-sqrt/verify.mjs | The steps listed end at the seed, whose worst case is 3.4376% (check 4; Lomont 3.43756%), twenty times "a fraction of a percent". Only the Newton step, not mentioned, gives 0.175%. The frontmatter dek says "3.4%" for the same steps. index.html line 159. Triage K2 (seed-called-fraction-of-percent): fix, FIXED. Re-ran research/fast-inverse-sqrt/verify.mjs: 'raw bit-hack seed: max rel err ≈ 3.44% - 3.4376% at x=0.9324' and 'after 1 Newton step: max rel err ≈ 0.175% - 0.17522%'. The page-head sentence lists only the seed steps (read bits, subtract, read back) and then says 'within a fraction of a percent'; the seed is within 3.4%, and only the Newton step, not named, reaches 0.175%. A reader carries away a false figure. Fix: say 3.4% for the seed and name the correction step for 0.175%. - CONFIRMED | [hdek-any-number] Here it is, running on any number you give it | public/strata/fast-inverse-sqrt/index.html | Instrument 1 takes any input; non-positive input gets "Enter a positive number - the hack is defined for positive floats." - CONFIRMED | [hdek-q3-1999] In 1999 the code for Quake III Arena shipped | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "Quake III Arena, a first-person shooter video game, was released in 1999 by id Software and used the algorithm." - CONFIRMED | [film-2m40] Companion film · 2:40. | git show e65befa3bb:public/strata/fast-inverse-sqrt/film.mp4 | ffprobe on the blob at pin: duration 160.000000 s. - OBSERVED | [film-same-code] Every number on screen is recomputed live in float32 from the same code the verifier runs | git show e65befa3bb:research/fast-inverse-sqrt/film/film.html | Header: "THE VERIFIED ALGORITHM - ported byte-for-byte from research/fast-inverse-sqrt/verify.mjs"; the film's fisr() is the verifier's fastInvSqrt() operation for operation (renamed variables), a copy, not an import. Film log agrees. - CONFIRMED | [film-pulse] the soundtrack's pulse is the constant's own 32 bits | research/fast-inverse-sqrt/film/make-audio.mjs | "L2 · THE PULSE ... the 32 bits of 0x5f3759df as the accent schedule, 60 BPM". - CONFIRMED | [film-pipeline-x] the pipeline run bit by bit on x = 0.15625 | git show e65befa3bb:memory/log.d/2026-07-02T0130Z-fast-inverse-sqrt-film.md | "the verifier's worked example x = 0.15625, run live in float32". - MINOR | [q-math-verbatim] The famous fragment, verbatim from q_math.c | https://raw.githubusercontent.com/id-Software/Quake-III-Arena/master/code/game/q_math.c | Between the commented 2nd iteration and "return y;" the file has "#ifndef Q3_VM / #ifdef __linux__ / assert( !isnan(y) ); // bk010122 - FPE? / #endif / #endif"; the page's "verbatim" listing drops them silently (Wikipedia's copy says "stripped of C preprocessor directives"). index.html lines 170-188. Triage K3 (verbatim-listing-drops-preprocessor-lines): list, listed, not edited. MINOR stands from the checker's note: the listing silently omits the #ifndef Q3_VM / assert lines between the 2nd iteration and return. The quoted lines themselves are verbatim. Tier B, listed. - CONFIRMED | [q-math-comments] right down to the two comments that made it legend | https://raw.githubusercontent.com/id-Software/Quake-III-Arena/master/code/game/q_math.c | "// evil floating point bit level hacking" and "// what the fuck?" are in the file. - CONFIRMED | [float-layout] A positive number is stored as x = (1 + m)·2^(E−127): an 8-bit exponent E and a 23-bit fraction m ∈ [0,1). | https://en.wikipedia.org/wiki/Single-precision_floating-point_format | "Exponent width: 8 bits Significand precision: 24 bits (23 explicitly stored)". - CONFIRMED | [float-layout-lomont] Take the 32 bits as an integer and you get exactly I = 2^23·(E + m) | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read, section 2: "x = (−1)^s (1 + M) 2^(E−127)" and "M as a real number is M as an integer divided by 2^23". - MINOR | [gap-0p086] They part company by at most 0.086 | research/fast-inverse-sqrt/verify.mjs | Check 3 prints "max err = 0.08607"; the exact maximum of log₂(1+m) − m is 0.0860713 (at m = 1/ln2 − 1), above the stated bound. index.html line 259. Triage K4 (gap-0p086-rounded-down): list, listed, not edited. MINOR stands: the gap's maximum is 0.08607 (verify.mjs check 3 prints 'max |err| = 0.08607'), so 'at most 0.086' is a rounding slip of precision, not a false fact. Tier B, listed. - MINOR | [gap-0p086-aria] their gap never exceeds 0.086 | research/fast-inverse-sqrt/verify.mjs | Same: the gap reaches 0.08607. index.html line 256 (aria-label). Triage K5 (gap-0p086-rounded-down): list, listed, not edited. Same as K4 (the aria-label copy of the same rounding). Tier B, listed. - WRONG | [napier-mult] Multiplying two numbers became subtracting their logs | https://en.wikipedia.org/wiki/Logarithm | "tables of logarithms allow multiplication and division to be reduced to addition and subtraction"; multiplication becomes ADDING logs. index.html lines 268-269. Triage K6 (napier-multiplying-is-subtracting): fix, FIXED. Re-read Wikipedia 'Logarithm' (raw wikitext, lead): 'tables of logarithms allow multiplication and division to be reduced to addition and subtraction', and section 'Product, quotient, power, and root': 'The logarithm of a product is the sum of the logarithms'. The page says multiplying became subtracting logs, which is false. Fix: multiplying becomes adding logs, and taking a root becomes dividing the log (here halving it), which is what the bit hack does. - CONFIRMED | [napier-1614] Napier's four-hundred-year-old idea | https://en.wikipedia.org/wiki/Logarithm | "Logarithms were introduced by John Napier in 1614"; 412 years. - CONFIRMED | [sigma-0450] you recover σ = 0.0450 | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "σ ≈ 0.0450466"; verify.mjs check 2 prints 0.0450466. - WRONG | [sigma-best-straightens] the single fudge that best straightens log₂(1+m) | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "σ = ... ≈ 0.0430357 yields the optimal approximation (the best in the sense of the uniform norm of the error). However, this value is not used by the algorithm". The page's own verifier centres with σ = 0.043 ("distinct from the constant's σ") and the check list says "0.043 once centred". At σ = 0.0450 the worst gap is 0.0450, at 0.0430 it is 0.0430. index.html lines 271-272. Triage K7 (sigma-0450-called-best-straightening): fix, FIXED. Re-read Wikipedia 'Fast inverse square root' (raw wikitext, section on aliasing as a logarithm): 'σ = ... ≈ 0.0430357 yields the optimal approximation (the best in the sense of the uniform norm of the error). However, this value is not used by the algorithm as it does not take subsequent steps into account.' The page's own verifier prints 'once centred by σ ≈ 0.043 - max |err| = 0.04307' against the constant's σ = 0.0450466. So 0.0450 is not the fudge that best straightens log₂(1+m). Fix: say it is close to, but not, the 0.0430 that does. - CONFIRMED | [sigma-0450-readout] you recover σ = 0.0450 | public/strata/fast-inverse-sqrt/index.html | Live readout: "127 - QUAKE / (1.5 * 8388608)" toFixed(4) = 0.0450. - CONFIRMED | [seed-3p4] The seed is good to about 3.4%. | research/fast-inverse-sqrt/verify.mjs | Check 4: 3.4376%. - CONFIRMED | [newton-form] It is one step of Newton's method on f(y) = 1/y² − x | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read, section 3: "Define f(y) = 1/y² − x ... this simplifies to y_{n+1} = ½ y_n (3 − x y_n²) which corresponds to the line of code x = x*(1.5f-xhalf*x*x)". - CONFIRMED | [newton-second-pass] the second, commented-out pass would take it to 0.0005% | research/fast-inverse-sqrt/verify.mjs | Check 5: 0.000473%. - CONFIRMED | [newton-second-pass-q3] the second, commented-out pass | https://raw.githubusercontent.com/id-Software/Quake-III-Arena/master/code/game/q_math.c | "// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed". - CONFIRMED | [newton-second-lomont] would take it to 0.0005% | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: 2 Iterations column 4.66e-004 (percent). - WRONG | [basin-balloons] Push it a few thousand either way and the error balloons. | research/fast-inverse-sqrt/verify.mjs | Recreated with verify.mjs's own arithmetic, x in [0.25,4], 1 Newton step: 0.17522% at the constant; 0.17710% at −3000, 0.17795% at +3000, 0.17836% at −5000, 0.17995% at +5000 (1 to 3% worse). Raw seed: +2048 to +4096 is BETTER (3.4249% vs 3.4375%). The worst case grows 1.6-fold only at +100,000 and 15-fold at +1,000,000. index.html line 287. Triage K8 (basin-balloons-at-few-thousand): fix, FIXED. Recomputed with verify.mjs's own fastInvSqrt/maxRelErr (x in [0.25,4], 100,001 samples), 1 Newton step: 0.1752% at 0x5f3759df; 0.1771% at -3000, 0.1779% at +3000, 0.1784% at -5000, 0.1800% at +5000; 0.2435% at -100,000, 0.2885% at +100,000; 1.3995% at -1,000,000, 2.6906% at +1,000,000. A few thousand either way moves the worst case by 1 to 3% of itself; 'balloons' is false at that distance. Fix the figures, keep the basin. - CONFIRMED | [lomont-2003] Chris Lomont worked the algebra out in a 2003 paper | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: "First written: Feb 2003". - CONFIRMED | [lomont-search] searched every nearby integer for the one with the smallest worst-case error after a Newton step | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: "testing all constants above and below until the maximal relative error exceeds 0.00176 gives the third constant 0x5f375a86 as the best one". - CONFIRMED | [lomont-search-values] it improves the worst case from 0.17522% to 0.17513% | research/fast-inverse-sqrt/verify.mjs | Check 7: "0.17513% < 0.17522%". Exhaustive [1,4): 0.175129% vs 0.175234%. - CONFIRMED | [lomont-search-values-src] it improves the worst case from 0.17522% to 0.17513% | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: "0x5f375a86 3.43655 3.43652 0.175124 4.65437e-004". - CONFIRMED | [lomont-analytic-raw] 0x5f37642f, is derived to minimise the error of the raw seed | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: r0 from FindMinimum, "the optimal constant becomes R = 0x5f37642f"; table 3.42128 vs 3.43756. - CONFIRMED | [lomont-analytic-falls-behind] But add the Newton step and it falls behind | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: "Yet surprisingly, after one Newton iteration, it has a higher maximal relative error." - CONFIRMED | [lomont-analytic-data] his analytic one does not (on min-max) | research/fast-inverse-sqrt/verify.mjs | Check 7: "0.17759% > 0.17522%". - WRONG | [kadlec-2009] in 2009 Jan Kadlec retuned the constant and the Newton coefficients together, reaching ≈0.065% | http://web.archive.org/web/20100912145506/http://rrrola.wz.cz:80/index.html | Kadlec's own news list: "2010 02 13 To celebrate 0x8000 hits, I have improved the fast inverse square root (updated on 2010-02-27)"; the article footer says "Copyright © 2010 Jan Kadlec"; Wikipedia cites "Kadlec, Jan (2010)". His home page snapshots of 2009 (Wayback 20091124183548) list no such post. ≈0.065% itself is right (6.50197782·10^−4). index.html line 324. Triage K9 (kadlec-dated-2009): fix, FIXED. Re-read Kadlec's own home page in the Wayback snapshot 20100912145506: '2010 02 13 To celebrate 0x8000 hits, I have improved the fast inverse square root (updated on 2010-02-27).' and the article rrrola.wz.cz/inv_sqrt.html footer 'Copyright © 2010 Jan Kadlec'; Wikipedia cites 'Kadlec, Jan (2010)'. The work is 2010, not 2009. ≈0.065% is right (minimax row 6.50197782·10⁻⁴). Fix the year. - CONFIRMED | [best-number] had already landed within a whisker of the best number there is | http://rrrola.wz.cz/inv_sqrt.html | "Chris Lomont studied this hack and found out that the constant 0x5F375A86 minimizes the maximum relative error ... over all normalized floats"; table 1.75233867·10^−3 vs 1.75130156·10^−3. (The record's excerpt "Accuracy has improved almost 2.7-fold" does not bear on this claim.) - CONFIRMED | [rec-carmack-name] The name attached to this function is almost always John Carmack, id Software's lead programmer | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: "written by legendary game programmer John Carmack"; Beyond3D 2004: "Most people say it's your work"; Wikipedia John Carmack: "lead programmer of its 1990s games". - WRONG | [rec-surfaced-2005] because it surfaced when Quake III's source was released under the GPL at QuakeCon in 2005 | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "A discussion of the code appeared on the Chinese developer forum CSDN in 2000, and Usenet and the gamedev.net forum spread the code widely in 2002 and 2003. Speculation arose ... some guessed John Carmack. Quake III's full source code was released at QuakeCon 2005". Lomont, Feb 2003: "It appears in the sourcecode for Quake 3, written by ... John Carmack"; Beyond3D's April 2004 e-mail: "Most people say it's your work". The code and the Carmack attribution were public years before 2005. index.html line 331. Triage K10 (carmack-attribution-dated-to-2005-release): fix, FIXED. Re-read Wikipedia 'Fast inverse square root', History: 'A discussion of the code appeared on the Chinese developer forum CSDN in 2000, and Usenet and the gamedev.net forum spread the code widely in 2002 and 2003. Speculation arose ... some guessed John Carmack.' and Lomont's PDF (Feb 2003), p.1: 'It appears in the sourcecode for Quake 3, written by legendary game programmer John Carmack'. The code and the Carmack attribution were public years before the 2005 GPL release, so 'because it surfaced when ... in 2005' is false. Fix: it circulated from 2000 and was credited to Carmack by 2003, before the 2005 release. - CONFIRMED | [rec-gpl-2005] was released under the GPL at QuakeCon in 2005 | https://en.wikipedia.org/wiki/Id_Tech_3 | "At QuakeCon 2005, John Carmack announced that the id Tech 3 source code would be released under the GNU General Public License ... released on August 19, 2005" (announced there, released days later; Wikipedia FISR says "released at QuakeCon 2005"). - CONFIRMED | [rec-disclaimed] asked directly, he disclaimed it and pointed elsewhere | https://www.beyond3d.com/content/articles/8/ | "Asking John whether it was him or Michael returned a 'not quite'" and the e-mail above. - CONFIRMED | [rec-terje] (by one account suggesting Terje Mathisen, who in turn said it wasn't his either) | https://www.beyond3d.com/content/articles/8/ | Carmack: "Terje Matheson perhaps?"; Mathisen 22 Aug 2005: "The code shown below is not the same as what I wrote". - CONFIRMED | [rec-rys-careful] The most careful tracing is Rys Sommefeldt's, who chased it down for Beyond3D. | https://www.beyond3d.com/content/articles/8/ | Byline "written by Rys", investigation "started in April 2004"; full name from Moler's 2012 comment ("an article by Rys Sommefeldt"). "Most careful" is a judgement. - CONFIRMED | [rec-reached-id] the routine reached id from earlier code | https://www.beyond3d.com/content/articles/15/ | "you can trace 3dfx to id Software via Brian Hook at the very least". - CONFIRMED | [rec-tarolli] a related use runs through Gary Tarolli (SGI, later 3dfx) | https://www.beyond3d.com/content/articles/15/ | "Gary Tarolli, ex SGI, ex 3dfx, now at NVIDIA"; Part One, Tarolli: "I used it a lot". - CONFIRMED | [rec-walsh-ardent] the constant itself appears to trace to Greg Walsh at Ardent Computer in the late 1980s | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "In the late 1980s ... Greg Walsh devised the now-famous constant"; Moler 2012: "Sommefeldt goes back to the late '80s and to me and my colleague Greg Walsh at Ardent Computer". - CONFIRMED | [rec-walsh-moler] who devised it drawing on ideas from Cleve Moler | https://www.beyond3d.com/content/articles/15/ | "It's from working with Cleve that Greg got the initial seed of the idea to write the function." - MINOR | [rec-moler-later-matlab] Cleve Moler (later of MATLAB) | https://en.wikipedia.org/wiki/Cleve_Moler | Moler created MATLAB in the 1970s and co-founded MathWorks in 1984; "Before joining MathWorks full-time in 1989, he also worked for ... Ardent". Beyond3D: "Cleve Moler, MathWorks founder and author of MatLab, at Ardent". MATLAB came before Ardent, not later. index.html line 340. Triage K11 (moler-later-of-matlab): fix, FIXED. MINOR stands from the checker's note (Beyond3D Part Two, re-read: 'Cleve Moler, MathWorks founder and author of MatLab, at Ardent'; MATLAB predates Ardent). It sits in the sentence being fixed for K18, so fix: '(the creator of MATLAB)'. - CONFIRMED | [rec-kahan-ng] unpublished work by William Kahan and K. C. Ng at Berkeley | http://www.netlib.org/fdlibm/e_sqrt.c | "(This is a copy of a drafted paper by Prof W. Kahan and K.C. Ng, written in May, 1986)". Its section B does compute 1/sqrt(x) by bit arithmetic: "k := 0x5fe80000 - (x0>>1); ... y ~ 1/sqrt(x) to 7.8 bits" then "y := y*(1.5-0.5*x*y*y)". The record's note that it is "not 1/sqrt(x)" is mistaken. - CONFIRMED | [rec-moler-kahan] drawing on ideas from ... Kahan and Ng | https://web.archive.org/web/20141227041127/http://blogs.mathworks.com/cleve/2012/06/19/symplectic-spacewar/ | Moler, 27 June 2012: "I actually learned about trick from code written by Velvel Kahan and K.C. Ng at Berkeley around 1986." - CONFIRMED | [rec-best-supported] This is the best-supported account | https://www.beyond3d.com/content/articles/15/ | "we can rightfully name Cleve as the inspiration and Greg as the author". - UNVERIFIABLE | [rec-no-dated-artifact] no dated original artifact showing the exact constant 0x5f3759df has ever surfaced | Read Wikipedia History, both Beyond3D parts, Lomont, Kadlec, Moler 2012, e_sqrt.c, and Peelar's 2021 reverse-engineering of Interstate '76 (https://inbetweennames.net/blog/2021-05-06-i76rsqrt/), the earliest earlier variant Wikipedia names: it uses an exponent constant 0xBFC and a table, not 0x5f3759df. None shows or rules out an original-era artifact. Positive control: the same reading finds the constant's dated appearances (Quake III 1999, CSDN 2000, comp.graphics.algorithms 9 Jan 2002). | A negative claim consistent with every source read. - CONFIRMED | [rec-decades-later] it rests largely on recollections given decades after the fact | https://web.archive.org/web/20141227041127/http://blogs.mathworks.com/cleve/2012/06/19/symplectic-spacewar/ | Moler in 2012 on c.1986 (26 years); Walsh in 2006 on late-1980s work (about 17 to 19 years). The record's excerpt (Tarolli, "over 10 years ago") supports one decade only. - MINOR | [rec-unproven] So the honest statement is that it is folklore refined by several hands, its precise author unproven | https://www.beyond3d.com/content/articles/15/ | As dek-author-unproven: Beyond3D names "Greg as the author" after Walsh came forward; Wikipedia says the question "was resolved in 2006". The page should say Walsh claimed it, then why it calls that unproven. index.html line 345. Triage K12 (author-unproven-omits-walsh-claim): list, listed, not edited. Same as K1: loose, not false (the page itself explains the account rests on recollection and no dated artifact). Its own sentence is not being fixed for a WRONG item, so listed under tier B. - CONFIRMED | [rec-rsqrtss-early-2000s] Since the early 2000s, x86 chips have a dedicated instruction (rsqrtss) | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "Intel introduced the SSE instruction rsqrtss in 1999" (true since 1999; "early 2000s" is loose, not false). - CONFIRMED | [rec-rsqrtss-faster] returns 1/√x faster and more accurately than the bit-hack | https://en.wikipedia.org/wiki/Fast_inverse_square_root | "0.85ns per float compared to 3.54ns ... and had less error"; https://www.felixcloutier.com/x86/rsqrtss bound 1.5·2^−12 (about 0.037%). - OBSERVED | [check-asserted-memory] Nothing here is asserted from memory. | git show e65befa3bb:memory/log.d/2026-07-01T1815Z-fast-inverse-sqrt.md | "Attribution history was researched by a subagent against primary sources (Lomont's 2003 paper read in full; Quake source; corroborated by Wikipedia/MDPI). Beyond3D's articles were 503 during research". So the Beyond3D account was described from secondary sources, which fits the Kahan and Ng misattribution below. - CONFIRMED | [check-roundtrip] the bit reinterpretation round-trips exactly | research/fast-inverse-sqrt/verify.mjs | Check 1 ok. - CONFIRMED | [check-sigma] encoding σ ≈ 0.04505 | research/fast-inverse-sqrt/verify.mjs | Check 2: "σ = 0.0450466". - MINOR | [check-sigma-lomont] σ ≈ 0.04505 - Lomont's value | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: Lomont has no σ and no 0.045; he gives the shipped constant's mantissa as "approximately 0.432430148" and his optimum r0 = 0.4327448899. The σ = 0.0450466 form is Wikipedia's. index.html line 361. Triage K13 (sigma-credited-to-lomont): list, listed, not edited. MINOR stands from the checker's note: Lomont gives the shipped constant's mantissa (0.432430148) rather than a σ, so 'Lomont's value' credits him with a form he did not write; the value itself is right. Tier B, listed. - MINOR | [check-log-tracking] tracks log₂x to within 0.086 raw, 0.043 once centred | research/fast-inverse-sqrt/verify.mjs | Check 3 prints 0.08607 and 0.04307, both above the stated figures; the verifier itself only asserts < 0.087 and < 0.044. index.html line 363. Triage K14 (log-tracking-figures-rounded-down): list, listed, not edited. MINOR stands: verify.mjs prints 0.08607 and 0.04307 against the page's 0.086 and 0.043, a rounding slip. Tier B, listed. - CONFIRMED | [check-errors] raw seed max error 3.4376% → 1 Newton 0.17522% → 2 Newton 0.00047% | research/fast-inverse-sqrt/verify.mjs | Ran: 3.4376%, 0.17522%, 0.000473% (sampled; exhaustive [1,4): 3.43758%, 0.175234%, 0.000475%). - CONFIRMED | [check-errors-lomont] raw seed max error 3.4376% → 1 Newton 0.17522% → 2 Newton 0.00047% | http://www.lomont.org/papers/2003/InvSqrt.pdf | PDF read: 3.43756, 0.175228, 4.66e-004. - MINOR | [check-symbolic] (checked symbolically at sample points) | research/fast-inverse-sqrt/verify.mjs | Check 6 evaluates both formulas numerically in doubles at 5 x 4 points to 1e-12; nothing symbolic. index.html line 367. Triage K15 (numeric-check-called-symbolic): list, listed, not edited. MINOR stands: check 6 is a numerical comparison at sample points, not symbolic; an overstatement of the page's own checking. Tier B, listed. - CONFIRMED | [check-lomont-search-beats] Lomont's search constant beats Quake's; his analytic one does not (on min-max) | research/fast-inverse-sqrt/verify.mjs | Check 7 both ok. - CONFIRMED | [check-periodic] the relative error is periodic over a factor of 4 in x | research/fast-inverse-sqrt/verify.mjs | Check 8: max diff 0.00e+0. - CONFIRMED | [check-periodic-src] the relative error is periodic over a factor of 4 in x | http://rrrola.wz.cz/inv_sqrt.html | "Relative errors wrap around and need to be computed only for the interval [1, 4)." - CONFIRMED | [check-shared-code] The verifier and this page share the same reinterpretation code | public/strata/fast-inverse-sqrt/index.html | The page's f2i/i2f/fisr are the verifier's floatToBits/bitsToFloat/fastInvSqrt operation for operation (comment: "identical to the verifier"); a copy, not a shared file. - CONFIRMED | [domain-positive] the hack is defined for positive, normal floats | http://www.lomont.org/papers/2003/InvSqrt.pdf | Section 3: "Given a floating point value x > 0". (The record's excerpt, section 4.1 "We require this to be positive", is about the result's exponent R1 − 64 − d, not about x.) - MINOR | [domain-bounds] the guarantees above are worst-case bounds over x ∈ [0.25, 4], which by the periodicity property cover all positive normals | research/fast-inverse-sqrt/verify.mjs | maxRelErr samples 400,001 points, so its figures are sampled maxima, not bounds: an exhaustive float32 scan of [1,4) gives 0.175234% after 1 Newton (Kadlec 1.75233867·10^−3, Lomont 0.175228) against the page's 0.17522%; the top two binades reach 0.175245%. index.html line 378. Triage K16 (sampled-maxima-called-bounds): list, listed, not edited. MINOR stands: maxRelErr samples 400,001 points, so the figures are sampled maxima (exhaustive scan 0.175234% vs page 0.17522%); an overstatement of the page's own checking. Tier B, listed. - CONFIRMED | [src-q-math] id Software, Quake III Arena source, code/game/q_math.c (GPL release, QuakeCon 2005) | https://raw.githubusercontent.com/id-Software/Quake-III-Arena/master/code/game/q_math.c | "float Q_rsqrt( float number )" at line 552. - CONFIRMED | [src-lomont] Chris Lomont, "Fast Inverse Square Root", 2003 | http://www.lomont.org/papers/2003/InvSqrt.pdf | Title "FAST INVERSE SQUARE ROOT", "CHRIS LOMONT", "First written: Feb 2003". - MINOR | [src-lomont-table] (3.43756% → 0.175228% → 4.66×10⁻⁴) | http://www.lomont.org/papers/2003/InvSqrt.pdf | The table is in percent ("maximal relative error percentages"), so the third figure is 4.66×10⁻⁴ %, but the page drops the % it gives the first two; read as a fraction it would be 0.0466%, a hundred times the page's 0.0005%. index.html line 390. Triage K17 (lomont-table-unit-dropped): list, listed, not edited. MINOR stands: the third figure lacks the percent sign the first two carry. Precision slip. Tier B, listed. - CONFIRMED | [src-lomont-agree] The error figures on this page were recomputed independently and agree with his. | research/fast-inverse-sqrt/verify.mjs | 3.4376/0.17522/0.000473 vs 3.43756/0.175228/0.000466: agree to 4 or 5 figures for the first two, 2 for the third. - CONFIRMED | [src-sommefeldt] Rys Sommefeldt, "Origin of Quake3's Fast InvSqrt()" (Parts 1 & 2), Beyond3D | https://www.beyond3d.com/content/articles/8/ | Title "Origin of Quake3's Fast InvSqrt()"; Part Two at /content/articles/15/. - WRONG | [src-sommefeldt-trail] Beyond3D - the attribution trail (Carmack's disclaimer → Tarolli → Walsh/Moler → Kahan & Ng) | https://www.beyond3d.com/content/articles/15/ | Neither Beyond3D part mentions Kahan, Ng or Berkeley (0 hits each; positive control: "Tarolli" 4 and 2 hits, "Walsh" and "Moler" 1 hit in Part Two). The Kahan and Ng link is Moler's 2012 comment and e_sqrt.c. The body repeats it: "His reconstruction: ... and, further back, unpublished work by William Kahan and K. C. Ng at Berkeley" (index.html lines 336-341); Sources list line 393. Triage K18 (kahan-ng-attributed-to-sommefeldt): fix, FIXED. Re-fetched both Beyond3D parts (articles/8 and articles/15) and counted words in their text: Kahan 0, 'Ng ' 0, Berkeley 0 in both (positive control: Tarolli 4 and 2, Walsh 1 and Moler 1 in Part Two). The Kahan and Ng link comes from Cleve Moler's 2012 comment on 'Symplectic Spacewar' (Wayback copy read: 'I actually learned about trick from code written by Velvel Kahan and K.C. Ng at Berkeley around 1986') and fdlibm's e_sqrt.c ('a copy of a drafted paper by Prof W. Kahan and K.C. Ng, written in May, 1986'). The page attributes it to Sommefeldt's reconstruction in the body and the Sources list. Fix both: credit Moler's account and add it to the sources. - WRONG | [src-kadlec] Jan Kadlec (2009) | http://web.archive.org/web/20100912145506/http://rrrola.wz.cz:80/index.html | As kadlec-2009: posted 2010-02-13, updated 2010-02-27. index.html line 397. Triage K19 (kadlec-dated-2009): fix, FIXED. Same evidence as K9 (Kadlec's home page news list, Wayback 20100912145506: '2010 02 13 ... I have improved the fast inverse square root'). The Sources list copy of the same error. - CONFIRMED | [src-kadlec-065] the jointly-tuned constant/coefficient variant (≈0.065%) | http://rrrola.wz.cz/inv_sqrt.html | "minimax 0x5F1FFF77 0.703974056 2.38919526 6.50197782·10−4". - CONFIRMED | [rel-benford] Benford's law is about the fractional part of that log - why leading digits skew toward 1 | https://en.wikipedia.org/wiki/Benford%27s_law | "the fractional part of the logarithm of data is typically close to uniformly distributed between 0 and 1; from this, the main claim about the distribution of first digits can be derived". - CONFIRMED | [rel-newton-fixed-point] a fixed-point iteration that would, run to convergence, sit exactly on 1/√x | https://en.wikipedia.org/wiki/Fixed-point_iteration | "we may rewrite the Newton iteration as the fixed-point iteration x_{n+1} = g(x_n)" whose fixed point is a root of f; here g(y) = y(1.5 − 0.5xy²) = y gives y² = 1/x. (The record said no source.) - CONFIRMED | [rel-three-digits] one pass already buys three correct digits | research/fast-inverse-sqrt/verify.mjs | 0.175% worst case is about 2.8 decimal digits; "three" is the usual rounding. - MINOR | (added) read a decimal number's raw bits as if they were an integer, subtract that from one strange hexadecimal constant, read the bits back | https://raw.githubusercontent.com/id-Software/Quake-III-Arena/master/code/game/q_math.c | The code subtracts HALF the integer: "i = 0x5f3759df - ( i >> 1 );". The page-head recipe ("subtract that") and the dek ("subtract from one strange constant") drop the halving, which is the step that makes it an inverse square root. index.html line 157; src/content/strata/fast-inverse-sqrt.md dek. Triage K20 (recipe-drops-halving): fix, FIXED. MINOR stands: q_math.c has 'i = 0x5f3759df - ( i >> 1 );', so the recipe drops the halving. It sits in the page-head sentence being fixed for K2, so fix there ('subtract half of that'); the frontmatter dek's copy ('subtract from one strange constant') is fixed the same way so the two do not disagree. - MINOR | (added) Whoever first chose 0x5f3759df - without the algebra - had already landed within a whisker of the best number there is | http://www.lomont.org/papers/2003/InvSqrt.pdf | How the constant was chosen is unknown: Lomont, section 6: "I would like to find the original author if possible, and see if the method was derived or just guessed and tested"; Tarolli (Beyond3D Part One) remembers "rederiving it" and "simulating different values for the hex constant". "Without the algebra" is stated as fact with no source. index.html line 323. Triage K21 (without-the-algebra-unsourced): list, listed, not edited. MINOR stands from the checker's note: how the constant was first chosen is unknown (Lomont asks whether it was 'derived or just guessed and tested'), so 'without the algebra' is unsupported wording. Its sentence is not being fixed for a WRONG item (K9 is the next sentence), so listed under tier B. - CONFIRMED | (added) 0x5f3759df = 1,597,463,007 | research/fast-inverse-sqrt/verify.mjs | Check 2: "QUAKE constant = 0x5f3759df = 1597463007"; node: 0x5f3759df === 1597463007. - OBSERVED | (added) Measured: with every file this layer ships emptied, it still passes. | recreated: grep verify.mjs for import/readFile/require finds nothing; the published copy run alone in an empty directory prints 13/13 | The verifier reads no file of the layer, so emptying them cannot change it. - CONFIRMED | (added) It is published, and it runs on its own: one file, and Node. | https://artwaste.land/checks/research/fast-inverse-sqrt/verify.mjs | 200, 8570 bytes, byte-identical to the pin; node verify.mjs in an empty directory: 13/13, exit 0. ## Findings - [fixed] hdek-fraction-of-percent (K2): the page head said the bit steps alone put you "within a fraction of a percent" of 1/√x; the seed is within 3.4% (verify.mjs check 4, 3.4376%) and only the Newton step reaches 0.175%. Now says 3.4%, then names the correction step for 0.175%. The same sentence's missing halving (K20, MINOR) fixed with it: "subtract half of that"; the frontmatter dek's copy fixed the same way. - [fixed] napier-mult (K6): "Multiplying two numbers became subtracting their logs" now says adding, and that the inverse square root became halving and negating the log (Wikipedia, Logarithm: "multiplication and division to be reduced to addition and subtraction"). The film still carries the old line; not re-rendered. - [fixed] sigma-best-straightens (K7): σ = 0.0450 was called the fudge that best straightens log₂(1+m); the uniform-norm optimum is σ ≈ 0.0430357, which Wikipedia says the algorithm does not use. Now says the constant's σ is close to, but not, the 0.0430 that does. - [fixed] basin-balloons (K8): "a few thousand either way and the error balloons" replaced by recomputed figures (verify.mjs functions, 1 Newton step, x in [0.25,4]): 0.175% to about 0.18% at a few thousand, 40 to 65% worse at a hundred thousand, eight to fifteen times worse at a million. - [fixed] kadlec-2009 (K9): the body dated Kadlec's jointly tuned variant 2009; his home page news list dates it 2010-02-13 (updated 2010-02-27) and the article says "Copyright © 2010". Now 2010. - [fixed] src-kadlec (K19): the Sources list's copy of the same date, "Jan Kadlec (2009)", now reads 2010, with the article's title. - [fixed] rec-surfaced-2005 (K10): the Carmack attribution was put down to the 2005 GPL source release; the code was discussed on CSDN from 2000 and Lomont's February 2003 paper already credited it to Carmack. Now says so. - [fixed] src-sommefeldt-trail (K18): the Kahan and Ng link was credited to Sommefeldt's Beyond3D reconstruction (body and Sources); neither Beyond3D part names Kahan, Ng or Berkeley. Now credited to Cleve Moler's reply of 27 June 2012 and the May 1986 Kahan and Ng draft in fdlibm's e_sqrt.c, added to the Sources list. The same sentence's "Cleve Moler (later of MATLAB)" (K11, MINOR) fixed with it: "(the creator of MATLAB)". - [open note:29ea66] napier-mult (K6) and src-sommefeldt-trail (K18), film copies: the companion film (research/fast-inverse-sqrt/film/film.html:595, rendered into film.mp4) and its poster frame public/strata/fast-inverse-sqrt/poster.jpg (shown on the page before play) still say "Multiplying two numbers became subtracting their logs"; the film's record caption (film.html:608) still credits "unpublished work by Kahan & Ng" to "Rys Sommefeldt, Beyond3D", which never names them; and its credit card (film.html:493) still says Moler was "later of MATLAB" (K11, MINOR). Film and poster need a re-render; the Corrected line says they still carry the old text. - [declined] dek-author-unproven and rec-unproven (K1, K12): "unproven" is defensible (Walsh's 2006 claim is a self-report, no dated artifact); the page does not say Walsh came forward, which is loose, not false. Tier B, listed. - [declined] q-math-verbatim (K3): the "verbatim" listing omits the #ifndef Q3_VM / assert lines; every line it shows is verbatim. Tier B, listed. - [declined] gap-0p086 and gap-0p086-aria (K4, K5): the gap reaches 0.08607 against the stated 0.086, a rounding slip. Tier B, listed. - [declined] check-sigma-lomont (K13): σ ≈ 0.04505 is right but the σ form is Wikipedia's, not Lomont's. Tier B, listed. - [declined] check-log-tracking (K14): 0.086 and 0.043 against the verifier's 0.08607 and 0.04307, a rounding slip. Tier B, listed. - [declined] check-symbolic (K15): check 6 is numerical at sample points, not symbolic; an overstatement of the page's own check. Tier B, listed. - [declined] domain-bounds (K16): the figures are sampled maxima over 400,001 points, called worst-case bounds; an overstatement of the page's own check. Tier B, listed. - [declined] src-lomont-table (K17): the third table figure lacks its percent sign. Tier B, listed. - [declined] without-the-algebra (K21): how the constant was first chosen is unknown, so "without the algebra" is unsupported wording. Tier B, listed.