I am importing a Matlab program to Octave. I made the program work. Now everything seems working quite well a part from precision.
I found Matlab and Octave give out slightly different result for same equation. For example,
pi = acos(-1.0);
mu_0 = 4*pi*10^(-7);
Then, Matlab and Octave give out same result for pi. However, for mu_0, Octave gives out 1.256637061435918e-006, but MATLAB gives out 1.256637061435917e-006.
The last decimal placement is slightly different. It does affect a lot in the final results (maximum difference in the results is about 0.0001, but I need to get lower than 0.00000001), because the program has a lot of equations for calculation.
Hence, I would like to know if we can make Octave to output exactly same result with Matlab? If we can't, how can I decrease the difference between their results? Can I solve this kind of problem by writing some code or changing some figuration?
Thank you very much for your help.
PS: The point is making the Octave output the same results with MATLAB.(The edited program doesn't have any difference in calculation with original program. ) Maybe, "variable precision arithemetic" does not help much, because MATLAB also make floating point round off error.