3 ms·
I collected a few of these here: https://github.com/ncruces/fastmath/blob/main/fast.go https://github.com/ncruces/fastmath/blob/main/fast.go Also see this Sta
by ncruces 2y ago
I collected a few of these here:
https://github.com/ncruces/fastmath/blob/main/fast.go https://github.com/ncruces/fastmath/blob/main/fast.go
Also see this StackOverflow:
https://stackoverflow.com/questions/32042673/optimized-low-accuracy-approximation-to-rootnx-n https://stackoverflow.com/questions/32042673/optimized-low-a...
- qingcharles 2y agoThat's great, thank you. I was just thinking about starting a collection of these to begin rewriting my old 3D engine from the late 80s.
- nj5rq 2y agoPlease, post the progress if you end up rewriting it.
- koeng 2y agoI'd love to see some benchmarks on your fastmath package
- ncruces 2y agoIt's… probably not worth it. I just wrote this years ago (go.mod said 1.12) for the fun of it, thought I had it in a Gist/GitHub, and uploaded it yesterday in response to this post. One thing I remember trying was coding this up in ASM… which makes it worse, because it prevents inlining. But I learned the Go ASM syntax that way.
- nj5rq 2y agoVery interesting, thank you for posting it.