examples/cadna/cadna_failures.cpp
/*
 * an example where cadna overestimate the number of significative digits
 */
an example where cadna overestimate the number of significative digits
an example where cadna overestimate the number of significative digits
void alternatingCounter()
{
  std::cout << "An example founc in verificarlo's main schrodinger." << '\n'
            << "CADNA overestimate the number of significative digits" << std::endl;
  Sdouble c = -5e13;
  for(unsigned int i = 0; i < 100000000; i++)
  {
    if (i%2 == 0)
    {
      c = c + 1.e6;
    }
    else
    {
      c = c - 1.e-6;
    }
  }
  std::cout << "result=" << c << " expected result=" << -50 << std::endl;
  displayError(c, -50);
}
void alternatingCounter ( ) { std :: cout << " " << ' \n ' << " " << std :: endl ; Sdouble c = -5e13 ; for ( unsigned int i = 0 ; i < 100000000 ; i ++ ) { if ( i % 2 == 0 ) { c = c + 1.e6 ; } else { c = c - 1.e-6 ; } } std :: cout << " " << c << " " << -50 << std :: endl ; displayError ( c , -50 ) ; }
an example where cadna overestimate the number of significative digits
an example where cadna overestimate the number of significative digits