Numeric test, find the solution of non-polynomial equation, play
#include <iostream>
#include <math.h>
using namespace std;
class Utility
{
public:
int static Left(int n)
{
return 8*n*n;
}
int static Right(int n)
{
return (int)64*n*log((double)n)/log(2.0);
}
void static PrintFrame(int n)
{
cout<<"n = "<<n<<" Left = "<<Left(n)<<" Right = "<<Right(n)<<endl;
}
};
int main()
{
const int MAX_SEEK = 1000;
const int SATISFY_BIG = 3;
int BigEvidence = 0;
for(int n=1;n<MAX_SEEK;n++)
{
if(Utility::Left(n)>Utility::Right(n))
{
Utility::PrintFrame(n);
BigEvidence++;
if(BigEvidence>=SATISFY_BIG)
{
break;
}
}
}
Utility::PrintFrame(43);
}