I have some pieces of code that require lots of sin
and cos
evaluations and I’m looking for ways to accelerate. I noticed that the sincos
function seems slightly slower than calling sin
and cos
alone.
julia> using BenchmarkTools
julia> x = rand(1000);
julia> @btime map(sincos, $x);
7.725 μs (1 allocation: 15.75 KiB)
julia> @btime map(y->(sin(y),cos(y)), $x);
6.975 μs (1 allocation: 15.75 KiB)
Is the sincos
function just for convenience? Is there a standard way of speeding up trigonometry?
(I just upgraded to Julia 1.7.0)