Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Can this run any faster?
Date: Thu, 11 Apr 2013 17:08:07 +0000 (UTC)
Organization: Seagate Technology
Lines: 18
Message-ID: <kk6qln$c62$1@newscl01ah.mathworks.com>
References: <kk24q4$3j5$1@newscl01ah.mathworks.com> <kk5unh$gc1$1@newscl01ah.mathworks.com> <kk6gdl$8jp$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1365700087 12482 172.30.248.48 (11 Apr 2013 17:08:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Apr 2013 17:08:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3865886
Xref: news.mathworks.com comp.soft-sys.matlab:793293

"Yair Altman" wrote in message <kk6gdl$8jp$1@newscl01ah.mathworks.com>...
> "Heinrich Acker" wrote in message <kk5unh$gc1$1@newscl01ah.mathworks.com>...
> [snip]
> > My experience is that using inf or nan can slow down calculations significantly. I didn't try your code, nor did I try it recently on one of my programs, but since that discovery I went back to the old practice to use an extremly large value instead of inf. It is not always possible, but in many algorithms you will know a finite value that is larger than all finite values that can appear in that place, e.g. 1e99. So the suggestion is to use this value as a metaphor for inf, even if this seems to be less refined.
> > 
> > Of course, the result depends on the architecture of the system you are using. It may not help on your system at all. Your disappointing result when mexing the function is an indicator of an inf or nan speed problem, though. When I came across it, I briefly googled the problem and found out that some architectures raise an execption to process inf or nan, instead of producing an IEEE754 result directly by the FPU.
> > 
> > Heinrich
> 
> 
> I do not know which platform/ML release you are using Heinrich, but at least on Windows R2013a your statement seems to be incorrect. See below:
> 
(snip)
> Yair Altman
> http://UndocumentedMatlab.com 
>  

In my experience what Heinrich said can definitely be true - if you're talking about denormalized numbers, not inf/nans. Although it might be math on denorms I'm thinking about, and not necessarily conditionals.