Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
The C# Excel Library 2020.5
dbForge Studio for MySQL 9.0
LinkedIn Clone 2.2
Uber clone Apps 4.0
Cab Booking Script 1.3.2
Airbnb Clone HomestayDNN 3.0
Magento Language switcher 1.2.1
The .Net PDF Library 2020.3.2
IP2Location Geolocation Database 2020.5
ODBC Driver for MailChimp 2.0
ODBC Driver for NetSuite 2.0
ODBC Driver for SQL Azure 3.1
dbForge Schema Compare for Oracle 4.1
dbForge Data Compare for Oracle 5.1
dbForge Studio for Oracle 4.1
Top Code
dbForge Studio for MySQL 8.1
dbForge Studio for Oracle 3.10
dbForge Schema Compare for Oracle 2.7
dbForge Data Compare for Oracle 3.7
IP2Location Geolocation Database 2020.5
Availability Booking Calendar PHP 1.0
ATN Site Builder 3.0
Azizi search engine script PHP 4.1.10
ATN Resume Finder 2.0
Invoice Manager by PHPJabbers 3.0
Single Leg MLM 1.2.1
PHP Review Script 1.0
ICPennyBid Penny Auction Script 4.0
Extreme Injector 3.7
ODBC Driver for MailChimp 2.0
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
XSum 1.0
File ID: 85118






XSum 1.0
Download XSum 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 4
Submit Rating:
XSum 1.0 Description
Description: XSum - SUM with error compensation

The accuracy of the sum of floating point numbers is limited by the truncation error. E.g. SUM([1e16, 1, -1e16]) replies 0 instead of 1 and the error of SUM(RANDN(N, 1)) is about EPS*(N / 10).
Kahan, Knuth, Dekker, Ogita and Rump (and others) have derived some methods to reduce the influence of rounding errors, which are implemented here as fast C-Mex: XSum(RANDN(N, 1), 'Knuth') is exact to all 15 digits.

Y = XSum(X, N, Method)
INPUT:
X: Double array of any size.
N: Dimension to operate on.
Method: String: 'Double', 'Long', 'Kahan', 'Knuth', 'KnuthLong', 'Knuth2'.

OUTPUT:
Y: Double array, equivalent to SUM, but with compensated error depending
on the Method. The high-precision result is rounded to double precision.

METHODS: (speed and accuracy compared to SUM)
- Double: A thread-safe implementation of Matlab's SUM. At least in Matlab 2008a to 2009b the results of the multi-threaded SUM can differ slightly from call to call. 50% faster than single-threaded SUM (MSVC++ 2008), equivalent accuracy.
- Long: Accumulated in a 80 bit long double, if the compiler support this (e.g. LCC v3.8). 3.5 more valid digits, 40% slower.
- Kahan: The local error is subtracted from the next element. 1 to 3 more valid digits, 10% slower.
- Knuth: As if the sum is accumulated in a 128 bit float: about 15 more valid digits. About the same speed (MSVC++2008 compiler). This is suitable for the most real world problems.
- Knuth2: 30 more valid digits as if it is accumulated in a 196 bit float. 60% slower.
- KnuthLong: As Knuth, but using long doubles to get about 21 more valid digits, if supported by the compiler. 2.5 times slower.

License: Shareware

Related: 2009b, 2008a, matlab, results, Multithreaded, faster, slightly, differ, matlabs

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 4



User Review for XSum
- required fields
     

Please enter text on the image