Boost logo

Boost Users :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2007-10-08 02:06:45


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net