Different results obtained from different computer

3 ビュー (過去 30 日間)
Xiu
Xiu 2011 年 9 月 8 日
I'm trying to run an iterative loop with only simple operators (multiplication and division) and function 'norm'. But when I run the same file in different computers, the results are varied. Can anyone help me with that please?
Thanks
Xiu

採用された回答

Jan
Jan 2011 年 9 月 8 日
Different computers use different libraries to calculate the square root. Therefore the last significant bit of the calculation can vary after a calculation. An iteration can amplify such small differences.
In addition the rounding direction can be different, some processors can store intermediate values with 80 bit precision, others with 64 bits. I'm not able to reproduce the results of Matlab's ACOS exactly in C, even if I use the same library from FDLIBM.
  5 件のコメント
Xiu
Xiu 2011 年 9 月 9 日
norm(w_o)is very small (10^-5).
X can be any matrix with 12 columns and y is a column vector with same number of rows as X.
Jan
Jan 2011 年 9 月 9 日
@Xiu: If the tiny differences between different computers are amplified such, that the final results are completely different, the algorithm is instable. Then both results are _correct_ in a numerical sense. See also: http://www.mathworks.com/matlabcentral/answers/438-why-are-computational-results-in-matlab-sometimes-different-on-different-machines-and-how-can-i-prev

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by