this post was submitted on 23 Jan 2024
894 points (95.3% liked)
Memes
45614 readers
442 users here now
Rules:
- Be civil and nice.
- Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I do some 8-bit coding and only last month realized logarithms allow dirt-cheap multiplication and division. I had never used them in a context where floating-point wasn't readily available. Took a function I'd painstakingly optimized in 6502 assembly, requiring only two hundred cycles, and instantly replaced it with sixty cycles of sloppy C. More assembly got it down to about thirty-five... and more accurate than before. All from doing exp[ log[ n ] - log[ d ] ].
Still pull my hair out doing anything with tangents. I understand it conceptually. I know how it goddamn well ought to work. But it is somehow the fiddliest goddamn thing to handle, despite being basically friggin' linear for the first forty-five degrees. Which is why my code also now cheats by doing a (dirt cheap!) division and pretending that's an octant angle.