help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Machine epsilon, Octave and Matlab


From: Craig Stoudt
Subject: Machine epsilon, Octave and Matlab
Date: Wed, 29 Aug 2001 11:38:08 -0700 (PDT)

I have a question about the way Octave handles
arithmetic operations around machine epsilon.

Consider the expression 1/(1-x) - 1/(1+x)
Let x = eps/2.

Since x < eps, when you evaluate this expression in
Octave, the result is zero.  Not surprising.  However,
if you evaluate the same expression in Matlab 6.1, you
get 2.220446049250313e-016 which is eps, which is
pretty close to the correct answer.  If one evaluates
the expression at eps/4, Matlab yields zero, the same
as Octave (the correct answer is approximately eps/2).

I'm just curious about the difference in results
between Matlab and Octave at x = eps/2

Craig Stoudt


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]