operations on single precision numbers unstable in matlab 7.1 (64bit ) vesions and higher

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Dec 6 08:42:21 CET 2006


Dear FieldTrip users,

I have contacted Mathworks about this problem. They have been able to  
reproduce it, but were not able to provide a solution. I was informed  
that they expect itto be fixed in the next release of Matlab. I do  
not know when that release will be available.

The problem seems to be related to
http://www.mathworks.com/support/bugreports/details.html?rp=268001  
(login may be required)

Summary: MATLAB compatibility issue with Intel Math Kernel Library
Report ID: 268001
Date Last Modified: 09 Oct 2006
Product: MATLABĀ®
Exists In Version: 7.0.4, 7.1, 7.2, 7.3
Exists In Release: R14SP2, R14SP3, R2006a, R2006b
Fixed In Version: OPEN
Fixed In Release: OPEN
Summary: MATLAB compatibility issue with Intel Math Kernel Library
Description: MATLAB is not compatible with single precision BLAS  
routines from the Intel Math Kernel Library which return a single  
precision floating point number on 64-bit LINUX platforms.
Workaround: There are currently no known workarounds.

Therefore I want to stress that you should not use single precision  
computations on Intel 64 bit machines with Linux. You still can use  
single precision to save your data to file (using struct2single), but  
when you read it back in memory you should again convert it to double  
(struct2double).

In the Donders centre the problem exists on all mentat nodes except  
mentat001 and 002 (these are not affected). Furthermore, serval is  
affected. Other desktop linux computers in the Donders centre are not  
affected.

best regards,
Robert



On 28 Nov 2006, at 13:55, Ali Mazaheri wrote:
> ...
> A simple example of this problem is as follows
>
> a=[1 2]
> b=[1 2];
>
> >> a/b
> ans = 1
>
> NOW in single precision
>
> a=single(a);
> b=single(b);
> >> a/b
> ans = 1.9074 e-05



More information about the fieldtrip mailing list