I've noticed that mtimes produces a slightly different answer than the answer I would get from multiplying two vectors directly. Does anyone have any insights on why it's the case?
For example: z is a small single-precision floating point array
Using mtimes: z'*z = 3.3291292 Direct method: sum(z.^2) = 3.3291297
Notice how the last decimal place is different? For my problem, I'm computing a bunch of array multiplications in a loop, and this small error gets propagated. The final result using mtimes can be quite different compared to just doing the calculations by hand.
What's causing the difference? Is the small error in mtimes to be expected?