help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] gsl_sum (potential division by zero?)


From: Michel Van den Bergh
Subject: Re: [Help-gsl] gsl_sum (potential division by zero?)
Date: Thu, 04 Jan 2007 10:56:09 +0100
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)

Hi Brian,

I now understand that the code is consistent with the philosophy behind gsl.
Thanks for the wonderful package.

Michel


Brian Gough wrote:

At Sun, 24 Dec 2006 13:35:14 +0100,
Michel Van den Bergh wrote:
I was looking at the code for gsl_sum. I have not completely
understood it yet, but I noticed that whereas levin_utrunc.c
explicitly tests for terms that are zero, this is not the case for
levin_u.c. As one divides by such terms, it seems that one may
potentially divide by zero this way. Am I wrong?

Hello,

Thanks for your email.  I think the original code that the routine was
translated from assumes that all terms passed in are non-zero since
any others would not contribute to the sum.

The documentation does not seem to mention that terms should be
different from zero.

Yes, I will add a note about that.

I am not a numerical analyst (IANANA) but it seems to me that even in
levin_utrunc.c no motivation is given for discarding zero terms.
Wouldn't it be more natural to add a bit of noise to the remainder
estimates to reduce the risk of division by zero?

Generally in GSL we just implement what is published in the
literature, so far I have not seen any newer algorithms published.






reply via email to

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