<< utility functions utility functions flag_impl_significance >>

NaN Toolbox >> NaN Toolbox > utility functions > flag_accuracy_level

flag_accuracy_level

sets and gets accuracy level

Calling Sequence

FLAG = flag_accuracy_level()
flag_accuracy_level(FLAG)

Parameters

FLAG :

accuracy level

0:

maximum speed [default]

1:

accuracy of extended (80bit) with naive summation (error = N*2^-64)

2:

accuracy of double (64bit) with Kahan summation (error = 2^-52)

3:

accuracy of extended (80bit) with Kahan summation (error = 2^-64)

Description

used in SUMSKIPNAN_MEX and COVM_MEX The error margin of the naive summation is N*eps (N is the number of samples), the error margin is only 2*eps if Kahan's summation is used [1].

Please note, level 3 might be equally accurate but slower than 1 or 2 on some platforms.

Bibliography

[1] David Goldberg,

What Every Computer Scientist Should Know About Floating-Point Arithmetic

ACM Computing Surveys, Vol 23, No 1, March 1991.

Authors

<< utility functions utility functions flag_impl_significance >>