[Ecls-list] Synchronous FPE

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Mon Nov 1 23:00:48 UTC 2010


ECL currently follows two different strategies for handling errors in
numerical computations

* The tough and inexpensive one, which is to activate hardware exceptions
and let the code run (Linux, Windows)

* The portable one, using feclearexcept/fetestexcept, synchronously checking
whether a numerical computation failed, right beside the code that could
make it fail.

Even though performance may be interesting, I am more and more convinced
that the second approach is the future-proof one. One reason is that we can
then forget about asynchronous, uncontrolled FPE and interruptions. The
other one is that we know better where errors happen and can have signaling
and non-signaling versions of the same function.

While I have not yet decided whether to impose the second model on other
platforms, I have managed to inline by hand the feclearexcept/fetestexcept
code in OS X/64bits, achieving a 50%-70% reduction in computation time.
Interestingly, no platform, not even Linux, seems to be inlining these
functions right now -- perhaps another reason not to follow the C99 path :-/

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20101102/26c676da/attachment.html>


More information about the ecl-devel mailing list