[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Zero or not?
From: |
Francesco Potorti` |
Subject: |
Re: Zero or not? |
Date: |
Mon, 23 Jul 2007 16:07:05 +0200 |
>>>Ok, that's a start. If I calculate the sum of N numbers, what is the
>>>maximum 'offset' of the numerical result to mathematically correct
>>>result?
>>
>> Not a numerical expert, but the error magnitude should be bounded by
>> eps*sum(abs(x[1:N])).
>
>Are you sure this is what you intended to write? For example:
>
>octave:5> eps
>ans = 2.2204e-16
>octave:6> x = [ 1E5 -1E5 ]; N = length(x);
>octave:7> eps*sum(abs(x(1:N)))
>ans = 4.4409e-11
>
>I just hope (pray) that Octave can do better than this when calculating
>the sum of the values in x (i.e. sum(x))...
How possibly could it? You get a result of 1e5 and an error of 4e-11.
This is the machine precision, so you cannot get better than this as a
worst case. Certainly, depending on the precise numbers you sum up you
will generally get smaller errors, or even 0, but the error bound cannot
be smaller.
--
Francesco Potortì (ricercatore) Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR Fax: +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa Email: address@hidden
Web: http://fly.isti.cnr.it/ Key: fly.isti.cnr.it/public.key
- Zero or not?, Matthias Brennwald, 2007/07/21
- Re: Zero or not?, Jordi Gutiérrez Hermoso, 2007/07/21
- Re: Zero or not?, Matthias Brennwald, 2007/07/21
- Re: Zero or not?, Ben Abbott, 2007/07/21
- Re: Zero or not?, Matthias Brennwald, 2007/07/22
- Re: Zero or not?, James Sherman Jr., 2007/07/22
- Re: Zero or not?, Matthias Brennwald, 2007/07/23
- Re: Zero or not?,
Francesco Potorti` <=
- Re: Zero or not?, James Sherman Jr., 2007/07/23
- Re: Zero or not?, Miroslaw Kwasniak, 2007/07/23
- Re: Zero or not?, Francesco Potorti`, 2007/07/24
- Re: Zero or not?, kensmith, 2007/07/24
- Re: Zero or not?, Przemek Klosowski, 2007/07/24
- Re: Zero or not?, kensmith, 2007/07/24
- Re: Zero or not?, Francesco Potorti`, 2007/07/22
- Re: Zero or not?, Miroslaw Kwasniak, 2007/07/23
- Re: Zero or not?, Francesco Potorti`, 2007/07/23
- Re: Zero or not?, kensmith, 2007/07/23