Why is this Julia code considerably slower than Matlab

You’re looking for cis function.