exp functions with interval
Hi,
I was trying to use the boost interval class using g++ under cygwin and
ubuntu, but unfortunately, I have trouble to use the exp function.
The following code:
#include <iostream>
#include <cmath>
#include
Le dimanche 07 octobre 2007 à 21:42 +0200, Mark Beinker a écrit :
I was trying to use the boost interval class using g++ under cygwin and ubuntu, but unfortunately, I have trouble to use the exp function. Any idea why this doesn't work?
If it was working, the "exp" interval function would rely on the "exp" function from the standard library. Unfortunately, this one does not return results rounded as the library expects them to be. As a consequence, the interval computations would not longer be guaranteed enclosures. So that the user does not mistakenly think they are, the interval elementary functions are not enabled by default for floating-point native types. You can look at examples/findroot_demo.cpp for an interval type that provides (unguaranteed) elementary functions. There is also examples/transc.cpp for a guaranteed implementation relying on MPFR. If you look through the mailing-list archive, you should find an updated version of this example that provides a guaranteed implementation relying on CRlibm instead of MPFR (as precise as MPFR yet as fast as the standard libm). Best regards, Guillaume Melquiond
participants (2)
-
Guillaume Melquiond
-
Mark Beinker