Skip to content

Commit

Permalink
Merge pull request #11 from dmtrinh/main
Browse files Browse the repository at this point in the history
Swapped out use of sincos() for more portability across platforms
  • Loading branch information
smu160 authored Feb 16, 2024
2 parents a8d9485 + 9c3ffb0 commit 25ce43a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,5 @@ benches/benchmark-data.*
benches/*benchmarks_bar_plot*.png
benches/__pycache__
benches/elapsed_times.csv
benches/bench_fftw

5 changes: 4 additions & 1 deletion benches/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ void gen_random_signal(double* reals, double* imags, int num_amps) {
for (int i = 0; i < num_amps; ++i) {
double p_sqrt = sqrt(probs[i]);
double sin_a, cos_a;
sincos(angles[i], &sin_a, &cos_a);

double theta = angles[i];
sin_a = sin(theta);
cos_a = cos(theta);

double re = p_sqrt * cos_a;
double im = p_sqrt * sin_a;
Expand Down

0 comments on commit 25ce43a

Please sign in to comment.