exp_2.cpp

View page source

exp_2: Test

# include <cmath>           // define fabs function
# include "exp_2.hpp"       // definition of exp_2 algorithm
bool exp_2(void)
{  double x     = .5;
   double check = 1 + x + x * x / 2.;
   bool   ok    = std::fabs( exp_2(x) - check ) <= 1e-10;
   return ok;
}