Here's the code:
Code: Select all
static int null_new_depth ( int depth, int delta ) {
double ddelta, r;
uint64 Nodes = 0;
int cpu, rp;
for ( cpu = 0; cpu < NumThreads; cpu++ )
for ( rp = 0; rp < RPperCPU; rp++ )
Nodes += RootPosition[cpu][rp].nodes;
ddelta = MIN ( ( double ) delta, 225.0 );
if ( depth < 34 || Nodes <= 5000 * 1000 )
r = 8 + sqrt ( ddelta * depth ) / 60.0;
else if ( depth < 46 || Nodes <= 200000 * 1000 )
r = 10 + sqrt ( ddelta * depth ) / 60.0;
else
r = 12 + sqrt ( ddelta * depth ) / 60.0;
return ( depth - ( int ) r );
}