3 ms·
I see. I'd say it depends what the application is, then, because in graphics correctly handling (unlikely) extreme values would be quite secondary to performanc
by tbabb 5y ago
I see. I'd say it depends what the application is, then, because in graphics correctly handling (unlikely) extreme values would be quite secondary to performance, especially for an inner loop function like norm. See fastinvsqrt, e.g., which is extremely imprecise!
- hanche 5y agoIn many applications there is definitely no reason to worry about overflow when computing norms. That is more of an issue if you are writing library code for general use, which should be as robust as you can make it.
- FabHK 5y agoAbsolutely, I should’ve been more precise: it’s perfectly fine for most applications, but not for a library, or, say, manned aviation. So, yeah, when optimising for accuracy, range, or speed you might implement it differently, respectively. I mean, papers have been written about sqrt(a^2+b^2) alone… :-) https://arxiv.org/abs/1904.09481 https://arxiv.org/abs/1904.09481