Improve fixed-point tangent calculation for division-less operations and accuracy
@jouae is already working on this.
Since Mar 2, 2025.
Assessment
This issue has not been assessed yet.
Description
When calculating the twin_tan(), division is used, specifically $\frac{\sin x}{\cos x}$
// twin_tan()
return ((s << 15) / c) << 1;
To minimize the use of the division operator, you can refer to the division implementation mentioned in https://hackmd.io/@sysprog/linux-intdiv, which describes the implementation in jemalloc to avoid direct use of the division operator.
Currently, testing and experimental data are needed to confirm that using this division method in twin_tan within mado can achieve faster calculation times.
As for the other issue, it's whether twin_tan can be improved further, including enhancements in precision and calculation speed.
Perhaps coordinate rotation digital computer(CORDIC) cloud be a solution.
The note here provide a quick overview of the mathematical principles behind conventional CORDIC and scaling-free CORDIC.
Reference:
- Dominant language
- C
- Stars
- 118
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sysprog21/mado
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
bug
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·