help-octave
[Top][All Lists]
Advanced

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

Re: How to print this function?


From: marco atzeri
Subject: Re: How to print this function?
Date: Tue, 22 May 2012 22:43:14 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

On 5/22/2012 10:27 PM, Przemek Klosowski wrote:
On 05/22/2012 03:27 PM, marco atzeri wrote:
On 5/22/2012 8:26 PM, Sergei Steshenko wrote:


Though not related to your original question, 0.1 may be a periodic
fraction in your _binary_ CPU, so you better write


t = 0.1 * [-10:1:10];


irrilevant in this case

octave:4> [-1:0.1:1;]-0.1*[-10:1:10;]<eps
<... shows that the differences are all less than eps ...>

Well, the point of 'eps' is that it is the smallest normalized number so
it masks the simple roundoff errors. In this case you haven't
accumulated enough of roundoff to exceed eps, but if you keep going you
eventually will. A quick try shows that you need four orders of
magnitude more operations:

min([-1:0.00001:1;]-0.00001*[-100000:1:100000;]<eps)

Sergei showed you the correct form that will never fail.

again,
irrelevant for the scope of the original request.
You and Sergei are splitting the hair in half when not needed

if you plot 100000 points on you screen, you will find that the rounding error is pixel wide...

Marco





reply via email to

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