Register to reply 
Machine epsilon in MATLAB 
Share this thread: 
#1
Mar2612, 11:26 AM

P: 13

Simple enough  I'm just trying to find the smallest positive real number, ε, such that 1 + ε ≠ 1 in MATLAB (double precision). So the value 'eps' in MATLAB is actually not quite defined this way, and using this program



#2
Mar2612, 05:57 PM

P: 1,781

Matlab uses the native floating point instructions of the processor it's running on. Epsilon will depend on the machine. The matlab value might be the largest one of all the supported platforms.



#3
Mar2612, 06:54 PM

Engineering
Sci Advisor
HW Helper
Thanks
P: 6,959

For a computer CPU with IEEE 64 bit floating point arithmetic, the value of ε is 2^{52} = approximately 2.2044e16. Your code is probably calculating the floating point number that is closest to, but not equal to, ε/2 (which is where your difference of 10^32 is coming from). A simple algorithm (in C) is



#4
Mar2612, 06:58 PM

PF Gold
P: 1,153

Machine epsilon in MATLAB
In MATLAB, eps is a function that returns machine epsilon. For me it is 2.2204e16.
If you run edit eps you get:



#5
Mar2712, 04:27 AM

P: 13




#6
Mar2712, 09:11 AM

Engineering
Sci Advisor
HW Helper
Thanks
P: 6,959

For example if the value of a is close to zero, εa may be too small to represent as a number different from 0, even if ε was a number as "big" as 0.1. In that case computing a + εa would give a, but computing (1+ε)a would give a different result. 


Register to reply 
Related Discussions  
Show xa< epsilon IFF aepsilon < x < a+epsilon  Calculus & Beyond Homework  3  
Machine epsilon to verify precision  Math & Science Software  0  
Material in machine tool body (milling machine)  Materials & Chemical Engineering  0  
Determine the machine precision in Matlab  Math & Science Software  3 