4 ms·
Nix Trigonometric Math Library from Ground Zero
- WillAdams 2y agoThe perfect tool to use to debug: https://web.mit.edu/jemorris/humor/500-miles https://web.mit.edu/jemorris/humor/500-miles
- isaacimagine 2y agoRelated, fun link: RNG and Cosine in Nix https://unnamed.website/posts/rng-cosine-nix/ https://unnamed.website/posts/rng-cosine-nix/
- djmips 2y agoHere's a deep cut https://web.archive.org/web/20070128050622/https://www.research.scea.com/research/pdfs/RGREENfastermath_GDC02.pdf https://web.archive.org/web/20070128050622/https://www.resea... Regarding using the Taylor series: "The problems lie in the approximation error. If you graph the absolute error of this function you find that it is very accurate for small angles around the origin of the Taylor expansion but the error increases almost exponentially away from x=0. Truncating the series later will decrease the error but is not only is more costly and opens you to more danger of numerical error, but each additional term is another load/multiply-accumulate in your program. We need good accuracy across the whole range and we need it using as few terms as possible." ... Minimax Polynomials "The method used to find these polynomial approximations is called the Remez Exchange Algorithm." "
- gsf_emergency 2y agoGiven title, slightly disappointed that TFA did not explain that they used Nix to bootstrap a verifiably optimal, hardware "magic-number-based" math library using Remez (stdlib cosf cosl etc would be example outputs)
- vfclists 2y agoThat is why OP should be using Guix? You get a full-blown programming language for free ;)
- mike-the-mikado 2y agoI would have though https://en.wikipedia.org/wiki/CORDIC https://en.wikipedia.org/wiki/CORDIC was the way to go