logoalt Hacker News

drsopptoday at 3:10 PM3 repliesview on HN

Did some quick calculations, and at this precision, it seems a table lookup might be able to fit in the L1 cache depending on the CPU model.


Replies

Pannoniaetoday at 3:19 PM

Microbenchmarks. A LUT will win many of them but you pessimise the rest of the code. So unless a significant (read: 20+%) portion of your code goes into the LUT, there isn't that much point to bother. For almost any pure calculation without I/O, it's better to do the arithmetic than to do memory access.

show 1 reply
groundzeros2015today at 3:28 PM

I don’t want to fill up L1 for sin.

jcalvinowenstoday at 3:46 PM

Surely the loss in precision of a 32KB LUT for double precision asin() would be unacceptable?

show 1 reply