Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
preda committed Oct 29, 2024
1 parent 180c312 commit c01cab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Trig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ TrigCoefs trigCoefs(u32 n) {
assert(pos <= 7);
auto [mul, idx] = COS_TAB[pos];

return {mul, scaleSin(SIN[idx], 1.0/(twos / 4)), scaleCos(COS[idx], 1.0/(twos / 4))};
double scale = 1.0 / (twos / 4);

return {mul, scaleSin(SIN[idx], scale), scaleCos(COS[idx], scale)};
}
3 changes: 1 addition & 2 deletions src/cl/trig.cl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ double2 reducedCosSin(int k) {
return U2(c, s);
}

// Returns e^(-i * tau * k / n), (tau == 2*pi represents a full circle). So k/n is the ratio of a full circle.
// Inverse trigonometric direction is chosen as an FFT convention.
// Returns e^(i * tau * k / n), (tau == 2*pi represents a full circle). So k/n is the ratio of a full circle.
double2 slowTrig_N(u32 k, u32 kBound) {
u32 n = ND;
assert(n % 8 == 0);
Expand Down

0 comments on commit c01cab8

Please sign in to comment.