4 ms·
Yes. In theory, any pure function can be turned into a lookup table. And any lookup table that isn't just random numbers can be turned into a more compact alg
by retrac 3y ago
Yes. In theory, any pure function can be turned into a lookup table. And any lookup table that isn't just random numbers can be turned into a more compact algorithm that spends compute to save space.
Such tables may be infeasible, though. While a int8 -> int8 table only needs 256 bytes, an int32 -> int32 needs 16 gigabytes.
- DaiPlusPlus 3y agoFractal functions are pure, but don’t lend themselves well to memoization nor lookup tables.
- meindnoch 3y agoWhat does this statement even mean? Every function from a finite domain is just a lookup table, period.
- DaiPlusPlus 3y agoWho said anything about finite-domains?
- deleted 3y ago[deleted]
- meindnoch 3y agoEvery function has finite domain on a computer.
- DaiPlusPlus 3y agoArbitrary-precision real-number libraries would disagree with you there.
- meindnoch 3y agoFalse. A computer always has a finite amount of memory.