Compensated summation in sum?

14 ビュー (過去 30 日間)
Andrew Newell
Andrew Newell 2011 年 1 月 28 日
Does Matlab use some algorithm such as compensated summation to reduce the roundoff error in sum?

採用された回答

Jan
Jan 2011 年 1 月 28 日
There is no compensation in Matlab's SUM. For small arrays (there was a limit at 88999 elements, but this might change with the Matlab release) the sum is computed directly. For bigger arrays the sum is divided in parts and distributed over different threads.
If you need a compensated sum, try:
This offers a Kahan-compensation, Knuth's method with intermediate 128 and 192 bit precision, an 80bit accumulator and Knuth with 160 bits (the last two are not supported by all compilers and platforms).
  1 件のコメント
Andrew Newell
Andrew Newell 2011 年 1 月 28 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by