4 ms·
Julia?
by freemint 5y ago
Julia?
- adgjlsfhk1 5y agoJulia uses a very similar approach to musl here. Reduction mod 2pi followed by polynomial kernel. We use tables for `exp` and `log`, but the trig functions have good reductions so we use those instead. The implementation is here https://github.com/JuliaLang/julia/blob/03af78108afe6058f54cf766d8981d26a11c51f7/base/special/trig.jl#L29 https://github.com/JuliaLang/julia/blob/03af78108afe6058f54c... for anyone interested.
- snicker7 5y agoIn the Julia repl, just type '@less sin(pi)' to view the source code of sin. I don't know of any other programming language that makes it this easy to look at its internals.
- adgjlsfhk1 5y agoThat's how we nerd snipe people into contributing to Base (only 10% joking).