trigno_simd_cpp
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: Nikhil0250
- License: mit
- Language: C++
- Default Branch: main
- Size: 656 KB
Statistics
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Trigonometric SIMD Benchmark - C++ Implementation
This repository accompanies the research paper "A Novel SIMD-Optimized Implementation for Fast and Memory-Efficient Trigonometric Computation" by Nikhil Dev Goyal and Parth Arora.
📄 Reference Research Paper:
📌 DOI: https://doi.org/10.48550/arXiv.2502.10831
📌 Full Paper: arXiv Link
The paper introduces a set of trigonometric functions that are significantly faster than standard C++ implementations, achieving up to a 5× speed increase. These functions are also highly memory-efficient, requiring no precomputations, making them ideal for hardware implementations on low-end FPGAs and MCUs. Benchmark comparisons demonstrate substantial hardware resource reductions, including DSPs, LUTs, and flip-flops, when compared to built-in functions.
📥 Getting Started
Follow these steps to set up, compile, and run the code to reproduce the results.
🛠️ Building the Project (Using CMake)
1️⃣ Clone the repository
sh
git clone https://github.com/Nikhil0250/trigno_simd_cpp.git
cd trigno_simd_cpp
2️⃣ Create a Build Directory
sh
mkdir build
cd build
3️⃣ Run CMake
➤ Auto-Detect MinGW (Recommended)
sh
cmake -G "MinGW Makefiles" ..
This will automatically detect gcc, g++, and mingw32-make.
➤ If Auto-Detection Fails
Manually specify compilers:
sh
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
If MinGW is installed in a custom location:
sh
cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM="C:/YourMinGW/bin/mingw32-make.exe" ..
4️⃣ Compile the Project
sh
cmake --build .
✅ This compiles the project and generates the executable in bin/trigno_benchmark.exe.
🔥 Running the Benchmark
After compilation, run:
sh
bin\trigno_benchmark.exe
✅ This will generate the benchmark results in CSV format inside the data/ folder.
✅ A detailed performance summary is displayed in the terminal upon execution.
📊 Reproducing Research Paper Results
The results of the benchmark will be saved in the data/ directory:
data/
├── proposed_sin.csv
├── proposed_cos.csv
├── proposed_tan.csv
├── taylorcos5.csv
├── taylorsin5.csv
├── taylortan5.csv
├── ...
Each CSV contains:
- angle: Input angle in radians
- std_result: Standard C++ function output
- my_result: Optimized SIMD function output
- abs_error: Absolute error between standard and optimized functions
- rel_error: Relative error
- std_time: Execution time of standard function (ns)
- my_time: Execution time of optimized function (ns)
- speedup_ratio: Speed improvement compared to the standard function
📜 Project Structure
``` trignosimdcpp/ │── include/ # Header files (.h) │ ├── anglereduction.h # Header for angle reduction optimizations │ ├── proposedtrigno.h # Header for proposed optimized trigonometric functions │ ├── taylorsimd.h # Header for SIMD-optimized Taylor series functions │ │── src/ # Source files (.cpp) │ ├── anglereduction.cpp # Implements angle reduction techniques │ ├── benchmark.cpp # Main benchmarking script │ ├── proposedtrigno.cpp # Implements proposed SIMD-optimized trigonometric functions │ ├── taylorsimd.cpp # SIMD-optimized Taylor series calculations │ │── data/ # Computed benchmark results (CSV files) │ ├── proposedsin.csv # Benchmark results for proposed sin() │ ├── proposedcos.csv # Benchmark results for proposed cos() │ ├── proposedtan.csv # Benchmark results for proposed tan() │ ├── taylorcos5.csv # Taylor series approximation (5 terms) for cos() │ ├── taylorsin5.csv # Taylor series approximation (5 terms) for sin() │ ├── taylortan5.csv # Taylor series approximation (5 terms) for tan() │ ├── ... # Other benchmark results │ │── vitishlscode/ # FPGA HLS implementations (for hardware benchmarks) │ ├── proposedcosSIMD.cpp # HLS implementation for SIMD-optimized Proposed cos() │ ├── proposedsinSIMD.cpp # HLS implementation for SIMD-optimized Proposed sin() │ ├── proposedtanSIMD.cpp # HLS implementation for SIMD-optimized Proposed tan() │ ├── taylorcosSIMD.cpp # Taylor series-based cos() for FPGA │ ├── taylorsinSIMD.cpp # Taylor series-based sin() for FPGA │ ├── taylortanSIMD.cpp # Taylor series-based tan() for FPGA │ ├── testbenchproposedcosSIMD.cpp # Testbench for cos() │ ├── testbenchproposedsinSIMD.cpp # Testbench for sin() │ ├── testbenchproposedtanSIMD.cpp # Testbench for tan() │ ├── testbenchtaylorcosSIMD.cpp # Testbench for Taylor cos() │ ├── testbenchtaylorsinSIMD.cpp # Testbench for Taylor sin() │ ├── testbenchtaylortanSIMD.cpp # Testbench for Taylor tan() │ │── vitishlsreports/ # Reports from FPGA synthesis & simulations │ ├── reportproposedcosSIMD/ # Reports for proposedcosSIMD │ ├── reportproposedsinSIMD/ # Reports for proposedsinSIMD │ ├── reportproposedtanSIMD/ # Reports for proposedtanSIMD │ ├── reporttaylorcosSIMD/ # Reports for Taylor cos() SIMD │ ├── reporttaylorsinSIMD/ # Reports for Taylor sin() SIMD │ ├── reporttaylortanSIMD/ # Reports for Taylor tan() SIMD │ ├── reportcosinbuilt/ # Baseline hardware results for standard cos() │ ├── reportsininbuilt/ # Baseline hardware results for standard sin() │ ├── reporttaninbuilt/ # Baseline hardware results for standard tan() │ │── bin/ # Compiled executables (generated after build) │ ├── trignobenchmark.exe # Final compiled executable │ │── CMakeLists.txt # CMake build configuration │── README.md # Project documentation │── LICENSE # License file │── .gitignore # Files to ignore in Git
```
📬 Support & Contribution
If you have questions or want to contribute, feel free to open an issue or submit a pull request.
Owner
- Name: Nikhil Dev Goyal
- Login: Nikhil0250
- Kind: user
- Repositories: 1
- Profile: https://github.com/Nikhil0250
Citation (CITATION.bib)
@article{GoyalArora2025TrignoSIMD,
author = {Nikhil Dev Goyal and Parth Arora},
title = {A Novel SIMD-Optimized Implementation for Fast and Memory-Efficient Trigonometric Computation},
journal = {arXiv},
volume = {abs/2502.10831},
year = {2025},
url = {https://doi.org/10.48550/arXiv.2502.10831},
archivePrefix = {arXiv},
eprint = {2502.10831},
primaryClass = {cs.MS},
note = {Available at: \url{https://arxiv.org/html/2502.10831v1}}
}
GitHub Events
Total
- Watch event: 7
- Public event: 1
- Push event: 9
- Fork event: 1
Last Year
- Watch event: 7
- Public event: 1
- Push event: 9
- Fork event: 1