Using a lookup-table to correct an approximation
Summary
The article discusses converting enum-to-string mappings in C using a switch, then shows a compiler-optimized approach using a static array, and memory-layout optimizations including a concatenated string with an offsets table. It introduces a trick: replace a large offsets table with a linear approximation x*17 plus a small corrections table to reduce space while preserving correctness; and notes this is a general pattern of combining a fast but approximate computation with a correction table.