exp(a*log(b)) is usually faster than b^a (in fact, b^a internally usually 
does something similar, but with some extra tricks to avoid loss of 
precision).

You might be able to use one of the vectorized math libraries: 
AppleAccelerate.jl (if you're on OS X), VML.jl (if you have access to Intel 
MKL: you can download the community licensed version for free), or Yeppp.jl.

-Simon

On Wednesday, 29 June 2016 23:08:35 UTC-4, Anonymous wrote:
>
> I have an algorithm where the bulk of the computation time is spent 
> calculating an operation of the form
>
> Matrix .^ transpose(Vector)
>
> I was able to get a 33% speed up by re-writing this as
>
> exp(transpose(Vector) .* log(Matrix))
>
> however this is something of a hack and I don't really approve of it, is 
> there a more elegant way to speed up this operation?
>

Reply via email to