RNG and Cosine in Nix
You get a full-blown programming language for free ;)
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."
"