Our great sponsors
-
freebsd-src
The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests....
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
llvm-project
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
This is a faster implementation of cosine that utilises six static const double variables (C1, C2, C3, C4, C5, C6) to speed things up. These variables represent the coefficients of a polynomial approximation for the cosine function.
For the genuine article, check out: https://github.com/ifduyue/musl/blob/master/src/math/cos.c
Why does he link to his lame fork of musl for the official FreeBSD sources for libm, taken from Sun, used by musl?
https://github.com/freebsd/freebsd-src/blob/main/lib/msun/sr...
Personally I like Universal CORDIC, you can calculate much more than Cosine, but it tends to be slower. See https://en.wikibooks.org/wiki/Digital_Circuits/CORDIC#The_Un... and a somewhat janky fixed point library that implements it https://github.com/howerj/q
https://github.com/JuliaMath/Bessels.jl/blob/master/src/bess...
Thanks! I love it, so easy to understand and follow.
My favourite work on the subject is Fredrik Johansson's:
https://github.com/fredrik-johansson/arb
Whenever I feel down and without energy I just read something in there
https://github.com/JuliaMath/Bessels.jl/blob/master/src/bess...
Thanks! I love it, so easy to understand and follow.
My favourite work on the subject is Fredrik Johansson's:
https://github.com/fredrik-johansson/arb
Whenever I feel down and without energy I just read something in there
- The RLIBM project: https://github.com/rutgers-apl/The-RLIBM-Project/blob/main/l...