Thank you for your comment and looking at the code. This particular @inbound is not a bug. We tried the method you mentioned but it was slower. What surprised us was how little benefit we got from the @inbound
That's surprising to me, as @inbounds should at worst be a noop - it shouldn't ever result in slower code. I sadly can't benchmark right now (no suitable device for the next few days), but I'll see if I can get back to this after that.
You might want to look into the zero function http://www.jlhub.com/julia/manual/en/function/zero having a hard-coded 0.0 is a bit of a code smell and can sometimes cause the type instabilities i mentioned. For this code it should not make a difference as log retuns floats but ... it reads as not very Julian bc of that.