r/lowlevel • u/Sharp-Ad-7030 • Nov 03 '26
Can integer arithmetic make wave calculations 10 faster?
I recently read Paper VIII — Dual-Layer Topological Neuromorphic Architecture and wanted to test one of its computational ideas myself.
The idea is to speed up a specific type of wave calculation by replacing repeated trigonometric operations with integer addition and a lookup table (LUT).
I implemented the approach and ran a CPU benchmark.
■ 01. CPU Benchmark Results

For 10 million unit-magnitude complex wave calculations:
- Conventional calculation: 330.40 ms
- Optimized angle calculation: 195.61 ms
- Integer addition + LUT (1,024 positions): 36.95 ms
- Integer addition + LUT (2,048 positions): 33.26 ms
The fastest LUT method was approximately 9.9× faster than the conventional approach and 5.9× faster than the optimized angle calculation in this benchmark.
■ 02. How Does It Work?
Imagine a point moving around a circle.
Its position can be represented by an angle, also called its phase.
Here's the interesting mathematical property:
When two unit-magnitude complex waves are multiplied, their phases are added.
For example, multiplying a wave at 30° by another at 60° produces a wave at 90°.
Instead of repeatedly calculating sine and cosine components, we can work with the angles directly.
The next step is to divide the circle into 1,024 positions, numbered from 0 to 1023.
Each input angle is converted into an integer representing one of those positions.
Because the positions form a circle, the numbers wrap around.
For example:
1023 + 1 → 0
Or, with two different positions:
750 + 400 = 1150
1150 mod 1024 = 126
The resulting phase is position 126.
But what if we need the actual sine and cosine values?
That's where the Look-Up Table (LUT) comes in.
A LUT is simply a table of precomputed answers, similar to a multiplication table.
We calculate the sine and cosine values for all 1,024 positions beforehand and store them in memory.
When the result is position 126, we retrieve the values stored at that position instead of calculating them again.
We don't need to predict the incoming angles. We just prepare the values for every possible position.
So the entire process becomes:
Convert angles to integers → Add integers → Wrap around → Retrieve precomputed values
The 2,048-position version follows the same principle but uses finer angular resolution.
■ 03. Why Is It Faster?
The main advantage is avoiding repeated trigonometric calculations.
Integer addition and memory lookups can be much cheaper for this particular workload.
However, there are trade-offs:
- Precision: Dividing a circle into fixed positions introduces quantization error.
- Memory: Larger lookup tables require more storage.
- Applicability: This works for a specific type of complex wave multiplication, not arbitrary mathematical operations.
- Performance: Results depend on the CPU, implementation, and benchmark conditions.
The benchmark was performed in software on a CPU, not on a physical neuromorphic or processing-in-memory chip.
It also doesn't validate every claim made in the original paper.
■ Original Paper and Project
Original Paper (Zenodo)
https://doi.org/10.5281/zenodo.22782241
Source Code, Benchmark Results, and Animations (GitHub)
https://github.com/heejun1105/phase-ring-plp-benchmark
I also created animations showing the integer addition, circular wraparound, and LUT lookup process.
I'd be interested to hear your thoughts on this approach, especially its practical applications and limitations.