musl
vectrig
musl | vectrig | |
---|---|---|
17 | 1 | |
169 | 6 | |
- | - | |
8.5 | 10.0 | |
22 days ago | almost 13 years ago | |
C | C | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
musl
- musl/__cos.c at master ยท ifduyue/musl
-
Cosine Implementation in C
well OK, but figure this one out:
https://github.com/ifduyue/musl/blob/master/src/ctype/casema...
How do you regenerate it when the Unicode version changes?
-
What are some good C programs I can read through?
musl-libc
- How to create fundamental libraries for my language?
- Regex and gcc versions
- Implementing Cosine in C from Scratch
-
How do I find the actual code of C functions?
https://git.musl-libc.org/cgit/musl (musl, another open source implementation, I've heard this one has more readable code)
vectrig
-
Implementing Cosine in C from Scratch
Thanks for explaining this. I actually wrote a SIMD implementation of trig functions years ago, using the techniques you describe.
You can check it out: https://github.com/jeremysalwen/vectrig
I compared several different methods of generating polynomials of different sizes for speed and precision (spoilers: taylor series were the worst and minimax polynomials (Remez algorithm) were the best).
Another (surprising) thing which I learned during the project was that the range reduction was just as (if not more) important to the accuracy of the implementation than the polynomial. If you think about it, you will realize that it's actually pretty difficult to quickly and accurately compute the sin of large numbers like 2^50.
I also tried to directly optimize the coefficients for the accuracy of the polynomial on the required range, but that experiment was unsuccessful.
It's all there in the repository, the implementations, notes about the different polynomials used, and the accuracy/speed statistics for the different methods.
What are some alternatives?
freebsd-src - The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests....
v7unix - Version 7 Unix for a POSIX world
pure-data - Pure Data - a free real-time computer music system
wefx - Basic WASM graphics package to draw to an HTML Canvas using C. In the style of the gfx library
scratch-www - Standalone web client for Scratch
supercollider - An audio server, programming language, and IDE for sound synthesis and algorithmic composition.
Libc
Quake - Quake GPL Source Release