Micro optimize reduction_parameters()
authorMarco Costalba <mcostalba@gmail.com>
Thu, 28 Jan 2010 11:39:15 +0000 (12:39 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 28 Jan 2010 11:39:15 +0000 (12:39 +0100)
At ply == OnePly (common case) we avoid some useless
floating point computation.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 4e42ca310536eeefa4bbcceba85ea3503ef3803c..76d05001566304798c301faa822494aee03e112d 100644 (file)
@@ -2717,7 +2717,7 @@ namespace {
       //    red = baseReduction + ln(moveCount) * ln(depth / 2) / reductionInhibitor;
       //
       logLimit = depth  > OnePly ? (1.0 - baseReduction) * reductionInhibitor / ln(depth / 2) : 1000.0;
-      gradient = ln(depth / 2) / reductionInhibitor;
+      gradient = depth  > OnePly ? ln(depth / 2) / reductionInhibitor : 0.0;
   }