New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1239 - FastMath tests fail with clang
Summary: FastMath tests fail with clang
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Failed Unit Test
Assignee: Nobody
Depends on: 1008
  Show dependency treegraph
Reported: 2016-06-02 13:23 UTC by Christoph Hertzberg
Modified: 2016-07-25 14:15 UTC (History)
3 users (show)


Description Christoph Hertzberg 2016-06-02 13:23:45 UTC
Before this stays unnoticed: clangs implementations of std::isinf and std::isnan appear to be unreliable. The easiest way for us would be to not use them for implementing the corresponding numext::isinf/isnan methods, but make hand-coded implementations.
Comment 1 Gael Guennebaud 2016-07-25 13:30:06 UTC
This only concerns "old" versions of clang. I've already spent a lot of time trying to workaround the issue with no luck, and I'd thus vote for wontfix. At least, we are consistent with the respective STL implementation. This is what I conclude in bug 1008.
Comment 2 Christoph Hertzberg 2016-07-25 14:15:24 UTC
If we have SSE enabled, we could hand-code this using the corresponding cmpss/cmpsd instructions.
If SSE is disabled, it seems the only error is:
  std::isinf(nan)    == 1 

which could be fixed by defining (inefficient, but correct):
  numext::isinf(x) = std::isinf(x) && ! std::isnan(x);

Unless, simply std::abs(x)>NumTraits<Scalar>::highest() works as well.

Note You need to log in before you can comment on or make changes to this bug.