Can the mex file reduce somehow precision of a variables?
No. Double precision in a mex routine is the same as double precision at the m-file level. You don't lose precision by doing the double precision calculation in a mex routine.
When i multiply two double-precise number is their multiplication also double-precision number?
Yes. The actual calculation may be done at higher precision, and then down-converted to double precision when stored. But it will not be done with less precision.
Both of those answers are related to the low level double precision calculations. But how the mex routine was written can certainly affect the final answer. So mex code that implements an algorithm differently from its m-file counterpart can certainly get a different answer even if both implementations are using double precision.
Best Answer