We are developing a real-time system that will perform sin / cos calculations during a critical period of work. We plan to use a lookup table to help with performance, and I'm trying to compare the benefits / costs of implementing a table. Unfortunately, we still do not know what degree of accuracy we will need, but probably around 5-6 decimal points.
I believe that an end-to-end comparison of trigger functions of C ++ search approaches has already been done previously. I was hoping that someone could provide me with a link to a site documenting any such benchmarking. If such results do not exist, I would appreciate any suggestions on how I can determine how much memory is required for the lookup table with minimal accuracy and how I can determine the potential benefit.
Thank!
, , , . , , .
( , "" ). ? ? , .
, , ( w/two - / ).
SIN 0,00 90,00 9001 32- .
SIN [0] = 0.0 ... SIN [4500] = 0,7071068 ... SIN [9000] = 1.0
SIN, trig COS (a) = SIN (90-a) , SIN [9000-] COS (a)
, , , . SIN 45.00123
SIN [4500] + 0,123 * (SIN [4501] - SIN [4500])
- .
, , , , , , .
But this only gives a rough estimate of one side of the equation. Perhaps you can make a similar rough estimate of the cost of the lookup table if you know the latency of the CPU caches, and you have an approximate idea of the latency of memory access.
But the only way to get accurate information is to try. Add both of these and see what happens in your application. Only then will you know what is best in your case.
Source: https://habr.com/ru/post/1764962/More articles:сохранить результат селектора jquery в массив - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1764958/passing-variables-to-cfinclude&usg=ALkJrhjEFHMa1-stEUjtKpOymkPGtWcAoQCross-platform building Boost with SCons - c ++FFTW: inverse of fft, not equal to the original function - cBest way to install .NET Service in MSI so that it is updatable? - windows-installerIncorrect fftw3 conversion does not work - chardware designed for bitmap indexes? - databasePython 3.1 image library - pythonWhy do you need + between variables in javascript? - javascriptHow a base class can satisfy the definition of a parent pure virtual function using another parent function - c ++All Articles