Hello,
I have written a program in boost which simply calculates the exponent
in an interval, but for some interval inputs it is giving the wrong
output such as for [1,3] or [-1,3]...but for some values it is giving
correct o/p such as [1,9]. Please help in solving this query.
The program is appended below....
*********************************************************************************************************************************************************
#include </boost/numeric/interval.hpp>
#include <vector>
#include <algorithm>
#include <utility>
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace boost;
using namespace numeric;
using namespace interval_lib;
template<class T, class Policies>
std::ostream &operator<<(std::ostream &os,
const boost::numeric::interval<T, Policies> &x) {
os << "[" << x.lower() << ", " << x.upper() << "]";
return os;
}
int main()
{
typedef interval<double,policies<save_state<rounded_transc_opp<double> >,checking_base<double> > > I;
//typedef interval<double> I;
I a(1,3.2);
std::cout << exp(a) << std::endl;
}
**********************************************************************************************************************************************************
Thanks in Advance.
Regards,
PV