Re: [eigen] (General question) Floating point: why are 'inf' and 'nan' slow? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] (General question) Floating point: why are 'inf' and 'nan' slow?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 23 Sep 2009 11:28:07 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=sMXkKz7SvzZ6o9UbfAXR3fIDto7w9B+yO4ff2iHq52M=; b=BWctPCGAqiwdYIBAdqTaSWdzFx10xG0oOS7TvA8VjrhdgXrM40WtHn0AqDp20R2GvM N6x+v+bxm/tgovNz7Y67JFiMgYmtwvAfwt8z6aIouQrdjQtXUjnJvRMRTBeP8RK7q4gp 1BJUeS+FZOOmmef+3LlX6xqlW4E6Jpt/hqAaY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=FwBbtXnbwgpGFyBSlJ9/9LZKcCwQLW1tsFa9YS3HEDg//ms4J7mt8UtmirpmJCYs/0 LQXkSV8WEppApKFCd8TKrZ2kgNz7BVhtay8O2fjLYLo4KVaNr85gvNHBzJYTIMuZUUJi oGrI7xjrzEf+OdENxPjZQZKcuD4T26SH8nnI0=
2009/9/23 Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>:
>> Here, on linux / x86, my programs run 100x slower when the
>> floating-point values are 'inf' or 'nan'.
>
> I seem to remember that this is a problem / feature in the design with Intel
> FPUs, but not with the AMD ones. Computations with these special values take
> longer, presumably because the people that designed the chip thought that
> they are not used often. Here's an article I found (it's from some time ago
> though): http://www.cygnus-software.com/papers/x86andinfinity.html
>
> I never looked into it in detail though.
>
OK, thanks for the link, that was interesting. I confirms exactly my
experience (I have a Core 1 Duo so it's not specific to the Pentium
4).
It is interesting that it mentions that, while the issues with INF and
NAN are specific to Intel non-SSE, the issues with denormals are
universal. For Eigen though, the big issue is INF and NAN.
Benoit