[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: left-right (up-down) parsing may lead to over/underflow of prod
From: |
Rolf Fabian |
Subject: |
Re: left-right (up-down) parsing may lead to over/underflow of prod |
Date: |
Wed, 23 Apr 2008 15:04:38 +0200 |
> Datum: Wed, 23 Apr 2008 07:20:33 +0200
> Von: "Jaroslav Hajek" <address@hidden>
> An: "Octave Maintainers List" <address@hidden>
> CC: "David Bateman" <address@hidden>, "Rolf Fabian" <address@hidden>
> Betreff: Re: left-right (up-down) parsing may lead to over/underflow of prod
> I've committed `safeprod' to OctaveForge (main/general).
>
> --
> RNDr. Jaroslav Hajek
> computing expert
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
You should withdraw and remove 'safeprod.m' as soon as possible
because it is a mess and far away from beeing safe in contradiction
to its name.
1) Its help part is corrupted and not understandable.
2) If input is a row vector no product is formed
3) It returns NaNs where not appropriate
e.g. safeprod([realmax;2]) |- ans = NaN
whereas Octave:> prod([realmax;2]) = Inf
gives already the correct answer whereas
your 'improvement' fails!
Similar for e.g. :> safeprod([realmax;2i]) |- ans = NaN
whereas prod gives correct ans = 0 + Infi
4) It is easy to construct input which leads to
under/overflow of your 'safeprod' function.
Hence it is not 'safe'.
5) Weird things may be returned from 'safeprod'
for complex input containing some Inf, -Inf, Infi
entries.
I summarize that your function seems to be a nice little
trial to work around the prod bug, but unfortunately it
is not able to remove it completely and thus useless.
R:
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/address@hidden
Re: left-right (up-down) parsing may lead to over/underflow of prod, Shai Ayal, 2008/04/22