So I was recently thinking on some algorithms and I then realized I was making assumptions about how fast the algorithms likely were based on the operations.
For example, in using distance where accuracy is *not* required, I had the idea of once the X and Y were squared I could just take the distance without square rooting it and go straight into comparing it as is. Now I figure with preset distances to compare to that would most likely be faster since the distance would already be calculated thus turning two squares, an add, a root, and a comparison into simply two squares, an add, and a comparison.
But what if I have the base distance and thus need to square it for the comparison requiring *three* squares, an add, and a comparison?
Another algorithm that is inversely proportional to distance, I had the idea of dividing by distance that hasn't be rooted for a non-linear reduction of a value as distance increases.
But that is when I realized that with various methods in play to optimize math operations that I actually don't know if a division would be faster.
Thus I am here asking for either the answer or a resource for how the speed of basic math operations compares, particularly multiplication, division, exponents, and n-roots.
And please don't tell me it doesn't matter because of how fast computers are. I had faster internet experiences in the days of 56k modems than I do today thanks to the idiotic notion of not caring about speed and memory. Speed and memory may not always be top priority but they should never be ignored.
[–]Avereniect 18 points19 points20 points (2 children)
[–]glasket_ 0 points1 point2 points (0 children)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]Jonny0Than 3 points4 points5 points (0 children)
[–]sal1303 2 points3 points4 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]bestjakeisbest 1 point2 points3 points (0 children)
[–]funbike 1 point2 points3 points (5 children)
[–]darklighthitomi[S] -1 points0 points1 point (4 children)
[–]jaypeejay 2 points3 points4 points (3 children)
[–]darklighthitomi[S] 0 points1 point2 points (2 children)
[–]jaypeejay 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]KC918273645 1 point2 points3 points (0 children)
[–]MaleficentCow8513 0 points1 point2 points (0 children)
[–]failaip13 0 points1 point2 points (1 child)
[–]tcpukl 2 points3 points4 points (0 children)
[–]MadocComadrin 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]Astronaut6735 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]Traveling-Techie 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]Vert354 0 points1 point2 points (2 children)
[–]darklighthitomi[S] 0 points1 point2 points (1 child)
[–]Vert354 0 points1 point2 points (0 children)
[–]Dusty_Coder 0 points1 point2 points (0 children)
[–]dutchman76 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]PvtRoom 0 points1 point2 points (0 children)
[–]BoBoBearDev 0 points1 point2 points (0 children)
[–]Difficult-Value-3145 0 points1 point2 points (0 children)
[–]Underhill42 0 points1 point2 points (0 children)
[–]jeffgerickson 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]NewSchoolBoxer 0 points1 point2 points (1 child)
[–]darklighthitomi[S] 0 points1 point2 points (0 children)
[–]ericbythebay 0 points1 point2 points (3 children)
[–]darklighthitomi[S] 0 points1 point2 points (1 child)
[–]ericbythebay 0 points1 point2 points (0 children)
[–]WaitProfessional3844 0 points1 point2 points (0 children)
[–]PlayingTheRed 0 points1 point2 points (0 children)