WIP: WaveSabreCore: simplify cos-table computation #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't need to use run-time trig functions here, because the step
between each entry is the same. So instead, let's calculate the
coefficients of a 2D rotation matrix using constant expressions, which
should give the same result, barring any accumulation errors.
Since we're using double precision floats and the LUT is of limited
size, the max error accumulated are a negligible 2.22045e-14, compared
to the CRT cos() function.
Note: I've marked this as WIP, so don't merge this just yet. This is kinda
written "blindly" without verifying if the resulting code is smaller or not.
I suspect it is, but this needs to be verified. My excuse is that I was on a
Linux machine when I wrote this ;)